varcov-set-.tramME: Set the values of the random effects covariance matrices of a...

varcov<-.tramMER Documentation

Set the values of the random effects covariance matrices of a tramME model.

Description

Sets the list containing the covariance matrices of a tramME model. The matrices have to be positive definite. Just as in "coef<-", when the function is called on a fitted object, the function will remove the infromation about the optimization.

Usage

## S3 replacement method for class 'tramME'
varcov(object, as.theta = FALSE, ...) <- value

Arguments

object

A tramME object.

as.theta

Logical value, if TRUE, indicating that the new values are supplied in their reparameterized form.

...

Optional arguments (ignored).

value

A list of positive definite covariance matrices.

Details

The supplied list has to be named with the same names as implied by the model. Hence, it might be a good idea to call varcov first, and modify this list to make sure that the input has the right structure.

The new values can also be supplied in a form that corresponds to the reparametrization used by the tramTMB model (see the option as.theta = TRUE).

All random effects variance parameters must be supplied. When there are penalized smooth terms in the model variance parameters corresponding to these should also be part of the input list.

Value

A new tramME object with the new coefficient values.

Examples

data("sleepstudy", package = "lme4")
mod <- LmME(Reaction ~ Days + (Days | Subject), data = sleepstudy, nofit = TRUE)
vc <- varcov(mod)
vc[[1]] <- matrix(c(1, 0, 0, 2), ncol = 2)
varcov(mod) <- vc

tramME documentation built on July 9, 2023, 7:10 p.m.