respModule-class {MatrixModels}R Documentation

"respModule" and derived classes

Description

The "respModule" class is the virtual base class of response modules for glpModel model objects. Classes that inherit from "respModule" include glmRespMod, for generalized linear models, nlsRespMod, for nonlinear models and nglmRespMod for generalized nonlinear models.

Objects from the Class

Objects from these classes are usually created with mkRespMod as part of an glpModel object returned by model-fitting functions such as the hidden function glm4.

Slots

mu:

Fitted mean response.

offset:

offset in the linear predictor – always present even if it is a vector of zeros. In an nlsRespMod object the length of the offset can be a multiple of the length of the response.

sqrtXwt:

the matrix of weights for the model matrices, derived from the sqrtrwt slot.

sqrtrwt:

Numeric vector of the square roots of the weights for the residuals. For respModule and nlsRespMod objects these are constant. For glmRespMod and nglmRespMod objects these are updated at each iteration of the iteratively reweighted least squares algorithm.

weights:

Prior weights – always present even when it is a vector of ones.

y:

Numeric response vector.

family:

a glm family, see family for details - glmRespMod objects only.

eta:

numeric vector, the linear predictor that is transformed to the conditional mean via the link function - glmRespMod objects only.

n:

a numeric vector used for calculation of the aic family function (it is really only used with the binomial family but we need to include it everywhere) - glmRespMod objects only.

nlenv:

an environment in which to evaluate the nonlinear model function - nlsRespMod objects only.

nlmod:

an unevaluated call to the nonlinear model function - nlsRespMod objects only.

pnames:

a character vector of parameter names - nlsRespMod objects only.

Methods

fitted

signature(object = "respModule"): fitted values; there may be several types, corresponding to the residuals, see there (below).

residuals

signature(object = "respModule"): residuals, depending on the type of the model, there are several types of residuals and correspondingly residuals, see residuals.glm from the stats package. Because many of these types of residuals are identical except for objects that inherit from "glmRespMod", a separate method is defined for this subclass.

See Also

mkRespMod

Examples

showClass("respModule")
showClass("glmRespMod")
showClass("nlsRespMod")

[Package MatrixModels version 0.4-1 Index]