Algorithm Search⌘K

Definitioncore

Akaike information criterion

Also called AIC.

AIC = -2 log L + 2k. It estimates how well a fitted model will predict new data from the same source. Lower is better, and only differences on the same data mean anything.

The Akaike information criterion of a model fitted by maximum likelihood is AIC=−2log⁡L(θ^)+2k\mathrm{AIC} = -2\log L(\hat\theta) + 2k, where L(θ^)L(\hat\theta) is the maximized likelihood and kk is the number of estimated parameters. The maximized log-likelihood is a biased estimate of how well the fitted model will predict new data from the same source: the fit was tuned to the data it is scored on, and the bias is about kk. AIC removes this bias. Among models fitted to the same data, the model with the smallest AIC has the best estimated fit to new data. AIC does not test a model, and its absolute value has no meaning; only differences between models on the same data do.

Definition

Let y=(y1,…,yn)y = (y_1, \dots, y_n) be the data, and let a model be a family of densities f(y;θ)f(y; \theta) with θ\theta in an open subset of Rk\mathbb R^k. Let θ^\hat\theta be the maximum likelihood estimate and l(θ^)=log⁡f(y;θ^)l(\hat\theta) = \log f(y; \hat\theta). Then

AIC=−2 l(θ^)+2k.\mathrm{AIC} = -2\,l(\hat\theta) + 2k.

The parameter count kk includes every estimated parameter, for example the variance of a normal model. For a normal linear regression with an n×pn \times p design matrix XX of rank pp whose columns include the intercept, coefficient vector bb and residual sum of squares RSS, the estimates are b^\hat b and σ^2=RSS/n\hat\sigma^2 = \mathrm{RSS}/n, so k=p+1k = p + 1 and

AIC=nlog⁡2π RSSn+n+2(p+1).\mathrm{AIC} = n\log\frac{2\pi\,\mathrm{RSS}}{n} + n + 2(p + 1).

The corrected criterion of Hurvich and Tsai (1989) is

AICc=AIC+2k(k+1)n−k−1,n>k+1.\mathrm{AICc} = \mathrm{AIC} + \frac{2k(k + 1)}{n - k - 1}, \qquad n > k + 1.

For a list of models M1,…,MRM_1, \dots, M_R with criteria ArA_r, let Δr=Ar−min⁡sAs\Delta_r = A_r - \min_s A_s. The Akaike weights are wr=e−Δr/2/∑se−Δs/2w_r = e^{-\Delta_r/2}/\sum_s e^{-\Delta_s/2}.

