gibbs.coef: Gibbs sampler for random coefficient model

Description Usage Arguments Value

View source: R/hmi_mainfunctions_2016-07-27withMCMCglmm.R View source: R/hmi_mainfunctions_2016-07-13.R

Description

It generates the Markov chains of the imputation parameters by drawing from their conditional distributions until convergence

It generates the Markov chains of the imputation parameters by drawing from their conditional distributions until convergence

Usage

1
2
3
4
5
gibbs.coef(y_gibbs, X_gibbs, Z_gibbs, clID, n.iter = 100, M = 10,
  n.chains = 3, burn.in = 1/3, max.iter = 5000)

gibbs.coef(y_gibbs, X_gibbs, Z_gibbs, clID, n.iter = 100, M = 10,
  n.chains = 3, burn.in = 1/3, max.iter = 5000)

Arguments

y_gibbs

A vector or data.frame with ncol = 1 containing the target variable with the missing values.

X_gibbs

A data.frame containing the covariates influencing y via fixed effects. If rows with missing values in X should also be imputed, put all your variables in a data.frame (or matrix)

Z_gibbs

A data.frame containing the covariates influencing y via random effects

clID

A factor (should come as data.frame or vector) containing the cluster IDs.

n.iter

An integer defining the number of iterations that should be run in each bunch of iterations.

M

An integer defining the number of imputations that should be made.

n.chains

An integer defining the number of Markov chains to be made.

burn.in

A numeric between 0 and 1 defining the percentage of draws from the gibbs sampler that should be discarded as burn in.

max.iter

An integer defining the maximum number of iterations that should be run in total.

y

A vector or data.frame with ncol = 1 containing the target variable with the missing values.

X

A vector a data.frame containing the covariates influencing y via fixed effects. If rows with missing values in X should also be imputed, put all your variables in a data.frame (or matrix)

Z

A vector a data.frame containing the covariates influencing y via random effects

cl.id

A factor (should come as data.frame or vector) containing the cluster IDs.

m

An integer defining the number of imputations that should be made.

n.iter

An integer defining the number of iterations that should be run in each bunch of iterations.

max.iter

An integer defining the maximum number of iterations that should be run in total.

n.chains

An integer defining the number of Markov chains to be made.

burn.in

A numeric between 0 and 1 defining the percentage of draws from the gibbs sampler that should be discarded as burn in.

Value

It returns a multidimensional vector with the Markov chains containing the imputation parameters needed for imp_multi.

It returns a multidimensional vector with the Markov chains containing the imputation parameters needed for imp_multi.


matthiasspeidel/hmi documentation built on Aug. 18, 2020, 4:37 p.m.