Predicting Inflation Contagion: A Spatio-Temporal Graph Neural Network Approach to Trade-Linked Economies
Rayyan Asim — Independent Researcher
mrayanasim09@gmail.com · Working Paper / Preprint
This paper investigates whether explicitly modelling dynamic, directed bilateral trade relationships using Spatio-Temporal Graph Neural Networks (ST-GNNs) improves quarterly CPI inflation (YoY) forecasts for 20 European economies. A prospective expanding-window benchmark spanning 2017Q1–2025Q3 evaluates 13 models across 8 graph adjacency specifications and 3 forecast horizons (h = 1, 2, 4 quarters). The benchmark comprises 39,188 model fits and 783,760 forecast rows, evaluated with RMSE, MAE, sMAPE, CRPS, and 80%/95% prediction interval metrics. Statistical significance is assessed using Harvey-Leybourne-Newbold corrected Diebold-Mariano tests with Bartlett HAC variance, moving-block bootstrap confidence intervals (block = 4, draws = 2,000), and Benjamini-Hochberg FDR correction (q = 0.05).
Key finding: No graph model achieves statistically significant superiority over non-graph baselines across all 20 initialization seeds after FDR correction. The temporal_graph model with an identity_no_trade adjacency (effectively ablating cross-country information) ranks first at h = 2 and h = 4, suggesting that temporal dynamics dominate any trade-network signal at the quarterly horizon.
Does explicitly embedding dynamic, directed trade-network structure into a deep learning forecaster improve quarterly CPI inflation predictions for European economies, relative to univariate, multivariate, and non-graph neural network baselines?
repository/
├── .github/workflows/ci.yml # GitHub Actions: contract validation + lint + compile
├── docs/ # Technical documentation (10 guides)
├── experiments/
│ └── results/v2_1/
│ ├── configs/ # Locked benchmark configuration (SHA-256 verified)
│ ├── tuning/ # Validation-only tuning manifest
│ ├── metadata/ # Output hash registry + environment manifest
│ ├── manuscript/ # Tables (TeX + CSV) and figures generated by scripts
│ ├── analysis/ # Aggregated rankings and significance summary CSVs
│ ├── run_manifest.json # Full execution provenance record
│ └── FINAL_EXPERIMENT_REPORT.md
├── paper/ # LaTeX manuscript source
│ ├── main.tex
│ ├── appendix.tex
│ ├── references.bib
│ └── figures/
├── src/
│ ├── acquisition/ # Data download (Eurostat Comext, IMF, World Bank)
│ ├── ingestion/ # Parsing and normalisation
│ ├── transform/ # Feature engineering, graph construction, train/val/test splits
│ └── models/
│ ├── graphs/ # 8 adjacency matrix factory variants
│ ├── tuning/ # Validation-only hyperparameter tuning (isolated)
│ ├── run_benchmark_engine_v2_1.py # Main benchmark orchestrator
│ ├── evaluate_benchmark_engine_v2_1.py # Metrics + DM tests
│ ├── storage_v2_1.py # Schema enforcement + transactional writes
│ ├── validate_v2_1_contract.py # Pre-run protocol gate
│ ├── validate_v2_1_results.py # Post-run completeness + hash gate
│ ├── analyze_v2_1_results.py # Rankings and significance summaries
│ ├── generate_v2_1_manuscript.py # LaTeX tables and figures
│ └── generate_v2_1_report.py # Final experiment report
├── CHANGELOG.md
├── CITATION.cff
├── CODE_OF_CONDUCT.md
├── CONTRIBUTING.md
├── LICENSE
├── ROADMAP.md
├── SECURITY.md
├── environment.yml # Conda environment spec
├── reproduce.sh # End-to-end reproduction script (Unix/macOS)
├── reproduce.ps1 # End-to-end reproduction script (Windows)
└── requirements.txt
git clone https://github.com/mrayanasim09/MarketEquationDiscovery
cd MarketEquationDiscovery
python3 -m venv .venv
source .venv/bin/activate # Windows: .venv\Scripts\activate
pip install -r requirements.txtconda env create -f environment.yml
conda activate inflation-gnnThe benchmark outputs (forecasts.parquet, metrics.parquet, dm_tests.parquet) are stored separately (large files). All 5 SHA-256 hashes are registered in experiments/results/v2_1/metadata/output_hashes.json.
python -m src.models.validate_v2_1_contractpython -m src.models.validate_v2_1_resultspython -m src.models.analyze_v2_1_results
python -m src.models.generate_v2_1_manuscript
python -m src.models.generate_v2_1_report# Unix/macOS
./reproduce.sh
# Windows PowerShell
.\reproduce.ps1Expected wall time: ~12 hours on Apple Silicon M-series; longer on other hardware.
Hardware: CPU execution (no GPU required). 16 GB RAM recommended.
| Property | Value |
|---|---|
| Target variable | Quarterly CPI inflation, YoY (%) |
| Countries | 20 European economies (AUT, BEL, BGR, CYP, CZE, DEU, DNK, EST, FIN, FRA, GRC, HRV, HUN, IRL, ITA, LTU, LUX, LVA, MLT, NLD) |
| Training window | 2011Q2 – 2014Q4 |
| Validation window | 2015Q1 – 2016Q4 |
| Prospective test | 2017Q1 – 2025Q3 (expanding-window, no look-ahead) |
| Forecast horizons | h = 1, 2, 4 quarters ahead |
| Neural seeds | 20 (seeds 42 – 61) |
| Total model fits | 39,188 |
| Total forecast rows | 783,760 |
| Category | Model |
|---|---|
| Naïve / statistical | persistence, ARIMA, VAR, ETS, dynamic_factor |
| Machine learning | ridge, gradient_boosting |
| Deep learning (non-graph) | MLP, LSTM, TCN |
| Graph neural networks | GCN, temporal_graph |
| Variant | Description |
|---|---|
directed_trade |
Raw directed quarterly bilateral trade volumes |
log_trade |
Log-transformed trade volumes |
import_dependence |
Trade normalised by importer's total imports |
top_k_incoming |
Retain only top-k trade partners per country |
reversed |
Transposed network (export → import direction) |
undirected |
Symmetrised trade relationships |
degree_preserving_random |
Null model: random edges preserving degree sequence |
identity_no_trade |
Identity matrix — ablates all cross-country signal |
| Metric | Type |
|---|---|
| RMSE | Point — primary |
| MAE | Point — primary |
| sMAPE | Point — scale-free |
| CRPS | Probabilistic — sharpness + calibration |
| Coverage 80% / 95% | Probabilistic — calibration |
| Width 80% / 95% | Probabilistic — sharpness |
Statistical testing: Harvey-Leybourne-Newbold DM test · Bartlett HAC · Moving-block bootstrap CI (block=4, draws=2000) · Benjamini-Hochberg FDR (q=0.05)
| Source | Data |
|---|---|
| Eurostat Comext | Quarterly bilateral trade flows |
| IMF IFS | CPI, interest rates, exchange rates |
| World Bank | GDP growth, energy prices |
All data are from public sources; no proprietary datasets were used.
@article{asim2026predicting,
title = {Predicting Inflation Contagion: A Spatio-Temporal Graph Neural
Network Approach to Trade-Linked Economies},
author = {Asim, Rayyan},
journal = {Preprint / Working Paper},
year = {2026},
doi = {10.2139/ssrn.7009041},
url = {https://doi.org/10.2139/ssrn.7009041}
}This project is licensed under the MIT License — see LICENSE for details.
Data provided by Eurostat, the International Monetary Fund, and the World Bank. No external funding was received for this research.
