
The question
Can market signals that move every day, such as CDS spreads, bond yields and FX volatility, warn a bank that a country's S&P credit rating is about to change? The model looks at a 60-day window and predicts an upgrade, a downgrade or no change in the 30 to 90 days after it.
Data
Daily CDS, 10-year yield and FX volatility per country from 2010, exported from Bloomberg, plus monthly inflation, FX reserves and the policy rate forward-filled onto the daily grid. Targets come from the S&P rating history. About 96% of the training windows are "no change", which is the real difficulty of the task.
Approach
- Custom parsers for the Bloomberg wide export, resampling and gap filling within each country so nothing leaks across countries.
- A chronological split: train up to October 2022, test on everything after.
- A late-fusion network: a 2-layer LSTM encodes the daily sequence, an MLP encodes the macro snapshot, and both feed one classification head.
- Weighted cross-entropy against the class imbalance, and early stopping.
Result
The weighted model catches about half of the real upgrades and downgrades in the test period, but only by raising far too many false alarms, so in this form it is not a usable early warning system. I keep it in the portfolio as an honest negative result: with a handful of rating actions per country the event classes are too small for a sequence model, and a ranking formulation (flag the riskiest country-days) on engineered features is the better next step.