For method = "steinian"
and an object of class merMod
computed
the analytic representation of the corrected conditional AIC in Greven and
Kneib (2010). This is based on a the Stein formula and uses implicit
differentiation to calculate the derivative of the random effects covariance
parameters w.r.t. the data. The code is adapted form the one provided in
the supplementary material of the paper by Greven and Kneib (2010). The
supplied merMod
model needs to be checked if a random
effects covariance parameter has an optimum on the boundary, i.e. is zero.
And if so the model needs to be refitted with the according random effect
terms omitted. This is also done by the function and the refitted model is
also returned. Notice that the boundary.tol
argument in
lmerControl
has an impact on whether a parameter is
estimated to lie on the boundary of the parameter space. For estimated error
variance the degrees of freedom are increased by one per default.
sigma.penalty
can be set manually for merMod
models
if no (0) or more than one variance component (>1) has been estimated. For
lme
objects this value is automatically defined.
If the object is of class merMod
and has family =
"poisson"
there is also an analytic representation of the conditional AIC
based on the Chen-Stein formula, see for instance Saefken et. al (2014). For
the calculation the model needs to be refitted for each observed response
variable minus the number of response variables that are exactly zero. The
calculation therefore takes longer then for models with Gaussian responses.
Due to the speed and stability of 'lme4' this is still possible, also for
larger datasets.
If the model has Bernoulli distributed responses and method =
"steinian"
, cAIC
calculates the degrees of freedom based on a
proposed estimator by Efron (2004). This estimator is asymptotically
unbiased if the estimated conditional mean is consistent. The calculation
needs as many model refits as there are data points.
Another more general method for the estimation of the degrees of freedom is
the conditional bootstrap. This is proposed in Efron (2004). For the B
boostrap samples the degrees of freedom are estimated by $$\frac{1}{B -
1}\sum_{i=1}^n\theta_i(z_i)(z_i-\bar{z}),$$ where \(\theta_i(z_i)\) is the
i-th element of the estimated natural parameter.
For models with no random effects, i.e. (g)lms, the cAIC
function returns the AIC of the model with scale parameter estimated by REML.