# Will off-diagonal elements of Cov-Matrix contribute to number of parameters for AIC?

This question was originally asked by a colleague with regards to calculation of AIC for a non-linear mixed effects model (nlme) where off-diagonal elements of the covariance matrix are estimated. The equations for AIC (from Wikipedia):

\begin{align} AIC &= OFV + 2k \\ BIC &= OFV + k \ln(n) \end{align}

with $k$ the number of (non-fixed) parameters, and $n$ the number of observations (and $OFV = -2LL$ for a nlme model using maximum likelihood).

Question: Would only the diagonal elements of the random effects matrix count in k, or also the off-diagonal elements, if estimated? Would the off-diagonal elements really count as a full degree of freedom?

My thoughts after reading this paper1 are that AIC in its native expression can be used mostly for linear models. AIC also depends on the estimation method used, marginal vs conditional likelihood. Even if we have to use the "conditional AIC" (cAIC) that the authors suggest in the paper, how would we treat the off-diagonal elements of the random effect matrix: would they contribute to the degrees of freedom and by what extent?

Would any of you consider using AIC for complex nlme model with many random effects and possible correlations?

1.Vaida, F. and S. Blanchard, Conditional Akaike information for mixed-effects models. Biometrika, 2005. 92(2): p. 351-370.

• +1. Care should be taken with these kinds of things. For example, if you fit a random effects model with 2 random effects in lme4, the covariance between the random effects is automatically estimated (you have to specify them as independent to disable this). Therefore, if you delete one of the random effects from the model, you've actually deleted two parameters, so any inference should make note of this. Commented May 20, 2012 at 18:00