mcmc
object,
which can be subsequently analyzed with functions provided in
the coda package.MCMCpanel(obs, Y, X, W, burnin = 1000, mcmc = 10000, thin = 5,
verbose = FALSE, seed = 0, beta.start = NA, sigma2.start = NA,
D.start = NA, b0 = 0, B0 = 1, eta0, R0, nu0 = 0.001,
delta0 = 0.001, ...)
mcmc
object that contains the posterior density sample. This
object can be summarized by functions provided by the coda package.MCMCpanel
simulates from the posterior density sample using
the blocked Gibbs sampler of Chib and Carlin (1999), Algorithm 2.
The simulation proper
is done in compiled C++ code to maximize efficiency. Please consult
the coda documentation for a comprehensive list of functions that can be
used to analyze the posterior density sample.
The model takes the following form:
$$y_i = X_i \beta + W_i b_i + \varepsilon_i$$
Where the random effects:
$$b_i \sim \mathcal{N}_q(0,D)$$
And the errors:
$$\varepsilon_i \sim \mathcal{N}(0, \sigma^2 I_k)$$
We assume standard, conjugate priors:
$$\beta \sim \mathcal{N}(b0,B0^{-1})$$
And:
$$\sigma^{-2} \sim \mathcal{G}amma(\nu_0/2, \delta_0/2)$$
And:
$$D^{-1} \sim \mathcal{W}ishart(\eta_0, R_0^{-1})$$
See Chib and Carlin (1999) or Martin and Saunders (2002) for more details.
NOTE: Unlike most models in MCMCpack, we do not provide default
parameters for the priors on the precision matrix for the random effects.
When fitting one of these models, it is of utmost importance to choose a
prior that reflects your prior beliefs about the random effects. Using the
dwish
and rwish
functions might be useful in choosing these
values. Andrew D. Martin, Kevin M. Quinn, and Daniel Pemstein. 2002. Scythe
Statistical Library 0.3.
plot.mcmc
,summary.mcmc
posterior <- MCMCpanel(obs, Y, X, W, eta0 = 4, R0 = 1)
Run the code above in your browser using DataLab