Rating Transition Matrix
Retrieves the rating transition matrix of a credit rating agency: for every rating at the start of a period, the share of ratings that ended the period in each rating category, in default or withdrawn. It is the input of rating migration and default models, such as the Jarrow-Lando-Turnbull model, and of credit portfolio models.
The data comes from CEREP, the central repository where every credit rating agency registered in the European Union reports its ratings to ESMA, published twice a year with periods from 1989. It covers the global ratings of agencies such as S&P, Moody’s, Fitch, DBRS and Scope, for corporates (non-financial, financial and insurance), sovereigns, structured finance and covered bonds, in each agency’s own rating scale. No API key is needed.
By default the matrix is withdrawal-adjusted, the convention of the agencies’ own default studies: ratings withdrawn during the period are left out, so each row sums to 1. The matrix compares the rating at the start of the period with the rating at its end, so a default that was followed by a new rating within the period (as after a distressed exchange) shows as that new rating; get_default_rates counts every default within the period and is the measure to calibrate default rates on. With include_withdrawals=True they are a separate “Withdrawals” column, and with probabilities=False the counts are returned instead.
The formula is as follows (probabilities=True, the default):
\[\text{Transition Probability} (\text{from},\; \text{to}) = \text{Count} (\text{from},\; \text{to}) / \operatorname{SUM}(\text{Count} (\text{from},\; \text{every end category})),\;\; \text{with the end categories the ratings and default},\;\; \text{plus "Withdrawals" only when include\_withdrawals=True}\]A single year’s matrix rests on few observations in the top and bottom rows: an AAA row with few issuers is often 100% stable one year and shows a downgrade the next. Credit models therefore use the average over many years, or a longer horizon, and check how far the latest year deviates from it, which also shows where in the credit cycle the year stands.
See definition: https://registers.esma.europa.eu/cerep-publication/
Also known as: rating migration matrix, credit migration matrix, transition probabilities.
Rating Transition Matrix in Python or via the MCP
Install the Finance Toolkit with:
pip install financetoolkit -U
Then call get_rating_transition_matrix as shown below.
from financetoolkit import FixedIncome
fixedincome = FixedIncome(end_date="2025-12-31")
transition_matrix = fixedincome.get_rating_transition_matrix(agency='S&P', year=2025)
transition_matrix.loc['AAA':'CCC', ['AAA', 'AA', 'A', 'BBB', 'BB', 'B', 'CCC', 'D']]
Or, after setting up the Finance Toolkit MCP, ask:
How likely were S&P-rated corporates from AAA to CCC to keep, raise or lose their rating, or to default, during 2025?
Which returns:
| From Rating | AAA | AA | A | BBB | BB | B | CCC | D |
|---|---|---|---|---|---|---|---|---|
| AAA | 1 | 0 | 0 | 0 | 0 | 0 | 0 | 0 |
| AA | 0 | 0.9518 | 0.0482 | 0 | 0 | 0 | 0 | 0 |
| A | 0 | 0.0135 | 0.9646 | 0.0219 | 0 | 0 | 0 | 0 |
| BBB | 0 | 0.0006 | 0.0355 | 0.9563 | 0.007 | 0.0006 | 0 | 0 |
| BB | 0 | 0 | 0 | 0.0353 | 0.9283 | 0.0353 | 0.0011 | 0 |
| B | 0 | 0 | 0 | 0 | 0.0387 | 0.9001 | 0.0558 | 0.0023 |
| CCC | 0 | 0 | 0 | 0 | 0 | 0.18 | 0.76 | 0.03 |
Parameters
get_rating_transition_matrix accepts the following parameters.
| Parameter | Type | Description | Example |
|---|---|---|---|
agency | str | The rating agency, e.g. “S&P”, “Moody’s”, “Fitch”, “DBRS”, “Scope” or “Kroll”, or the CEREP code of any registered agency. Defaults to “S&P”. | "Moody's" |
rating_type | str | “corporate”, “sovereign”, “structured_finance” or “covered_bonds”. Defaults to “corporate”. | "sovereign" |
year | int | None | The first year of the period. Defaults to None, which takes the latest year published. | 2020 |
horizon | int | The length of the period in years, from 1 January of year. Defaults to 1. | 5 |
probabilities | bool | Whether to return the share of ratings per row instead of the number. Defaults to True. | False |
include_withdrawals | bool | Whether to keep the ratings withdrawn during the period as a “Withdrawals” column. Defaults to False. | True |
region | str | None | The area of the rated entities: “Africa”, “America”, “Asia”, “Europe”, “EU members”, “International” or “Oceania”. Defaults to None, which covers all of them. | "Europe" |
rounding | int | None | The number of decimals to round the results to. Defaults to None. | 2 |