Why Fitted Likelihood Needs a Correction
A fitted model is evaluated on the same observations that helped determine its parameter estimates. That reuse makes the fitted log-likelihood look better than the log-likelihood the model is expected to achieve on new observations. AIC corrects for this optimism: in a regular, correctly specified model, the expected difference in total log-likelihood is approximately the number of estimated parameters. Since the deviance scale is negative twice the log-likelihood, the corresponding correction is twice that number.
The correction is an estimate of predictive performance for a fixed candidate model. It is not a guarantee that the model is correct, and its usual derivation does not remove extra optimism caused by searching over many models and then reporting only the selected one.
Predictive Optimism and the AIC Definition
For independent observations with a common density or mass function \(f(y;\theta)\), the log-likelihood for a data set \(y=(y_1,\ldots,y_n)\) is \(\ell_y(\theta)=\sum_{i=1}^n \log f(y_i;\theta)\). If the model has \(k\) freely estimated parameters and satisfies the regularity conditions below, the expected optimism is approximately \(k\) log-likelihood units. Thus an estimate of expected future negative twice log-likelihood is
Here \(k\) counts the free parameters estimated by maximum likelihood, including an estimated dispersion parameter when it is part of the likelihood. AIC values are comparable only when they come from likelihoods for the same response data under a consistent likelihood convention. In particular, likelihood constants may be omitted when they are common across candidate models, but then the reported AIC values are shifted by the same constant.
Deriving the Parameter-Count Correction
Write \(s(Y_i;\theta_0)=\partial \log f(Y_i;\theta)/\partial\theta\vert_{\theta=\theta_0}\), and define the total score \(U=\sum_{i=1}^n s(Y_i;\theta_0)\). Under the stated assumptions, \(E[U]=0\), \(E[UU^T]=nI\), and \(\hat{\theta}-\theta_0=I^{-1}U/n+r_n\), where the remainder \(r_n\) is small enough in mean square that \(E[U^Tr_n]=o(1)\).
Let \(Q(\theta)=E_{\theta_0}[\log f(Y;\theta)]\) be the expected log density of one future observation. Correct specification and the information identity give \(\nabla Q(\theta_0)=0\) and \(\nabla^2Q(\theta_0)=-I\). Taylor expansion of the training log-likelihood and the expected future log-likelihood therefore gives
Conditionally on the training data, \(nQ(\hat{\theta})\) is the expected log-likelihood on an independent future sample. Subtracting the second expansion from the first cancels the quadratic terms. Also, \(E[\ell_Y(\theta_0)-nQ(\theta_0)]=0\), since both terms have the same expectation. Hence
For the last equality, \(E[U^TI^{-1}U]=\operatorname{tr}(I^{-1}E[UU^T])=\operatorname{tr}(I^{-1}nI)=nk\). This proves the optimism result. Multiplying the log-likelihood optimism by two gives the \(2k\) correction on the negative-twice-log-likelihood scale used by AIC. \(\square\)
The same argument applies to regular GLMs with independent responses and a fixed design when the likelihood is correctly specified and the information matrix is nonsingular, with the information matrices summed over observations. The trace calculation then yields the dimension of the fitted parameter vector. The fixed-dimension and regularity conditions matter: the derivation does not assert an exact finite-sample correction for every GLM.
Worked Examples
Worked Example: Exact Optimism for a Normal Mean
Let \(Y_1,\ldots,Y_n\) be independent \(N(\mu,\sigma^2)\) observations, with known \(\sigma^2\) and unknown \(\mu\). The maximum-likelihood estimate is \(\hat{\mu}=\bar{Y}\), and there is one estimated parameter, so \(k=1\).
The fitted training log-likelihood is \(\ell_Y(\hat{\mu})=-\frac n2\log(2\pi\sigma^2)-\frac{1}{2\sigma^2}\sum_i(Y_i-\bar{Y})^2\). Since \(E[\sum_i(Y_i-\bar{Y})^2]=(n-1)\sigma^2\), its expectation is \(-\frac n2\log(2\pi\sigma^2)-\frac{n-1}{2}\).
For an independent future sample, condition on \(\bar{Y}\). Because \(E[(Y_i^*-\bar{Y})^2\mid\bar{Y}]=\sigma^2+(\bar{Y}-\mu)^2\), and \(E[(\bar{Y}-\mu)^2]=\sigma^2/n\), the expected future log-likelihood is \(-\frac n2\log(2\pi\sigma^2)-\frac n2-\frac12\).
Subtracting future from training gives an optimism of \(\bigl[-(n-1)/2\bigr]-\bigl[-n/2-1/2\bigr]=1\) log-likelihood unit. The AIC correction is therefore \(2k=2\). In this model the expected optimism calculation is exact, not merely an asymptotic approximation.
Worked Example: AIC for Two Binomial GLMs
Suppose two groups each contain 10 binary outcomes. Group 1 has 2 successes and group 2 has 6. Compare an intercept-only binomial model with a model having a separate success probability for each group. Use the grouped-binomial likelihood, including the binomial coefficients.
Under the intercept-only model, the maximum-likelihood estimate is \(\hat{p}=8/20=0.4\). Its log-likelihood is \(\ell_0=\log\{\binom{10}{2}\binom{10}{6}\}+8\log(0.4)+12\log(0.6)\). Since \(\binom{10}{2}\binom{10}{6}=45(210)=9450\), this is \(9.15377-13.46023=-4.30646\). The model estimates one parameter, so \(\operatorname{AIC}_0=-2(-4.30646)+2(1)=10.6129\).
Under the group model, the estimates are \(\hat{p}_1=2/10=0.2\) and \(\hat{p}_2=6/10=0.6\). The log-likelihood, again including both binomial coefficients, is \(\ell_1=\log(9450)+2\log(0.2)+8\log(0.8)+6\log(0.6)+4\log(0.4)\). The probability terms sum to \(-11.73414\), so \(\ell_1=9.15377-11.73414=-2.58037\). With two estimated parameters, \(\operatorname{AIC}_1=-2(-2.58037)+2(2)=9.1607\).
The group model’s log-likelihood is higher by \(-2.58037-(-4.30646)=1.72609\), and its negative twice log-likelihood is lower by \(3.45218\). But the AIC penalty increases by 2, so its AIC is lower by only \(10.6129-9.1607=1.4522\). The binomial-coefficient contribution is included in both absolute AIC values; it is common to the models, so it does not change their difference.
Worked Example: AIC for Poisson Rate Models
Six observations have unit exposure. The counts are \(0,1,1\) in group A and \(2,2,2\) in group B. Compare a common-rate Poisson model with a model having separate rates for the two groups. For counts \(y_i\), the log-likelihood is \(\sum_i[y_i\log(\lambda_i)-\lambda_i-\log(y_i!)]\).
The common-rate estimate is \(\hat{\lambda}=8/6=4/3\). The factorial terms sum to \(3\log(2)\), because there are three counts equal to 2 and all other counts are 0 or 1. Thus \(\ell_0=8\log(4/3)-8-3\log(2)= -7.77798\). There is one estimated rate, so \(\operatorname{AIC}_0=-2(-7.77798)+2=17.5560\).
With separate rates, \(\hat{\lambda}_A=2/3\) and \(\hat{\lambda}_B=2\). The log-likelihood is \(\ell_1=2\log(2/3)-2+6\log(2)-6-3\log(2)=-6.73149\). There are two estimated rates, giving \(\operatorname{AIC}_1=-2(-6.73149)+4=17.4630\). The group model improves the log-likelihood by \(1.04649\), which lowers negative twice log-likelihood by \(2.09298\); its additional AIC penalty is 2. Its AIC is therefore lower by about \(0.0930\), a small difference rather than decisive evidence of a predictive advantage.
Assumptions, Interpretation, and Common Pitfalls
AIC’s penalty is a derived approximation, not a universal finite-sample law. Its standard parameter-count form relies on a regular likelihood model: parameters should be identifiable and interior, the information should be nonsingular, and the likelihood should be sufficiently smooth. The usual derivation also assumes the candidate model is correctly specified and that the number of parameters remains fixed as sample size grows. For fitted GLMs, separation, boundary estimates, sparse data, or a poorly identified parameter can undermine the regular approximation.
If the likelihood is misspecified, the information identity used in the derivation need not hold, and the optimism correction is not generally \(k\); a correction involving both score variability and curvature may be needed. Likewise, quasi-likelihood alone does not define an ordinary likelihood-based AIC. The likelihood and its parameter count must match the fitted model and the data representation.
A frequent mistake is to say that AIC adds \(k\) to the negative log-likelihood. The derived optimism is approximately \(k\) on the log-likelihood scale, but AIC uses negative twice log-likelihood, so the addition is \(2k\). Another mistake is to treat AIC as a test of whether a model is true. It is instead an estimated predictive comparison under its assumptions; a small AIC difference can indicate that the candidates have similar estimated predictive performance.
Check Your Understanding
Use the definitions and derivation above to answer the following questions.
- In the optimism definition, why is the future sample independent of the training sample, and why is the fitted estimate held fixed when evaluating future data?
- A model estimates four free likelihood parameters. What is its AIC penalty, and on which scale is that penalty applied?
- In the normal-mean example, identify the two contributions that make the exact expected optimism equal to one log-likelihood unit.
- Why do binomial coefficients common to two candidate models leave their AIC difference unchanged, while still affecting their absolute AIC values?
- Name two regularity conditions or data features that can make the usual \(2k\) approximation unreliable.