Create and fit linear mixed-effect model (Gaussian data) or checking if an object is a fitted model.
gremlinR(formula, random = NULL, rcov = ~units, data = NULL,
ginverse = NULL, Gstart = NULL, Rstart = NULL, Bp = NULL,
maxit = 20, algit = NULL, vit = 10, v = 1, ...)mkModMats(formula, random = NULL, rcov = ~units, data = NULL,
subset = NULL, ginverse = NULL, na.action = na.pass,
offset = NULL, contrasts = NULL, Xsparse = TRUE, ...)
A formula
for the response variable and fixed effects.
A formula
for the random effects.
A formula
for the residual covariance structure.
A data.frame
in which to look for the terms in
formula
, random
, and rcov
.
A list
of (preferably sparse) inverse matrices that
are proportional to the covariance structure of the random effects.
The name of each element in the list should match a column in data
that is associated with a random term. All levels of the random term should
appear as rownames
for the matrices.
A list
of starting (co)variance values for the the
G-structure or random terms.
A list
of starting (co)variance values for the
R-structure or residual terms.
A prior specification for fixed effects.
An integer
specifying the maximum number of likelihood
iterations.
A character
vector of length 1 or more or an expression
to be evaluated that specifies the algorithm to use for proposing
(co)variances in the next likelihood iteration.
An integer
value specifying the verbosity of screen output
on each iteration. A value of zero gives no iteration specific output and
larger values increase the amount of information printed on the screen.
An integer
value specifying the verbosity of screen output
regarding the model fitting process. A value of zero gives no details and
larger values increase the amount of information printed on the screen.
Additional arguments to be passed to control the model fitting.
An expression for the subset of data
to use.
What to do with NAs.
Should an offset be specified.
Specify the type of contrasts for the fixed effects.
Should sparse matrices be used for the fixed effects design matrix.
A list
of class gremlin
or gremlinModMats
:
The model call
.
A list
of the model matrices used to construct the
mixed model equations.
The response vector.
The number of responses.
The number of columns of the original response.
The fixed effects design matrix.
The number of columns in X.
The residual design matrix.
A list of the design matrices for each random term.
The number of parameters in the G structure.
A list of generalized inverse matrices.
The log-determinants of the generalized inverse matrices - necessary to calculate the log-likelihood.
A matrix
of details about each iteration.
A two column matrix
of solutions and their sampling
variances from the mixed model.
A vector
of residual deviations, response minus
the values expected based on the solutions, corresponding to the order
in modMats$y
.
A matrix
of (co)variance components at the last
iteration.
A matrix
of values containing the Average Information
matrix, or second partial derivatives of the likelihood with respect to
the (co)variance components. The inverse of this matrix gives the
sampling variances of the (co)variance components.
A single column matrix
of first derivatives of
the (co)variance parameters with respect to the log-Likelihood.
mkModMats
: Generates model matrices.
Henderson Mrode. 2005.
# NOT RUN {
library(nadiv)
Ainv <- makeAinv(Mrode3[-c(1:2), 1:3])$Ainv
mod11 <- gremlinR(WWG11 ~ sex - 1,
random = ~ calf,
data = Mrode11,
ginverse = list(calf = Ainv),
Gstart = matrix(0.2), Rstart = matrix(0.4),
maxit = 10, v = 2)
is(mod11)
# }
Run the code above in your browser using DataLab