penmlogl {aster} | R Documentation |
Penalized Minus Log Likelihood for Aster Models
Description
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
.
Usage
penmlogl(parm, sigma, fixed, random, obj, y, origin, deriv = 2)
penmlogl2(parm, alpha, sigma, fixed, random, obj, y, origin)
Arguments
parm |
for |
alpha |
the vector of fixed effects. For |
sigma |
vector of square roots of variance components, one component for each group of random effects. |
fixed |
the model matrix for fixed effects. The number of rows
is |
random |
the model matrix or matrices for random effects.
Each has the same number of rows as |
obj |
aster model object, the result of a call to |
y |
response vector. May be omitted, in which case |
origin |
origin of aster model. May be omitted, in which case
default origin (see |
deriv |
number of derivatives wanted. Allowed values are 0, 1, or 2. |
Details
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.
Value
a list containing some of the following components:
value |
minus the penalized log likelihood. |
gradient |
minus the first derivative vector of the penalized log likelihood. |
hessian |
minus the second derivative matrix of the penalized log likelihood. |
argument |
the value of the |
scale |
the vector by which |
mlogl.gradient |
gradient for evaluation of log likelihood;
|
mlogl.hessian |
hessian for evaluation of log likelihood;
|
Note
Not intended for use by naive users. Use reaster
,
which calls them.
See Also
For an example using this function see the example
for pickle
.