lme4 (version 0.3-6)

LMEgradient: The gradient in lme optimization

Description

This generic function returns the gradient of the log-likelihood or log-restricted-likelihood in an lme model with respect to the parameters of the object represented by x.

Usage

LMEgradient(x, A, nlev)

Arguments

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
nlev
integer: the number of levels of the grouping factor corresponding to the random-effects structure

Value

  • a numeric vector of length length(coef(x)).

See Also

pdMat-class, lmeLevel-class

Examples

Run this code
library(lme4)
data(Oxboys, package = "nlme")
m3 <- pdLogChol(~ age)
as(m3, 'pdmatrix') <- crossprod(model.matrix(formula(m3), Oxboys))
LMEgradient(m3, diag(2), 19)

Run the code above in your browser using DataCamp Workspace