12
Comparing moment solutions with simulations
Closure quality must be assessed against the stochastic model, not inferred from a smooth ODE solution.
Why comparison is necessary
The closed ODE has numerical error, closure error and possibly model mismatch. Tight solver tolerances address only numerical integration. CTMC simulations provide an independent benchmark for the original stochastic model.
Matched comparison design
- Use the same \(N,I_0,\beta,\gamma\).
- Compare at the same times.
- Use enough independent simulations to reduce Monte Carlo error.
- Compare both mean and variance.
- Report absolute or relative discrepancies.
Interactive Python laboratory
Output
Run the code to see the result.
Interpret discrepancies
Small differences can arise from finite Monte Carlo error. Persistent differences larger than that sampling error suggest closure error. Agreement for the mean does not guarantee agreement for variance, tails or extinction probability.
Validation is regime-specific
A closure that performs well for one population size or initial state may fail near extinction, under stronger nonlinearity or for longer times. Validation must cover the biological regimes in which conclusions will be used.
What this lesson adds
You can now design a matched validation experiment, compare closed first and second moments with CTMC sample moments and interpret disagreement as a combination of Monte Carlo and closure error.