mcmcsamp {lme4} | R Documentation |
This generic function generates a sample from the posterior distribution of the parameters of a fitted model using Markov Chain Monte Carlo methods.
mcmcsamp(object, n, verbose, ...) ## S4 method for signature 'mer': mcmcsamp(object, n, verbose, saveb, ...)
object |
An object of a suitable class - usually an
"mer" object. |
n |
integer - number of samples to generate. Defaults to 1. |
verbose |
logical - if TRUE verbose output is printed.
Defaults to FALSE . |
saveb |
logical - if TRUE the values of the random effects
are saved as part of the chain. Default is FALSE . Note that
saving the random effects can require a considerable amount of
memory. Use with caution. |
... |
Some methods may take additional, optional arguments. |
An object of class "merMCMC"
for which many
methods are defined.
(fm1 <- lmer(Reaction ~ Days + (1|Subject) + (0+Days|Subject), sleepstudy)) set.seed(101); samp0 <- mcmcsamp(fm1, n = 1000) str(samp0)