AIC & BIC Calculator

Compare model fit with information criteria.

Calculate AIC/BIC from log-likelihood, number of parameters, and sample size

Usually negative; from model output

Include intercept and variance parameters

Enter model information to calculate AIC/BIC

Use AIC and BIC when comparing statistical models to find the best balance between fit and complexity. Both penalize models for having more parameters, but BIC penalizes more heavily, favoring simpler models.

What Are AIC and BIC?

Akaike Information Criterion (AIC)

AIC=2kβˆ’2ln⁑(L)AIC = 2k - 2\ln(L)

Where:

  • k = number of parameters
  • L = maximum likelihood

Lower AIC = better model.

Bayesian Information Criterion (BIC)

BIC=kln⁑(n)βˆ’2ln⁑(L)BIC = k\ln(n) - 2\ln(L)

Where:

  • k = number of parameters
  • n = sample size
  • L = maximum likelihood

Lower BIC = better model.

Why Penalize Complexity?

Without penalties, adding more parameters always improves fit. But:

  • Overly complex models overfit
  • Extra parameters may capture noise
  • Simple models generalize better

AIC and BIC balance fit (likelihood) against complexity (parameters).

AIC vs. BIC

CriterionPenaltyFavorsSample Size Effect
AIC2kMore complexFixed penalty
BICk ln(n)SimplerIncreases with n

When BIC penalty > AIC penalty:

  • n > eΒ² β‰ˆ 7.4 (almost always)
  • Difference grows with sample size

Example Comparison

Three regression models on n = 100:

Modelk-2ln(L)AICBIC
Model 13250256263.8
Model 25240250263.0
Model 38235251271.8

AIC selects: Model 2 (AIC = 250) BIC selects: Model 2 (BIC = 263.0)

Both agree here, but with larger k, BIC would penalize more.

Interpreting Differences

For AIC

Ξ”AICEvidence against higher AIC model
0-2Minimal
2-4Some
4-7Considerable
>10Strong

For BIC

Similar interpretation, though BIC differences are often larger due to heavier penalty.

Model Selection Rules

Using AIC:

  1. Calculate AIC for all candidate models
  2. Select model with lowest AIC
  3. Report AIC for top candidates
  4. Consider models within Ξ”AIC < 2 as competitive

Using BIC:

  1. Calculate BIC for all candidate models
  2. Select model with lowest BIC
  3. BIC tends to prefer simpler models

Akaike Weights

Convert AIC to model probabilities:

wi=exp⁑(βˆ’Ξ”AICi/2)βˆ‘jexp⁑(βˆ’Ξ”AICj/2)w_i = \frac{\exp(-\Delta AIC_i / 2)}{\sum_j \exp(-\Delta AIC_j / 2)}

Where Ξ”AIC_i = AIC_i - AIC_min.

Interpretation: w_i is the probability that model i is the best model given the data and candidate set.

Corrected AIC (AICc)

For small samples, use the corrected version:

AICc=AIC+2k(k+1)nβˆ’kβˆ’1AIC_c = AIC + \frac{2k(k+1)}{n-k-1}

Use AICc when: n/k < 40

AICc reduces to AIC as n β†’ ∞.

When to Use Which

SituationRecommended
Prediction focusAIC
Finding "true" modelBIC
Small sampleAICc
Many candidate modelsAIC (less harsh)
Want simpler modelBIC

Philosophical difference:

  • AIC: Best model for prediction (may not be "true")
  • BIC: Consistent estimator of "true" model order

Calculating from Software Output

From Residual Sum of Squares (Regression)

AIC=nln⁑(RSS/n)+2kAIC = n\ln(RSS/n) + 2k BIC=nln⁑(RSS/n)+kln⁑(n)BIC = n\ln(RSS/n) + k\ln(n)

From R-squared

AIC=nln⁑(1βˆ’R2)+2k+CAIC = n\ln(1-R^2) + 2k + C

Where C is a constant (doesn't matter for comparison).

Nested vs. Non-Nested Models

Nested models: One is a special case of another.

  • Can also use likelihood ratio test
  • AIC/BIC work fine

Non-nested models: Different structural forms.

  • Can't use likelihood ratio test
  • AIC/BIC are ideal for this

Applications

Regression

Selecting which predictors to include:

  • Compare models with different variables
  • Balance fit against number of predictors

Time Series

Choosing ARIMA order:

  • Compare (p,d,q) combinations
  • Select based on AIC or BIC

Mixed Models

Comparing random effect structures:

  • Different covariance structures
  • Which random effects to include

Machine Learning

Model complexity tuning:

  • Regularization strength
  • Number of components (PCA)

Common Mistakes

Comparing Across Different Data

AIC/BIC only compare models fit to the same data. Different sample sizes or variables invalidate comparison.

Ignoring Model Assumptions

Low AIC doesn't validate assumptions. Check residuals regardless of which model wins.

Over-relying on One Criterion

Consider both AIC and BIC, plus domain knowledge. If they disagree substantially, investigate why.

Using for Hypothesis Testing

AIC/BIC are for model selection, not hypothesis testing. They don't give p-values.

AIC/BIC vs. Cross-Validation

MethodApproachComputational Cost
AIC/BICApproximate prediction errorLow (one fit)
Cross-validationActual prediction errorHigh (many fits)

For large models or complex data, cross-validation may be more reliable but takes longer.

Stepwise Selection Issues

Using AIC/BIC in stepwise procedures:

  • Doesn't explore all possible models
  • Can miss optimal solution
  • Better: All-subsets regression when feasible

Reporting Guidelines

Standard format: "Model 2 had the lowest AIC (AIC = 250) compared to Model 1 (AIC = 256) and Model 3 (AIC = 251). BIC also selected Model 2 (BIC = 263.0). Model 2 included predictors age, treatment, and baseline score."

Include:

  • AIC/BIC for top candidate models
  • Which criterion used and why
  • Final model specification
  • Model diagnostics

Historical Context

Hirotugu Akaike developed AIC in 1973, connecting information theory to statistical model selection. He showed that minimizing AIC approximately minimizes the Kullback-Leibler divergence.

Gideon Schwarz developed BIC in 1978 from a Bayesian perspective. BIC approximates the Bayes factor between models.

Both criteria revolutionized model selection by providing objective, likelihood-based comparison methods.

Related Calculations

Summary

AIC and BIC compare models by balancing fit (likelihood) against complexity (parameters). Lower values indicate better models. AIC uses a fixed penalty (2k); BIC's penalty grows with sample size (k ln n). Use AIC for prediction, BIC when seeking the "true" model. For small samples, use AICc. Compare only models fit to identical data. Report both criteria for major comparisons and consider models within Ξ”AIC < 2 as competitive.