Code for Ghana food price early warning forecasting
# Food Price Early Warning in Ghana
Code for the paper:
**Food Price Early Warning in Ghana: Evidence from Interpretable Forecasting Models**
The repository contains Python code for data cleaning, feature construction,
forecasting, model evaluation, explainability, and spike-warning experiments.
Data files and manuscript files are not included.
## Setup
```bash
python -m venv .venv
. .venv/bin/activate
pip install -e ".[dev,models]"
```
## Data
The scripts use public data sources:
- World Food Programme Ghana food prices
- World Bank Pink Sheet commodity prices
- Ghana Statistical Service exchange rates
- CHIRPS rainfall through ClimateSERV
Raw and processed data are written under `data/`, which is ignored by git.
## Run
```bash
python scripts/01_download_data.py
python scripts/02_clean_wfp_prices.py
python scripts/03_process_predictors.py
python scripts/04_build_features.py
python scripts/05_train_baselines.py
python scripts/06_train_ml_models.py --include-sarima
python scripts/07_explainability.py --shap
python scripts/08_make_tables_figures.py
python scripts/09_train_early_warning.py
```
Revision and robustness scripts:
```bash
python scripts/11_revision_analyses.py
python scripts/12_pooled_benchmark_replication.py
python scripts/13_revision_figures.py
python scripts/14_full_reestimation_for_revision.py
```
## Tests
```bash
python -m pytest -q
python -m ruff check src tests scripts
```