Compute partial derivatives regarding to the mean and the variance, and compute the design matrices.
prepareScore2(object, ...)# S3 method for gls
prepareScore2(object, X, param, attr.param, second.order,
n.cluster, n.endogenous, name.endogenous, index.obs, ...)
# S3 method for lme
prepareScore2(object, X, param, attr.param, second.order,
n.cluster, n.endogenous, name.endogenous, index.obs, ...)
prepareScore2(x, ...) <- value
# S3 method for lvmfit
prepareScore2(x, ...) <- value
# S3 method for lvm
prepareScore2(object, data, second.order,
name.endogenous = NULL, name.latent = NULL, ...)
# S3 method for lvmfit
prepareScore2(object, data = NULL, p = NULL,
usefit = TRUE, name.endogenous = NULL, name.latent = NULL,
second.order = FALSE, ...)
prepareScore2(x, ...) <- value
# S3 method for lvmfit
prepareScore2(x, ...) <- value
a latent variable model.
[internal] Only used by the generic method.
the design matrix.
the fitted parameters.
the type of each parameter (e.g. mean or variance parameter).
should the terms relative to the third derivative of the likelihood be be pre-computed?
the number of i.i.d. observations.
the number of outcomes
[optional] name of the endogenous variables
the indexes of the outcomes relative to each observation (e.g. 1,3 if only outcome 1 and 3 are observed for the observation).
same as object.
same as usefit.
[optional] data set.
[optional] name of the latent variables
same as param.
If TRUE the parameters estimated by the model are used to pre-compute quantities. Only for lvmfit objects.
For lvmfit objects, there are two levels of pre-computation:
a basic one that do no involve the model parameter
an advanced one that require the model parameters.
# NOT RUN {
m <- lvm(Y1~eta,Y2~eta,Y3~eta)
latent(m) <- ~eta
e <- estimate(m, lava::sim(m,1e2))
res <- prepareScore2(e)
res$skeleton$df.param
# }
Run the code above in your browser using DataLab