Variational Bayes for linear mixed model (random intercept and coefficient only).
Source:R/RcppExports.R
vb_lmm_randintslope.Rd
Performs variational inference for random intercept and coefficient model. Currently assumes that all groups have same number of parameters. That is, that all Zlist elements are of equal dimension.
Usage
vb_lmm_randintslope(
Xlist,
Zlist,
ylist,
beta_mu0,
beta_sigma0,
nu_Omega0,
lambda_Omega0,
pr_Omega = 1L,
sigma_a0 = 0.01,
sigma_b0 = 0.01,
pr_sigma = 1L,
tol = 1e-08,
maxiter = 100L,
verbose = FALSE,
trace = FALSE,
streamlined = FALSE,
use_elbo = TRUE
)
Arguments
- Xlist
A list of subject specific design matrices
- Zlist
A list of subject specific group matrices
- ylist
A list of subject specific responses
- beta_mu0
Prior mean for beta
- beta_sigma0
Prior covariance for beta
- nu_Omega0
Prior df for Omega
- lambda_Omega0
Prior scale matrix for Omega
- pr_Omega
Prior type for Omega - 1 is IW(nu, lambda), 2 is HW(nu, 2*nu*diag(1/lambda^2))
- sigma_a0
The first hyper-parameter for prior on sigma
- sigma_b0
The second hyper-parameter for prior on sigma
- pr_sigma
The prior to use for sigma_epsilon - 1 is IG(a0,b0) and 2 is Half-t(a0, b0)
- tol
Tolerance level for assessing convergence
- maxiter
Maximum number of fixed-update iterations
- verbose
Print trace of ELBO
- trace
Return trace of parameters beta, gamma
- streamlined
Use streamlined updates (more efficient if dim(Zlist) is large).
- use_elbo
Should the ELBO be calculated and used for convergence checks?