Distribution of the Akaike information criterion in a normal linear model (source code)

= Distribution of the Akaike information criterion in a normal linear model
{c}
{title2=$\mathrm{AIC}$}

Consider the correctly specified fixed-design <normal linear model> $Y=X\beta+\varepsilon$, with $X$ an $n\times p$ full-column-rank <design matrix>, $n>p$, and $\varepsilon\sim N_n(0,\sigma^2I_n)$ with $\sigma^2>0$. Both $\beta$ and $\sigma^2$ are unknown, so the <Akaike information criterion> counts $p+1$ fitted <parameters>. If $\mathrm{RSS}=\lVert Y-X\widehat\beta\rVert^2$ is the <residual sum of squares>, then
$$
-2\ell(\widehat\beta,\widehat\sigma^2)
=n\{\log(2\pi)+1+\log(\mathrm{RSS}/n)\},\qquad
\widehat\sigma^2=\mathrm{RSS}/n.
$$
The orthogonal-projection decomposition of a <random variable> with a <multivariate normal distribution> gives $\mathrm{RSS}/\sigma^2\sim\chi^2_{n-p}$. Substituting into $\mathrm{AIC}=-2\ell(\widehat\beta,\widehat\sigma^2)+2(p+1)$ yields
$$
\mathrm{AIC}\overset d=
n\log(\chi^2_{n-p})+
n\{\log(2\pi\sigma^2/n)+1\}+2(p+1).
$$
Here $\chi^2_{n-p}$ denotes a <random variable>, not a <quantile>. The <maximum-likelihood estimator> of the error <variance> uses divisor $n$; the unbiased residual <variance> estimator with divisor $n-p$ cannot be substituted into the maximized <likelihood>. If $n=p$ and $X$ is invertible, the fit has zero <residual sum of squares>, and the Gaussian <likelihood> is unbounded as $\sigma^2$ decreases to zero. There is then no finite positive-variance <maximum-likelihood estimator> to which the displayed <Akaike information criterion> law applies.