Level 0: Foundation
★☆☆☆☆ Introductory⏱ 5 minGeneral audience. No mathematics required.The wiggly line that fits too well
Draw a curve through 10 noisy measurements. A straight line misses some points. A crazy wiggly curve can pass through every point exactly, but it’ll predict the next measurement terribly. A good model is as simple as possible but no simpler.
Model comparison methods score models by how well they fit and how much they had to stretch to do it. A flexible model that could have fitted almost anything gets less credit when it fits your data.
Is the motor’s friction linear or does it need a Stribeck term? Is sensor noise Gaussian or heavy-tailed? How many layers or components does a model need? Choosing complexity well prevents both underfitting and overfitting.
- 1. A more complex model always…
- 2. Model comparison rewards…
- 3. A curve through every noisy point usually…
Level 1: Beginner
★★☆☆☆ Basic⏱ 20 minSecondary-school mathematics: arithmetic and elementary algebra.Information criteria
With maximized log-likelihood , parameters and data points:
- AIC estimates the out-of-sample predictive log-score (Akaike, 1974). It aims at good prediction.
- BIC approximates evidence (Schwarz, 1978). It’s consistent for the true model if that model is among the candidates.
Lower is better. ΔAIC or ΔBIC of 2 is weak evidence, 6 is strong, and 10 is very strong. Akaike weights express relative support.
Bayes factors
Unlike a p-value, a Bayes factor can favour the null. For 52 heads in 100 tosses, “fair coin” vs “unknown bias (uniform prior)” gives : positive evidence that the coin is fair.
- 1. BIC's penalty per parameter is…
- 2. BF₁₀ = 3 with prior odds 1 gives P(M₁ | data) =
- 3. Can a Bayes factor provide evidence for the null?
Level 2: Intermediate
★★★☆☆ Intermediate⏱ 45 minUndergraduate students and practising engineers.The marginal likelihood and Occam’s razor
It’s the average fit over the prior, not the best fit. A flexible model spreads its prior probability over many possible datasets, so it assigns each one less: the Occam factor. With a Laplace approximation, . With , this gives , which is BIC.
For Bayesian linear regression it’s exact: . In Exercise 1, the evidence picks the true polynomial degree about 84% of the time, BIC 80%, and AIC 60%. AIC errs toward complexity by design.
WAIC and cross-validation
When predictive accuracy is the goal, estimate the expected log predictive density on new data:
- LOO-CV: .
- WAIC (Watanabe, 2010): , where and . It’s computed from posterior draws, valid for singular models (mixtures, neural networks), and asymptotically equal to LOO. PSIS-LOO is the robust practical version (Vehtari, Gelman and Gabry, 2017).
Sensitivity to priors
Bayes factors depend strongly on the priors of the parameters being compared: a vaguer prior means a lower evidence. Predictive criteria (WAIC, LOO) are much less sensitive. Use Bayes factors when the priors are meaningful, and predictive criteria otherwise.
- 1. The marginal likelihood is the likelihood…
- 2. BIC approximates…
- 3. WAIC is computed from…
Level 3: Advanced
★★★★☆ Advanced⏱ 45 minGraduate level, with full derivations and proofs.Deriving BIC
Laplace’s method gives . Taking logs, . The bracket is as . So . ∎
Why AIC targets prediction
The expected out-of-sample log-likelihood of the MLE is . The in-sample is optimistic by about , the trace of for a correct model. Correcting gives AIC/(−2). Under misspecification the correction is (Takeuchi’s TIC). WAIC’s estimates it automatically, which is why moves away from for a misspecified model (Exercise 2).
Lindley’s paradox
Test against with . For a fixed ,
A “significant” (p = 0.046) becomes strong evidence for the null at large n, because the effect size it implies is tiny compared with what predicted (Lindley, 1957). p-values and Bayes factors answer different questions.
Exercise 3.1: Derive the fair-coin Bayes factor
and . The ratio is .
- 1. In-sample log-likelihood overestimates out-of-sample performance by about…
- 2. Lindley's paradox: fixed z, growing n makes BF₀₁…
- 3. Under misspecification the correct penalty is…
Level 4: Expert
★★★★★ Expert⏱ 40 minResearchers: original papers and open problems.Which noise model for encoder residuals?
Joint-encoder residuals combine quantization and jitter. Are they Gaussian or Laplace? Each model has one scale parameter with a conjugate posterior. Drawing from both posteriors and computing WAIC picks the Laplace model on Laplace data and the Gaussian on Gaussian data. For the correct model, , while the misspecified Gaussian fit to heavy-tailed data shows , a symptom of misfit. The same workflow compares dynamics models, kernel choices and network architectures, provided posterior (or ensemble) draws are available.
Model comparison in AI, robotics and aerospace
- Hyperparameter learning. Maximizing the marginal likelihood (type-II ML) fits GP kernels and Bayesian regression priors (A4.4-6; MacKay, 1992).
- Structure selection in system identification. Model order of ARX/state-space models by AIC/BIC (Ljung, 1999). Number of mixture components by BIC (A4.2-6).
- Multiple-model estimation. IMM filters compute running model likelihoods, effectively Bayes factors between motion modes (Blom and Bar-Shalom, 1988).
- Bayesian deep learning. Model selection by approximate evidence, for example Laplace approximations for architectures and priors (Immer et al., 2021). Ensembles are compared by predictive log-likelihood.
- Scientific hypothesis testing with Bayes factors (Kass and Raftery, 1995), for example “is this telemetry trend real?” with priors on plausible drift rates.
References
- H. Akaike (1974). “A new look at the statistical model identification.” IEEE Transactions on Automatic Control, 19(6).
- G. Schwarz (1978). “Estimating the dimension of a model.” Annals of Statistics, 6(2).
- R. Kass, A. Raftery (1995). “Bayes factors.” JASA, 90(430).
- S. Watanabe (2010). “Asymptotic equivalence of Bayes cross validation and widely applicable information criterion in singular learning theory.” JMLR, 11.
- A. Vehtari, A. Gelman, J. Gabry (2017). “Practical Bayesian model evaluation using leave-one-out cross-validation and WAIC.” Statistics and Computing, 27.
- D. Lindley (1957). “A statistical paradox.” Biometrika, 44(1/2).
- D. MacKay (1992). “Bayesian interpolation.” Neural Computation, 4(3).
- K. Burnham, D. Anderson (2002). Model Selection and Multimodel Inference, 2nd ed. Springer.
- L. Ljung (1999). System Identification: Theory for the User, 2nd ed. Prentice Hall.
- A. Immer, M. Bauer, V. Fortuin, G. Rätsch, M. E. Khan (2021). “Scalable marginal likelihood estimation for model selection in deep learning.” ICML.