← Back to Portfolio

Project 1 · Quantitative Finance

Gold Price Forecasting with Geopolitical Risk (1985–2025)

This case study forecasts next-day gold prices using historical gold/silver prices and geopolitical risk indicators, then presents the model outputs through a Streamlit interface.

PythonXGBoostPandasStreamlitTime Series

Business Problem & Objectives

  • Estimate next-day gold price movements with a time-based validation design.
  • Measure whether geopolitical risk variables add predictive value beyond price momentum.
  • Package model outputs for exploration in a recruiter-friendly app workflow.

Dataset & Scope

  • Source file: Gold-Silver-GeopoliticalRisk_HistoricalData.csv from the project data folder.
  • 10,571 daily rows, 15 columns, date span 1985-01-02 to 2025-09-10.
  • Core fields include gold/silver OHLC prices, GPRD indices, and event notes.

Methodology

  • Missing-value handling and chronological feature engineering.
  • Lag features (1,2,5,10,20), rolling windows, and calendar variables.
  • Time split: 2000–2017 train, 2018–2020 validation (as documented).
  • Benchmarks: naive and 5-day moving average versus XGBoost regression.

Key Findings (Documented)

  • Validation metrics in project docs: R² 0.9068, RMSE 72.48, MAE 42.02, MAPE 2.43%.
  • GOLD_LAG_1 is the dominant feature; rolling features are also high-impact.
  • GPRD variables appear with modest contribution, supporting conditional risk influence.
  • Residual spread increases at higher price levels, indicating heteroscedasticity.

Visualizations & Model Outputs

Gold and silver historical time-series chart
Historical gold and silver price behavior across the full timeline.
Geopolitical risk index time-series chart
Geopolitical risk index trend used as an explanatory signal.
Actual versus predicted gold price plot for the validation period
Actual vs predicted validation curve for the XGBoost model.
Feature importance bar chart for the XGBoost model
Top feature-importance ranking from the trained model.