mcmcsamp                package:lme4                R Documentation

_G_e_n_e_r_a_t_e _a_n _M_C_M_C _s_a_m_p_l_e

_D_e_s_c_r_i_p_t_i_o_n:

     This generic function generates a sample from the posterior
     distribution of the parameters of a fitted model using Markov
     Chain Monte Carlo methods.

_U_s_a_g_e:

     mcmcsamp(object, n, verbose, ...)
     ## S4 method for signature 'mer':
     mcmcsamp(object, n, verbose, saveb, ...)

_A_r_g_u_m_e_n_t_s:

  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.

_V_a_l_u_e:

     An object of class '"merMCMC"' for which many methods are defined.

_E_x_a_m_p_l_e_s:

     (fm1 <- lmer(Reaction ~ Days + (1|Subject) + (0+Days|Subject), sleepstudy))
     set.seed(101); samp0 <- mcmcsamp(fm1, n = 1000)
     str(samp0)

