Penalized minus log likelihood for an aster model, and its first and second
derivative. The penalization allows for (approximate) random effects.
These functions are called inside pickle
,
pickle1
, pickle2
, pickle3
,
and reaster
.
penmlogl(parm, sigma, fixed, random, obj, y, origin, deriv = 2)
penmlogl2(parm, alpha, sigma, fixed, random, obj, y, origin)
a list containing some of the following components:
minus the penalized log likelihood.
minus the first derivative vector of the penalized log likelihood.
minus the second derivative matrix of the penalized log likelihood.
the value of the parm
argument for this function.
the vector by which parm
must be scaled to obtain
the true random effects.
gradient for evaluation of log likelihood;
gradient
is this plus gradient of penalty.
hessian for evaluation of log likelihood;
hessian
is this plus hessian of penalty.
for penmlogl
, parameter value (vector of regression
coefficients and rescaled random effects) at which we evaluate the
penalized log likelihood. For penmlogl2
the vector of rescaled
random effects only (see next item).
the vector of fixed effects. For penmlogl2
, the
concatenation c(alpha, parm)
is the same as parm
that
is supplied to pemnmlogl
.
vector of square roots of variance components, one component for each group of random effects.
the model matrix for fixed effects. The number of rows
is nrow(obj$data)
.
The number of columns is the number of fixed effects.
the model matrix or matrices for random effects.
Each has the same number of rows as fixed
. The number of columns
is the number of random effects in a group. Either a matrix or a list
of matrices.
aster model object, the result of a call to aster
.
response vector. May be omitted, in which case obj$x
is used. If supplied, must be a matrix of the same dimensions as
obj$x
.
origin of aster model. May be omitted, in which case
default origin (see aster
) is used. If supplied, must be
a matrix of the same dimensions obj$x
.
number of derivatives wanted. Allowed values are 0, 1, or 2.
Consider an aster model with random effects and canonical parameter vector
of the form
$$M \alpha + Z_1 b_1 + \cdots + Z_k b_k$$
where \(M\) and each \(Z_j\) are known matrices having the same
row dimension, where \(\alpha\) is a vector of unknown parameters
(the fixed effects) and each \(b_j\) is a vector of random effects
that are supposed to be (marginally) independent and identically distributed
mean-zero normal with variance sigma[j]^2
.
These functions evaluate minus the “penalized log likelihood” for this model, which considers the random effects as parameters but adds a penalization term $$b_1^2 / (2 \sigma_1^2) + \cdots + b_k^2 / (2 \sigma_k^2)$$ to minus the log likelihood.
To properly deal with random effects that are zero, random effects are rescaled by their standard deviation. The rescaled random effects are \(c_i = b_i / \sigma_i\). If \(\sigma_i = 0\), then the corresponding rescaled random effects \(c_i\) are also zero.
For an example using this function see the example
for pickle
.