3 — Methodology

Manuscript · APA section

Manuscript · Section 3 of 7 · Paper landing

3.1 Research design

Longitudinal ecological panel design; unit of analysis is the district-month (77 districts × 108 months, January 2015 – December 2023; N = 7,327 valid observations after dropping initial lag rows) (Bao et al., 2023; Hashizume et al., 2010).

3.2 Study area

The 77 administrative districts of Nepal span three ecological zones: Terai (~17 % land area, > 50 % population), Middle Hills (~68 % land area), and High Mountain (~15 % land area). Precipitation is concentrated in the June–September monsoon (~75–80 % of annual total). Public health system is organized in three tiers (district hospitals, primary health care centers, village-level health posts), all reporting through HMIS. WASH coverage varies from 78 % (Bagmati) to 43 % (Karnali) at the provincial level (Central Bureau of Statistics and UNICEF, 2019).

3.3 Data sources

Four primary institutional and open-access sources documented in detail in §6 Data:

Dataset Variable Resolution Provider Reference
HMIS Monthly outpatient typhoid case counts District-month MoHP / DoHS, Nepal (Ministry of Health and Population, Government of Nepal, 2023)
DRR Portal Flood event counts District-month NDRRMA, Nepal (NPDRR Nepal, 2025)
CHIRPS v2.0 Precipitation 0.05° (~5 km) Climate Hazards Group (Funk et al., 2015)
ERA5-Land 2 m air temperature, relative humidity 0.1° (~9 km) ECMWF · Copernicus (Muñoz-Sabater et al., 2021)

3.4 Data cleaning and integration

  1. Calendar conversion — Bikram Sambat → Gregorian via 12-month mapping table (max alignment error ~15 days).
  2. District-code reconciliation — CBS 3-digit codes used as primary spatial merge key; 12 name-spelling variants resolved against CBS lookup.
  3. Numeric cleaning — Comma-formatted HMIS counts parsed; 847 records corrected. Extreme values audited against district annual reports.
  4. Spatial aggregation — CHIRPS and ERA5-Land grids aggregated to district polygons by area-weighted zonal statistics.
  5. Missing data — 2,463 district-months with missing HMIS data excluded; no outcome imputation. Final analytical sample: N = 7,327.

3.5 Feature engineering

Eleven features were engineered from the raw dataset:

Feature Category Derivation
log_cases Outcome transform log(cases + 1)
cases_lag1 Autoregressive cases value from prior calendar month, same district
precip_lag1 Lagged climate CHIRPS precipitation shifted 1 month
temp_mean_lag1 Lagged climate ERA5-Land temperature shifted 1 month
humidity_lag1 Lagged climate ERA5-Land humidity shifted 1 month
flood_lag1 Lagged climate DRR flood count shifted 1 month
precip_roll3 Cumulative climate Rolling mean over t, t−1, t−2
temp_roll3 Cumulative climate Rolling mean over t, t−1, t−2
monsoon Seasonal indicator 1 if month ∈ {Jun, Jul, Aug, Sep}
month_sin Cyclical encoding sin(2π × month / 12)
month_cos Cyclical encoding cos(2π × month / 12)

All lag and rolling features were computed within each district to prevent cross-district leakage.

3.6 Train-test split

Strictly chronological — the last 12 calendar months (January 2022 – December 2023) are reserved as the held-out test set. Within training, a TimeSeriesSplit (k = 5) is used for XGBoost hyperparameter selection.

3.7 Machine-learning models

3.7.1 Random Forest

scikit-learn 1.3 (Pedregosa et al., 2011); n_estimators=300, max_depth=10, min_samples_leaf=5, seed = 42.

3.7.2 XGBoost

xgboost 1.7 (Chen & Guestrin, 2016); n_estimators=300, learning_rate=0.05, max_depth=4, subsample=0.80, colsample_bytree=0.80, reg_alpha=0.10, reg_lambda=1.00, seed = 42; early stopping on 10 % validation fold.

3.7.3 Multilayer Perceptron

scikit-learn MLPRegressor (Pedregosa et al., 2011); hidden layers (128, 64, 32), ReLU, Adam optimizer @ 1e-3 learning rate, early stopping on 10 % validation fold, seed = 42. Input features standardized using StandardScaler parameters estimated exclusively from the training set.

3.8 Model evaluation metrics

  • RMSE = \(\sqrt{\sum (y_i - \hat{y}_i)^2 / n}\) — cases per district per month.
  • MAE = \(\sum |y_i - \hat{y}_i| / n\) — scale-interpretable.
  • R² = \(1 - SS_{\text{res}} / SS_{\text{tot}}\) — variance explained.
  • MAPE = \(100\% \times \sum |y_i - \hat{y}_i| / y_i / n\) — percentage error.

All metrics computed on back-transformed (exponentiated) case-count predictions for RMSE and MAE; R² computed on log-scale predictions.

3.9 Ethical considerations and limitations

The study used only aggregate, de-identified, district-level surveillance and climate data; no individual patient records were accessed. Five categories of limitation are acknowledged: HMIS under-reporting, diagnostic misclassification, spatial aggregation of climate data, flood-event underregistration, and the ecological fallacy. See §6 Data for full discussion.


← Back: 2 — Literature Review · → Next: 4 — Results

References

Bao, Y., Liu, J., Zhang, M., Zhou, X., & Shi, Y. (2023). Predicting typhoid fever incidence using machine learning models: A study in Jiangsu Province, China. BMC Infectious Diseases, 23(1), Article 525. https://doi.org/10.1186/s12879-023-08411-7
Central Bureau of Statistics and UNICEF. (2019). Nepal multiple indicator cluster survey 2019: Survey findings report. Central Bureau of Statistics; UNICEF.
Chen, T., & Guestrin, C. (2016). XGBoost: A scalable tree boosting system. Proceedings of the 22nd ACM SIGKDD International Conference on Knowledge Discovery and Data Mining, 785–794. https://doi.org/10.1145/2939672.2939785
Funk, C., Peterson, P., Landsfeld, M., Pedreros, D., Verdin, J., Shukla, S., Husak, G., Rowland, J., Harrison, L., Hoell, A., & Michaelsen, J. (2015). The climate hazards infrared precipitation with stations—a new environmental record for monitoring extremes. Scientific Data, 2, 150066. https://doi.org/10.1038/sdata.2015.66
Hashizume, M., Faruque, A. S. G., Wagatsuma, Y., Hayashi, T., & Armstrong, B. (2010). Cholera in Bangladesh: Climatic components of seasonal variation. Epidemiology, 21(5), 706–710. https://doi.org/10.1097/EDE.0b013e3181e5b053
Ministry of Health and Population, Government of Nepal. (2023). Annual report of the department of health services 2022/23. Government of Nepal.
Muñoz-Sabater, J., Dutra, E., Agustí-Panareda, A., Albergel, C., Arduini, G., Balsamo, G., & Thépaut, J.-N. (2021). ERA5-Land: A state-of-the-art global reanalysis dataset for land applications. Earth System Science Data, 13(9), 4349–4383. https://doi.org/10.5194/essd-13-4349-2021
NPDRR Nepal. (2025). Nepal disaster statistics 2012–2024. https://www.drrportal.gov.np/
Pedregosa, F., Varoquaux, G., Gramfort, A., Michel, V., Thirion, B., Grisel, O., Blondel, M., Prettenhofer, P., Weiss, R., Dubourg, V., Vanderplas, J., Passos, A., Cournapeau, D., Brucher, M., Perrot, M., & Duchesnay, E. (2011). Scikit-learn: Machine learning in Python. Journal of Machine Learning Research, 12, 2825–2830.