Statistical Models Explorer

Interactive simulator for regression and time series models applied to epidemic count data — Poisson GLM, Negative Binomial GLM, Log-linear, ARIMA, and GAM. Adjust parameters and generate synthetic epidemic curves to see how each model behaves, its assumptions, and when to use it.

Example scenarios
Parameters
Simulate
Number of observations
For reproducible noise
Periods used for fitting; remainder = forecast hold-out
Count data & distributional assumptions Epidemic case counts are non-negative integers — ordinary linear regression is inappropriate. The choice of error distribution matters: Poisson assumes variance = mean (equidispersion); Negative Binomial allows variance > mean (overdispersion, common in real outbreaks due to clustering and superspreading); Log-linear OLS treats log-transformed counts as approximately normal (quick but ignores count structure).
When to use each model Poisson GLM: early growth phase, counts not overdispersed, baseline for comparison. Negative Binomial GLM: overdispersed counts (variance/mean > 1), superspreading, most real outbreaks. Log-linear OLS: quick exploration, log-linear growth assumption, not for small counts near zero. ARIMA: stationary or differenced series, captures serial autocorrelation, agnostic to mechanism. GAM: non-parametric smooth trend, captures non-linear epidemic shapes without assuming a growth model.
Statistical models describe the data without assuming a transmission mechanism. They excel at short-horizon forecasting when the trend is stable, but they extrapolate the current pattern and cannot capture turning points they haven't seen. Combine with phenomenological or compartmental models for mechanistic insight. For real research — fitting, uncertainty quantification, and parametric bootstrap CIs — use standard implementations available in all major statistical computing environments (R, Python, Julia, SAS, Stata).
Confidence intervals — what this simulator shows The shaded CI band uses Wald approximations: Poisson ± 1.96·√μ; NegBin ± 1.96·√(μ + μ²/θ); Log-linear ± exp(fitted ± 1.96·σ). These are approximate, symmetric, and assume large samples. For real data analysis, use likelihood-based profile CIs or parametric bootstrap — both available in standard software. Coverage (the fraction of true values falling inside stated CIs) is the key calibration diagnostic; a well-calibrated 95% CI should contain ~95% of true observations over repeated samples.
Forecast performance metrics MAE (Mean Absolute Error): average absolute deviation — robust, same units as data. RMSE (Root Mean Squared Error): penalizes large errors more than MAE — sensitive to outliers. MAPE (Mean Absolute Percentage Error): scale-free, useful for comparing across outbreaks; undefined when true values are zero. AIC / BIC: information criteria for model comparison on the same data. Lower = better fit penalized for complexity. BIC penalizes extra parameters more strongly. Use these to choose between Poisson and NegBin on the same dataset. Coverage: fraction of true values inside the prediction interval — the key calibration metric. Target = stated level (e.g. 95%).