Model Comparison¶
Learning Objectives:
- Use Dynamic Nested Sampling for model evidence
- Calculate Bayes factors for model comparison
- Interpret evidence values
- Compare bicycle dynamics models
Prerequisites: Optimisation Basics, ODE Fitting, Parameter Uncertainty, Bayesian model comparison basics
Runtime: ~20 minutes
Note: This tutorial requires the Dynamic Nested Sampling feature. Coming soon!
Introduction¶
When you have multiple models, which one is best?
Dynamic Nested Sampling calculates the model evidence (marginal likelihood), allowing rigorous Bayesian model comparison via Bayes factors.
$$\text{Bayes Factor} = \frac{p(\text{Data}|\text{Model}_1)}{p(\text{Data}|\text{Model}_2)} = \frac{Z_1}{Z_2}$$
This tutorial will demonstrate model comparison using bicycle dynamics models.
The Problem: Bicycle Model¶
A bicycle traveling at constant velocity $v$ with steer angle $\delta$ follows curved motion determined by wheelbase $L$:
$$\begin{aligned} \frac{dx}{dt} &= v \cos(\theta) \\ \frac{dy}{dt} &= v \sin(\theta) \\ \frac{d\theta}{dt} &= \frac{v}{L} \tan(\delta) \end{aligned}$$
Task: Estimate wheelbase $L$ and compare different model formulations.
Coming Soon¶
This tutorial is under development. Check back soon for:
- Setting up multiple model variants
- Running Dynamic Nested Sampling
- Calculating log evidence for each model
- Interpreting Bayes factors
- Making model selection decisions
Preview: Model Evidence Interpretation¶
| $\log(Z_1 / Z_2)$ | Bayes Factor | Evidence for Model 1 |
|---|---|---|
| < 0 | < 1 | Negative (prefer Model 2) |
| 0-1 | 1-3 | Barely worth mentioning |
| 1-2.5 | 3-12 | Positive |
| 2.5-5 | 12-150 | Strong |
| > 5 | > 150 | Very strong |
References¶
- Skilling, J. (2006). Nested sampling for general Bayesian computation.
- Higson, E. et al. (2019). Dynamic nested sampling.
Next Steps¶
- Predator-Prey Models - Multi-backend comparison
- Choosing a Sampler
- API Reference: Samplers