Facts.

  1. What AIC estimates. Let y∗y^* be a new sample of the same size, independent of yy and with the same law gg, and let T=Ey Ey∗log⁡f(y∗;θ^(y))T = \mathrm E_y\,\mathrm E_{y^*}\log f(y^*; \hat\theta(y)) be the expected log-likelihood of new data under the fitted model. Then −2T-2T equals −2 Ey∗log⁡g(y∗)-2\,\mathrm E_{y^*}\log g(y^*), which is the same for all models, plus twice the expected Kullback-Leibler divergence from the fitted model to gg. So ranking models by −2T-2T ranks them by expected divergence. Under the conditions of asymptotic normality of the MLE, and if gg is a member of the model, E[l(θ^)]−T→k\mathrm E[l(\hat\theta)] - T \to k. Then AIC\mathrm{AIC} estimates −2T-2T with a bias that tends to 0. The next fact sketches why.
  2. Sketch of the bias kk. Let θ0\theta_0 minimize the divergence from f(⋅;θ)f(\cdot; \theta) to gg, let JJ be minus the expected Hessian of log⁡f\log f for one observation at θ0\theta_0, and let KK be the variance of the score of one observation at θ0\theta_0. Expand l(θ0)l(\theta_0) around θ^\hat\theta, where the score is 0, and Ey∗log⁡f(y∗;θ^)\mathrm E_{y^*}\log f(y^*; \hat\theta) around θ0\theta_0, where its gradient is 0. Each expansion loses n2(θ^−θ0)⊤J(θ^−θ0)+op(1)\frac{n}{2}(\hat\theta - \theta_0)^\top J(\hat\theta - \theta_0) + o_p(1). So l(θ^)−Ey∗log⁡f(y∗;θ^)l(\hat\theta) - \mathrm E_{y^*}\log f(y^*; \hat\theta) equals n(θ^−θ0)⊤J(θ^−θ0)n(\hat\theta - \theta_0)^\top J(\hat\theta - \theta_0) plus a term with mean 0 plus op(1)o_p(1). Since n(θ^−θ0)\sqrt n(\hat\theta - \theta_0) tends to N(0,J−1KJ−1)N(0, J^{-1}KJ^{-1}), the mean of the quadratic form tends to tr⁡(KJ−1)\operatorname{tr}(KJ^{-1}), if the expectations converge (uniform integrability is needed for that step). When gg is in the model, K=JK = J and the trace is kk. Otherwise the penalty 2tr⁡(K^J^−1)2\operatorname{tr}(\hat K\hat J^{-1}) gives Takeuchi's criterion TIC. Claeskens and Hjort (2008, Chapter 2) give the full conditions.
  3. Exact small-sample correction. In normal linear regression where the candidate model contains the true mean, AICc is an exactly unbiased estimate of −2T-2T (Hurvich and Tsai 1989; cited here, not proved). AICc and AIC differ by O(k2/n)O(k^2/n), so they agree for large nn, and AICc is the safer choice when n/kn/k is small.
  4. AIC overfits with a fixed probability. For nested models that differ by qq parameters, AIC prefers the larger model exactly when the likelihood ratio statistic 2(l1−l0)2(l_1 - l_0) exceeds 2q2q. If the smaller model is true, Wilks' theorem gives, as n→∞n \to \infty, P(larger chosen)→P(χq2>2q)P(\text{larger chosen}) \to P(\chi^2_q > 2q): 0.157, 0.135, 0.112, 0.075 and 0.029 for q=1,2,3,5,10q = 1, 2, 3, 5, 10. This does not tend to 0 as nn grows, so AIC is not consistent for the true model. In regression, adding one column lowers AIC when nlog⁡(RSS0/RSS1)>2n\log(\mathrm{RSS}_0/\mathrm{RSS}_1) > 2, which is about ∣t∣>2=1.414|t| > \sqrt 2 = 1.414 for the t statistic of the new coefficient.
  5. AIC is efficient for prediction. If the true regression function is not in any candidate model (for example, it has infinitely many nonzero terms), Shibata (1981) showed that the model chosen by AIC has a prediction error that, as n→∞n \to \infty, is as small as that of the best candidate. This is cited, not proved here. Yang (2005) showed that no criterion can be both consistent, as BIC is, and minimax-rate optimal for prediction, as AIC is.
  6. AIC and cross-validation. Stone (1977) showed that AIC and leave-one-out cross-validation of the log-likelihood choose the same model to first order as n→∞n \to \infty. AIC needs one fit per model; cross-validation needs nn, but does not need the model to contain gg.
  7. Only differences matter. A constant added to every ll, such as the term −n2log⁡2π-\frac{n}{2}\log 2\pi, does not change the choice, so programs that drop constants report different AIC values for the same models. Values from different programs must not be mixed.

Examples and non-examples

Polynomial degree. Take x=1,2,…,10x = 1, 2, \dots, 10 and y=(3,4,6,5,7,6,6,5,3,2)y = (3, 4, 6, 5, 7, 6, 6, 5, 3, 2), and fit polynomials of degree 0 to 4 by least squares with normal errors. Then kk is the degree plus 2:

degree RSS kk −2l-2l AIC AICc Δ\Delta AIC weight
0 24.100 2 37.175 41.175 42.889 18.58 0.000
1 23.006 3 36.710 42.710 46.710 20.11 0.000
2 2.521 4 14.600 22.600 30.600 0 0.646
3 2.504 5 14.534 24.534 39.534 1.93 0.246
4 2.415 6 14.170 26.170 54.170 3.57 0.108

The RSS values are 241/10241/10, 3796/1653796/165, 416/165416/165, 5372/21455372/2145 and 1036/4291036/429. RSS falls with each degree, so −2l-2l falls too. AIC is smallest at degree 2: a parabola captures the single peak of the data, and the higher degrees lower RSS too little to pay for their extra parameters. AIC gives degree 3 a weight of 0.246, so the data do not rule it out. AICc, with n=10n = 10, punishes degrees 3 and 4 much harder.

Many candidate columns. Take 10 orthogonal candidate columns that are all noise, and a large nn. The model with the smallest AIC keeps exactly the columns with ∣t∣>1.414|t| > 1.414 (approximately), and each one passes with probability near 0.157. So the search keeps at least one noise column with probability about 1−0.84310=0.821 - 0.843^{10} = 0.82. Fact 4 is about one comparison; a search over many models overfits more, and the AIC of the chosen model is too optimistic. See stepwise regression and post-selection inference.

