LMEgradient {lme4} | R Documentation |
The LMEgradient and LMEhessian generic functions return the gradient
and the Hessian of the
log-likelihood or log-restricted-likelihood in an lme model with
respect to the parameters of the object represented by x
.
LMEgradient(x, A, nlev) LMEhessian(x, A, H, nlev)
x |
a parameterized component of an lme model, usually the
precision matrix of an lmeLevel . Such precision matrices
inherit from the pdMat class. |
A |
an upper triangular matrix with the same number of columns as
the matrix represented by x |
H |
an array of four dimensions with each dimension same as the
number of columns of the matrix represented by x |
nlev |
integer: the number of levels of the grouping factor corresponding to the random-effects structure |
LMEgradient returns
a numeric vector of length length(coef(x))
.
LMEhessian returns
a symmetric matrix with number of columns length(coef(x))
.
Douglas Bates bates@stat.wisc.edu and Saikat DebRoy saikat@stat.wisc.edu
library(lme4) data(Oxboys, package = "nlme") m3 <- pdLogChol(~ age) as(m3, 'pdmatrix') <- crossprod(model.matrix(formula(m3), Oxboys)) LMEgradient(m3, diag(2), 19)