lmm_proper: Fit a linear mixed model with a proper prior.

Description Usage Arguments Value Warning References

View source: R/lmm-proper.R

Description

Fits a Bayesian linear mixed model with a normal prior on the fixed effects beta and an gamma prior on the precision lambda for the fixed effects and error term. The formula syntax is the same as lme4::lmer which is used to obtain the model matrices. Only a single intercept is supported for the random effects.

Usage

1
2
3
lmm_proper(data, formula, burnin = 5000, iterations = 5000, thin = 1,
  beta_prior_mean, beta_prior_cov, lambda_prior_shape, lambda_prior_rate,
  start_theta)

Arguments

data

A data frame.

formula

A formula describing the model fit. Passed to lme4::lmer to construct model matrices.

burnin

Number of burn in iterations

iterations

Number of sampling iterations

thin

Number of thinning iterations

beta_prior_mean

(Optional) Mean vector for the prior on beta. Defaults to zero.

beta_prior_cov

(Optional) Covariance matrix for the prior on beta. Defaults to diag(p) * 100 where p is the number of predictors.

lambda_prior_shape

(Optional) Shape parameter for the prior on the precision of the error term and random effects, in that order. Defaults to c(0.001, 0.001).

lambda_prior_rate

(Optional) Rate parameter for the prior on the precision of the error term and random effects, in that order. Defaults to c(0.001, 0.001).

start_theta

(Optional) Starting vector for θ = (β' u')', the concatenation of the fixed and random effects coefficients. Defaults to the frequentist estimate.

Value

An object of class geblm containing samples from the posterior distributions of the fixed effects, random effects, and standard deviations of the fixed effects and errors.

Warning

We leave it to the user to ensure only a single intercept is specified in the model formula.

References

Roman, J. C. and Hobert, J. P. (2015). Geometric ergodicity of Gibbs samplers for Bayesian general linear mixed models with proper priors. Linear Algebra and its Applications,47 354–77.


asbates/geblm documentation built on Nov. 12, 2019, 5:23 p.m.