Usage
fastmcmc.lmm(y, subj, pred, xcol, zcol, prior, seed, vmax,
occ, start.mode, maxits=100, eps=0.0001, iter=1000,
start.mcmc, df=4)
Arguments
y
vector of responses. This is simply the individual yi vectors
stacked upon one another. Each element of y represents the
observed response for a particular subject-occasion, or for a
particular unit within a cluster.
subj
vector of same length as y, giving the subject (or cluster)
indicators i for the elements of y. For example, suppose
that y is c(y1,y2,y3,y4) where length(y1)=2, length(y2)=3,
length(y3)=2, and length(y4)=7. Then subj should be
c(1,1,2,2,2,3,3,4,4,4,
pred
matrix of covariates used to predict y. The number of rows
should be length(y). The first column will typically be
constant (one), and the remaining columns correspond to other
variables appearing in Xi and Zi.
xcol
vector of integers indicating which columns of pred will be
used in Xi. That is, pred[,xcol] is the Xi matrices (stacked
upon one another.
zcol
vector of integers indicating which columns of pred will be
used in Zi. That is, pred[,zcol] is the Zi matrices (stacked
upon one another).
prior
A list with four components specifying the hyperparameters of
the prior distribution applied to sigma2 and psi. The
components must be named "a", "b", "c", and "Dinv". All are
scalars except for "Dinv", which is a matrix of dimension
c(length(zcol),le
seed
Seed for random number generator. This should be a positive
integer.
vmax
optional matrix of dimension c(max(occ),max(occ)) from which
the Vi matrices will be extracted. In a longitudinal dataset,
vmax would represent the Vi matrix for an individual with
responses at all possible occasions 1,2,...,nmax=max(occ);
for indivi
occ
vector of same length as y indicating the "occasions" for the
elements of y. This argument is relevant only if a
non-identity vmax is specified. In a longitudinal dataset
where each individual is measured on at most nmax distinct
occasions, each eleme
start.mode
optional starting values of the parameters for the
mode-finding procedure. If this argument is not given then
the function chooses its own starting values. This argument
should be a list of three elements named "beta", "psi", and
"sigma2". Note that
maxits
maximum number of cycles of the mode-finding procedure. The
algorithm runs to convergence or until "maxits" iterations,
whichever comes first.
eps
convergence criterion for the mode-finding procedure. The
algorithm is considered to have converged if the relative
differences in all parameters from one iteration to the next
are less than eps--that is, if all(abs(new-old)
iter
number of cycles of the MCMC procedure to be performed.
start.mcmc
optional starting values of the parameters for the MCMC
procedure. If this argument is not given, then the procedure
is started at the posterior mode.
df
degrees of freedom for the multivariate t approximation in the
Metropolis-Hastings algorithm.