US/Israel-Iran War: Macroeconomic Factors-Impact on Gold and Silver Price
The most immediate impact of the current USA/Israel-Iran war has been the sharp rise in oil and LNG prices as Iran closes the Straits of Hormuz. According to the latest announcements by the US, Israel as well as the Iran governments, the war may likely continue for at least a few weeks or even a few months.
I want to see if I can model the impact of changes in the macroeconomic environment which the war will inevitably cause, on gold and silver prices in 60 days from now. This is a departure from my usual models using just XAUUSD, XAGUSD price data. The macroeconomic variables input variables are:
1. Inflation (FRED Core PCE)
2. The US Dollar (FRED nominal broad dollar Index DTWEXBGS
3. 10 -year Treasury yields
4. Equities (stock market) S&P500
The impact on gold and silver prices will depend not only on the quantum of change in the macroeconomic variables but also on the sequence that the variables play out. At this juncture, the situation is fraught with uncertainty: The USD is up (as measured by DXY) but bond yields are rising. The stock market has not yet been greatly impacted. Global trust and confidence in the USA have been eroded due to the current Administrations aggressive and erratic trade policies and geopolitical strategy. This will have an impact on the USD and on Treasuries as countries trade less with the US and sell off some of their Treasury holdings and/or stop buying more. Will inflation be followed by recession, or will there be a period of stagflation? The only factor that we can be certain of is that the war will accelerate the US national debt level (which now stands at $38.5 trillion) and the FED will have to print more money.
Forecast Methodology — Step by Step
1. Data Ingestion
• Silver & Gold prices loaded : XAU-XAG_030326.xlsx (EODHD.com source)
• Macro factors fetched live from FRED API: US Dollar Index (DXY), 10Y Treasury yield, S&P 500, Core PCE
• Data aligned on business days, forward-filled for low-frequency series (Core PCE)
2. Feature Engineering
• All price series converted to daily log-returns to achieve stationarity
• 5 lags of each of the 6 input variables created → 30 features total
• Target variable = next-day log-return of Silver (and Gold)
3. Model — Gradient Boosted Trees (XGBoost)
• XGBRegressor with 300 trees, depth=4, learning rate=0.05, subsampling=0.8
• Validated using 5-fold TimeSeriesSplit (no data leakage — future never trains past)
• CV RMSE: Gold = 0.0176, Silver = 0.0309 (log-return units)
4. Residual Bootstrap
• In-sample residuals (actual − predicted) computed for both models
• Residuals capture heteroskedasticity and fat tails not explained by the model
• Each Monte Carlo path draws randomly from this empirical residual pool
5. Monte Carlo Simulation
• 2,000 paths × 20 business days simulated
• Each step: predicted return (sampled from recent 60-day model predictions) + bootstrapped residual
• Prices compounded via Pt+1=Pt⋅ertPt+1=Pt⋅ert
6. Quantile Probabilistic Forecast
• At each horizon, the 2,000 simulated prices are ranked
• Q10 = 10th percentile (bear case), Q50 = median (base case), Q90 = 90th percentile (bull case)
• No parametric distribution assumed — fully empirical
Performance Diagnostics As this is a non-parametric model with quantile forecasting the standard model performance metrics such as RMSE, MAPE, MAD etc are not so appropriate. So we use Pinball Loss and Skill core diagnostics. See Table above. Model performance diagnostics are extremely good!
I have written a .py script to run the model each time I have new data.
Explaining Pinball Loss
Imagine you bet on where the price will land. If you said Q10 = $30 and the actual came in above $30, you're penalised lightly (you were supposed to be conservative). If the actual came in below $30, you're penalised heavily — because your "bear case" was too optimistic. So the penalty is asymetric in favor of conservativeness. The penalty is asymmetric, scaled by the quantile level. Lower pinball loss = better calibrated quantile.
Explaining Skill Score




Comments
Post a Comment