Non-example: different responses. A model for yy and a model for log⁡y\log y have likelihoods on different scales, and their AIC values cannot be compared. Adding the Jacobian term −2∑log⁡yi-2\sum\log y_i to the AIC of the model for log⁡y\log y puts both on the scale of yy, and then the comparison is valid.

Non-example: different data. If one model drops the rows with a missing value of x3x_3 and the other keeps them, the two log-likelihoods sum over different rows. Fit all candidates to the same rows.

Non-example: REML likelihoods with different fixed effects. The restricted maximum likelihood criterion of a linear mixed model is the likelihood of contrasts that depend on XX, so two models with different fixed effects have likelihoods of different data. Compare them with ordinary maximum likelihood fits.

  • Bayesian information criterion. The penalty klog⁡nk\log n in place of 2k2k; it targets the true model, not prediction.
  • Deviance. For a fixed family, −2l(θ^)-2l(\hat\theta) is the scaled deviance minus a term that depends only on the data, so AIC differences are deviance differences plus 2Δk2\Delta k.
  • Mallows' CpC_p. For normal regression with σ2\sigma^2 estimated from the largest model, Cp=RSSp/σ^2−n+2pC_p = \mathrm{RSS}_p/\hat\sigma^2 - n + 2p. It equals AIC with known σ2\sigma^2 up to a constant, so the two choose the same model to first order.
  • Widely applicable information criterion. The Bayesian analogue, which replaces l(θ^)l(\hat\theta) and kk by the posterior log predictive density and its variance, and stays valid for singular models.
  • Minimum description length. A coding view of model choice whose two-part code gives a k2log⁡n\frac{k}{2}\log n penalty, like BIC.
  • Overfitting. AIC is one of the standard corrections for it.

References

  1. Hirotugu Akaike, A new look at the statistical model identification, IEEE Transactions on Automatic Control 19(6), 1974, pp. 716 to 723, The whole paper (the criterion -2 log L + 2k as the estimate of the expected log-likelihood of the fitted model, proposed for model order selection)
  2. Hirotugu Akaike, Information theory and an extension of the maximum likelihood principle, Second International Symposium on Information Theory, Akadémiai Kiadó, Budapest, 1973, pp. 267 to 281; reprinted in S. Kotz and N. L. Johnson (eds.), Breakthroughs in Statistics, Volume I, Springer, 1992, pp. 610 to 624, The whole paper (the derivation of the bias k of the maximized log-likelihood from the expected Kullback-Leibler discrepancy)
  3. Clifford M. Hurvich and Chih-Ling Tsai, Regression and time series model selection in small samples, Biometrika 76(2), 1989, pp. 297 to 307, The whole paper (the corrected criterion AICc and its exact unbiasedness in normal linear regression)
  4. Ritei Shibata, An optimal selection of regression variables, Biometrika 68(1), 1981, pp. 45 to 54, The whole paper (asymptotic efficiency of AIC-type selection when the true regression has infinitely many terms)
  5. Yuhong Yang, Can the strengths of AIC and BIC be shared? A conflict between model identification and regression estimation, Biometrika 92(4), 2005, pp. 937 to 950, The whole paper (no selection rule is both consistent and minimax-rate optimal for estimating the regression function)
  6. M. Stone, An asymptotic equivalence of choice of model by cross-validation and Akaike's criterion, Journal of the Royal Statistical Society, Series B 39(1), 1977, pp. 44 to 47, The whole paper (leave-one-out cross-validation of the log-likelihood and AIC agree to first order)
  7. Gerda Claeskens and Nils Lid Hjort, Model Selection and Model Averaging, Cambridge University Press, 2008, Chapter 2 (the derivation of AIC, the Takeuchi criterion for misspecified models and AICc) and Chapter 4 (comparison of AIC and BIC, consistency and efficiency)
  8. Kenneth P. Burnham and David R. Anderson, Model Selection and Multimodel Inference: A Practical Information-Theoretic Approach, second edition, Springer, 2002, Chapter 2 (AIC, AICc and Akaike weights)

Where this leads

About this page

The build computes these levels from the evidence in the repository. Each row says what the next level needs. Read what the levels mean.

LadderLevelWhat the next level needs
Human proofH0 no proof
  • add a proof in proofs/ (06.5)
LeanL0 no Lean part
  • name a Lean module in the lean field (07)
VisualV0 none
  • add viz/scene.ts or a figure (10)
WritingW4 complete
  • a review of the text: no review record reviews/9RNYDH/text.yaml