Part 1 (findings 1–5) explains the submitted model's weak spots in the backtest. Part 2 explains the model comparison and the variable tests. All numbers are 4 weeks ahead unless stated.
How to reproduce. Run python research/analysis/step3_checks.py. It writes the tables in research/analysis/out/ and the charts in research/analysis/figures/. Its full printout is research/analysis/out/step3_console.txt.
Inputs.
site/public/web/data/<panel>_history.json.site/public/web/data/<panel>_backtest.json, which holds horizons 4 and 8. Both files are built from data/processed/ by scripts/build_web.py.reports/backtest_region_qc.csv exactly (out/f1_region_qc_h4_by_year.csv). For example, 2023 gives EpiLag 57.96, persistence 55.57 and coverage 0.923.research/results/extracts/ (calibration.csv, rain_by_year.csv), exported from data/processed/ by research/models/export_extracts.py.data/processed/, which is not on this machine. The one rerun this analysis needed is research/models/margin_check.py.Verdicts.
Result. EpiLag's error was 57.96 against 55.57 for persistence, and the range held 92.3% of weeks against an 80% target (reports/backtest_region_qc.csv, test_year 2023, horizon 4).
Hypothesis. In a flat year, "same as this week" is hard to beat.
Check. For each year, the shape of the 17 regions' weekly curves (out/f1_region_year_shape.csv):
| Year | Median peak ÷ mean | Median spread of 4-week change in log cases |
|---|---|---|
| 2016 | 2.26 | 0.45 |
| 2017 | 2.49 | 0.51 |
| 2018 | 2.26 | 0.41 |
| 2019 | 3.00 | 0.57 |
| 2022 | 2.44 | 0.53 |
| 2023 | 1.94 | 0.40 |
| 2024 | 2.68 | 0.48 |
| 2025 | 2.14 | 0.48 |
Verdict: supported. 2023 has the lowest peak-to-mean ratio and the lowest 4-week volatility of all 8 years. Over 4 weeks the case level barely moved, which is exactly when "same as this week" is a strong forecast. The 2.4-case gap (4%) is small next to persistence's 55.6.
Chart: figures/f1_regions_weekly_total.png.
Hypothesis. The calibration year, 2022, was unusual, so it produced the largest widening.
Check 1: the raw range was not the problem. Before calibration, LightGBM's range held 67.9% of weeks in 2023 (research/results/model_comparison.csv, region_qc, 2023, h=4, lightgbm, coverage_raw). That is close to 2024 (69.4%) and 2025 (64.4%). After calibration, 2023 jumped to 92.3%, while 2024 landed at 79.8% and 2025 at 78.0%.
research/results/extracts/calibration.csv; out/f1_calibration_margins.csv):| Test year (calibration year) | 2 weeks | 4 weeks | 6 weeks | 8 weeks |
|---|---|---|---|---|
| 2019 (2018) | 0.120 | 0.176 | 0.243 | 0.275 |
| 2023 (2022) | 0.119 | 0.227 | 0.346 | 0.476 |
| 2024 (2023) | 0.058 | 0.094 | 0.143 | 0.176 |
| 2025 (2024) | 0.040 | 0.097 | 0.142 | 0.184 |
From 4 weeks ahead, 2023's margin is the largest of the four regional test years, and at 8 weeks it is 2.6–2.7 times 2024's and 2025's.
Check 2: the range width. The median log width of the 10–90% range was 1.07 in 2023, against 0.79 in 2024 and 0.82 in 2025 (out/f1_region_qc_h4_by_year.csv).
Check 3: missing features from the 2020–21 gap: ruled out by a rerun.
y_lastyear) is missing for 17 of 18 areas, and the first weeks lack the 4- and 12-week averages.y_lastyear taken from 3 years earlier) and with y_lastyear dropped (research/models/margin_check.py, research/results/margin_check.csv). The 2023 margin at 4 weeks stayed at 0.216 (filled) and 0.228 (dropped), against 0.227 live, and the 2023 range still held 91.5–92.4%.margin_averages_present in research/results/margin_check_calibration_year.csv).Check 4: was 2022 unusual?
out/f1_region_year_shape.csv).research/results/extracts/rain_by_year.csv, panel region_qc, year 2022).Check 5: how the calibration model forecast its year (research/results/margin_check_calibration_year.csv). The margin comes from a copy of the model fit without the last training year, scored on that year:
| Calibration year (test year) | Median log error, 4 / 8 weeks | Weeks above the 90% forecast, 4 weeks | Weeks below the 10% forecast, 4 weeks | Margin, 4 weeks |
|---|---|---|---|---|
| 2018 (2019) | −0.16 / −0.27 | 36% | 8% | 0.176 |
| 2022 (2023) | −0.20 / −0.41 | 38% | 9% | 0.227 |
| 2023 (2024) | −0.07 / −0.11 | 20% | 12% | 0.094 |
| 2024 (2025) | −0.07 / −0.07 | 22% | 8% | 0.097 |
conformal_margin in src/backtest.py adds one margin to both ends of the range (it takes the larger of the two misses per week). So a calibration model that ran low also widened the bottom of the 2023 range, where nothing had been missed.Verdict: supported that calibration on 2022 caused the over-wide range: the raw range was normal, the 2022 margin was the largest of 2023–2025 (0.227 against 0.094–0.097; 2019's was 0.176), and calibration overshot.
Supporting detail. The no-weather model shows the same over-coverage in 2023 (0.935, reports/backtest_region_qc_noweather.csv). So the cause isn't the weather features.
Result. Error 85.5 for seasonal naive against 9.7 for EpiLag (reports/backtest_province.csv, 2020, h=4: mae_seasonal_naive and mae_epilag).
Hypothesis. It copied the 2019 national epidemic into a year of COVID lockdowns and lower reporting.
Check 1: national totals (out/f2_province_national_totals.csv):
| Year | Reported cases, 86 provinces |
|---|---|
| 2016 | 209,544 |
| 2017 | 154,155 |
| 2018 | 250,783 |
| 2019 | 441,902 |
| 2020 | 91,041 |
Check 2: when did 2020 fall? Weekly 2020 totals divided by the 2016–2018 average for the same week (out/f2_2020_weekly_ratio.csv):
Verdict: supported.
figures/f2_province_2019_vs_2020.png).references.md.research/results/shap_groups.csv), which fell with the reports.Caveat for the write-up. Provinces' 89% skill against seasonal naive in 2020 (README) mostly reflects how badly that baseline fails in a break year. It shouldn't be presented as typical skill.
Hypothesis. At short range, recent cases already carry the weather signal. Weather acts through the mosquito life cycle over several weeks.
Check. Error change from adding weather to the live model, as the median over test years (out/f3_weather_by_horizon.csv, from reports/backtest_<panel>.csv against _noweather.csv; negative means weather helped). Alongside it, weather's SHAP share (rain + heat + humidity, research/results/shap_groups.csv, feature_set = current):
| Weeks ahead | Regions + QC: error change | Regions + QC: weather SHAP share | Provinces: error change | Provinces: weather SHAP share |
|---|---|---|---|---|
| 2 | +0.5% | 11% | +0.6% | 9% |
| 4 | 0.0% | 18% | +1.3% | 13% |
| 6 | −2.2% | 22% | −0.4% | 16% |
| 8 | −4.9% | 24% | +0.7% | 18% |
The Regions + QC SHAP shares are from the corrected run of 16 Nov (research/results/METHODS.md).
The add-one-group test on the research table, Regions + QC (research/results/feature_groups.csv, mode = add, median over years) points the same way:
Verdict: supported for Regions + QC, not supported for provinces.
research/results/README.md): weather is one ERA5 point per province, and the test years are 2019's record epidemic and 2020's break.Chart: figures/f3_weather_gain_by_horizon.png.
Result. In 2024 the error was 101.2 with weather against 111.3 without (reports/backtest_region_qc.csv against _noweather.csv).
Effect of weather by year (% change in error, out/f3_f4_weather_gain.csv):
| Year | 2 weeks | 4 weeks | 6 weeks | 8 weeks |
|---|---|---|---|---|
| 2019 | +1.7 | 0.0 | −1.7 | −3.8 |
| 2023 | −0.7 | +1.5 | +8.2 | +12.2 |
| 2024 | −1.2 | −9.1 | −11.3 | −9.4 |
| 2025 | +3.5 | +0.1 | −2.6 | −5.9 |
Hypothesis. Weather adds most when a year departs from its usual season.
Check 1: rain anomaly. Each year's rain against the same area's other years, as the median over Regions + QC areas (research/results/extracts/rain_by_year.csv; out/f4_rain_anomaly_vs_weather_gain.csv):
| Year | Wet-season rain (Jun–Nov) vs other years | Whole-year rain vs other years | Weather effect at 4 / 8 weeks |
|---|---|---|---|
| 2019 | −20.8% (dry) | −24.1% | 0.0% / −3.8% |
| 2023 | −8.0% | +1.1% | +1.5% / +12.2% |
| 2024 | +9.0% | +1.8% | −9.1% / −9.4% |
| 2025 | +32.5% (very wet) | +26.0% | +0.1% / −5.9% |
Check 2: case-curve shape. How far each year's case curve departs from its usual seasonal shape. For each area, I correlated the year's weekly log cases with the mean of earlier years by week of year, then took the median across areas (out/f4_season_departure.csv; lower means more unusual):
| Year | Median correlation with the usual season |
|---|---|
| 2019 | 0.80 |
| 2023 | 0.76 |
| 2024 | 0.86 (most typical) |
| 2025 | 0.41 (most unusual) |
Verdict: not supported. By both measures, the year where weather helped most is one of the least unusual:
What may explain it instead (hypotheses).
out/f1_region_year_shape.csv) but on schedule. Weather plausibly helped size a normal-timed season.Hypothesis. Each new year differs from the training years, so the raw model is overconfident.
Check 1: coverage before and after calibration, all 24 checks per model (research/results/model_comparison.csv; out/f5_coverage_raw_vs_calibrated.csv):
| Model | Before: min–max (median) | After: min–max (median) |
|---|---|---|
| LightGBM | 46–73% (64%) | 70–96% (79%) |
| Negative binomial | 59–89% (76%) | 67–92% (79%) |
| Random forest | 67–87% (81%) | 67–93% (80%) |
| SARIMAX | 58–89% (75%) | 69–96% (78%) |
Check 2: does raw coverage fall in years that differ more? Regions + QC, LightGBM, 4 weeks ahead. The year shift is the median level shift from earlier years, from finding 1:
| Test year | Year shift | Raw coverage |
|---|---|---|
| 2019 | 0.82 | 47.6% |
| 2024 | 0.66 | 69.4% |
| 2023 | 0.35 | 67.9% |
| 2025 | 0.30 | 64.4% |
The year with by far the largest shift, 2019's record epidemic, has by far the lowest raw coverage. The other three are close together.
Verdict: partly supported.
Chart: figures/f5_coverage_before_after.png.
| Finding | Verdict | Main source |
|---|---|---|
| 1a. 2023 was flat | Supported | out/f1_region_year_shape.csv |
| 1b. Too-wide range came from calibrating on 2022 | Supported (margin 0.227 against 0.094–0.097 for 2024–25). Cause: the calibration model forecast 2022 too low, and the one symmetric margin widened both ends. The 2020–21 gap is ruled out; why it ran low is untested | extracts/calibration.csv, results/margin_check*.csv, src/backtest.py |
| 2. Seasonal naive copied the 2019 epidemic into 2020 | Supported. The drop starts in late March 2020 | out/f2_* |
| 3. Weather matters more at longer leads | Supported for Regions + QC, not for provinces | out/f3_weather_by_horizon.csv, shap_groups.csv, feature_groups.csv |
| 4. Weather helps most in unusual years | Not supported: on rain and on case shape, weather helped most in the most ordinary year (2024) | out/f4_rain_anomaly_vs_weather_gain.csv, out/f4_season_departure.csv |
| 5. Raw ranges too narrow because years differ | Partly supported: also a LightGBM-specific narrowness | model_comparison.csv, extracts/calibration.csv |
Answered by a rerun: the 2023 calibration without y_lastyear (finding 1b, Check 3). Still untested: why the 2018 and 2022 calibration models ran low.
Sources.
research/results/model_comparison.csv: error by model, test year and lead time, plus coverage and alerts.research/results/feature_groups.csv: the add and drop tests.research/results/proposed_features.csv, rain_lags.csv, rain_lag_shap.csv and candidates.csv.research/results/README.md, "Final variables"."Relative error" means a model's error divided by LightGBM's on the same rows, so below 1 means it beat LightGBM.
Wins. Across 24 checks (6 panel-years × 4 lead times), the lowest error went to LightGBM 12 times, negative binomial 7, SARIMAX 5, and random forest 0.
Where it won.
Why.
Where it lost.
Why.
out/f1_region_year_shape.csv). So at short range, LightGBM's median was capped below the actual rise.Results.
Why.
y_lastyear) carried part of 2019's epidemic into 2020, the same trap as finding 2. This can be checked from the fitted coefficient.Results.
Why. A hypothesis, consistent with the finding that SARIMAX's median is not biased low overall:
out/f1_region_year_shape.csv).Results.
Why.
blend_all4)An equal average of the four methods' calibrated forecasts, scored like any model (model_comparison.csv; research/results/README.md).
Results.
Why it wins on error. The methods fail in different years: negative binomial in 2024, LightGBM in 2019 and 2023, SARIMAX at short leads. Averaging cancels part of each one's misses.
Why it loses on Outbreak warning. A hypothesis: averaging pulls the median toward the methods whose medians stay low in an outbreak. SARIMAX is one of the four, and it catches only 17% on that rule (see above). This is untested.
Caveat. Blending was chosen after seeing the test years, so the gain is optimistic.
Columns.
research/lit/feature_evidence.csv.change_pct from feature_groups.csv.
| Group | Expectation | Regions + QC result | Provinces result | Verdict |
|---|---|---|---|---|
| cases | strong, positive | drop: +73% (16/16 helped; range +25% to +259%) | drop: +113% (8/8; +21% to +303%) | agrees |
| season | strong | drop: +0.3% (9/16) | drop: +3.3% (7/8) | agrees for provinces; weak for regions |
| rain | strong, lag 4–12 weeks | add: −1.6% (12/16); drop: 0.0% (8/16) | add: +0.7% (2/8); drop: −0.2% (2/8) | agrees for regions; disagrees for provinces |
| humidity | strong, lag 4–8 weeks | add: −3.5% (15/16); drop: 0.0% (8/16) | add: +0.1% (4/8); drop: 0.0% (4/8) | agrees for regions; disagrees for provinces |
| heat | strong, inverted U | add: −3.9% (14/16); drop: +0.5% (10/16) | add: +0.3% (3/8); drop: −0.2% (3/8) | agrees for regions; disagrees for provinces |
| enso | mixed (multi-year cycles) | add: −1.3% (8/16); drop: +0.1% (8/16) | add: +2.3% (2/8); drop: −1.6% (0/8: hurt every time) | agrees (mixed) |
| topography | mixed (linked to infection, not reported cases) | not tested | add: −1.9% (7/8); drop: −0.2% (3/8) | partly disagrees: helps alone, not in the full set |
| population | weak | add: −4.3% (15/16); drop: +0.9% (13/16) | add: +0.1% (4/8); drop: −0.4% (3/8) | disagrees for regions |
Cases. As expected, recent cases are the backbone; removing them makes the error 21–303% worse. The forecasting studies that use case lags rely on them too [shi2016, colongonzalez2021].
Season. In regions, rain, heat and humidity follow the same yearly cycle, so dropping week of year loses little. In the add test, season sits in the base.
Rain, humidity and heat in regions. Each one alone improves on cases + season, most at 6–8 weeks (finding 3), as their literature lags predict. In the drop test, removing any one costs almost nothing. The three are seasonally correlated, so the others cover for a missing one. This is redundancy, not a lack of effect.
Rain, humidity and heat in provinces: disagrees. Three likely causes, not separable with these data:
The literature's effects are at region or province level over many years [seposo2023: 10 years and 61 provinces; xu2020: 10 years]. EpiLag's provinces have 3 training years before 2019.
ENSO hurt provinces in every check. This agrees with the "mixed" rating and with its mechanism: the ENSO evidence is about 2–5 year cycles [vanpanhuis2015], and the province data span 5 years (2016–2020), about one cycle. The model can use the index as a label for the year, and that fails on a new year (hypothesis 1 in research/results/README.md). For regions it was neutral, helping in 8 of 16 checks.
Topography: a null result in the full model, a small gain alone. sy2026 found elevation linked to infection but not to reported incidence. In a model that already knows each area's recent cases, a fixed per-area value has little to add, and the full-set result fits that.
research/results/README.md), and is a hypothesis.Population helped regions more than expected. With 18 areas, a fixed value per area works as an area label (research/results/METHODS.md), which lets the pooled model learn each region's own level. That is a modelling effect, not evidence that population drives dengue.
feature_evidence.csv, tested in research/models/proposed_features.py)Results (research/results/proposed_features.csv; counts are checks where the group cut the error, medians as given in research/results/README.md):
| Variable | Expectation (evidence) | Regions + QC: added to cases + season / to the research set | Provinces: added to cases + season / to the research set | Verdict |
|---|---|---|---|---|
| Neighbours' cases | positive, lag 1–4 weeks (weak) [buczak2014, vanpanhuis2015] | 11 of 16, −1.8% / 9 of 16, −0.1% | 6 of 8, −1.4% / 8 of 8, −2.8% | agrees, more strongly than the evidence suggested (provinces) |
| Heatwave days | rises up to about 7 days a month, then falls; about 2-month lag (mixed) [ith2025] | 9 of 16, −0.8% / 9 of 16, −0.1% | 3 of 8, +1.2% / 5 of 8, −0.2% | agrees (mixed): no gain beyond heat |
| Rain anomaly (stand-in for drought) | positive in drought (mixed) [ith2025] | 10 of 16, −1.3% / 7 of 16, +0.6% | 1 of 8, +2.2% / 3 of 8, +0.6% | disagrees for provinces |
| Rain 12–23 weeks back | positive, lag 12–20 weeks (mixed) [tuan2024, seposo2023, shi2016] | 6 of 16, +0.9% (rain_lags.csv) |
3 of 8, +0.1% | disagrees: attention without gain |
research/results/README.md).
rain_lag_shap.csv, via research/results/README.md).rain_lags.csv).research/results/README.md) asks whether the literature reports a 3–5 month rain-to-dengue lag.
feature_evidence.csv rows stay candidate, marked untested.Final choice (research/results/README.md, "Final variables"; scores in candidates.csv):
Against the live model, over 24 checks:
Provinces + neighbours' is the only province set better in all 8 checks, and it catches more outbreak starts on both rules (research/results/README.md candidate table: Watch 786 against 779, Outbreak warning 374 against 357). The reasons are above.
Regions + QC + heat and humidity has the strongest literature support of all candidates:
Each helped on its own in 14–15 of 16 checks (feature_groups.csv).
ENSO was left out.
src/ and reports/ still hold the submitted model. The write-up reports the submitted model as the main result, and the final variables as what the research found.