Lesson 4.1: Credit migration matrices and how to read them
Build and read a one-year credit migration matrix: grades, persistence, upgrades, downgrades, the default column as PD, and the noise in thin rows.
By the end of this lesson you will be able to build a credit migration matrix from two dated snapshots of a lender's borrowers, read it row by row, and use it to answer practical questions: how sticky a risk grade is, how often borrowers move up or down, what the one-year probability of default is for each grade, and how much of a matrix is noise when the starting group is small. You will also see how a migration matrix differs from the roll rate table of Lesson 3.3, and why lenders keep both. You should have read Lesson 1.1, which introduced probability of default, and Lesson 3.3, which built a transition table between delinquency buckets. The arithmetic is counting and percentages, and every figure here is rebuilt by hand from a small set of counts.
Module 3 looked at loans that were already late. Roll rates are quick and sensitive, but they only see a borrower once something has gone wrong. Most of the credit risk in a book sits in borrowers who are still paying on time, and a lender needs to know how that risk is changing before the first missed instalment. A credit migration matrix answers that. It sorts borrowers by their risk grade at one date, looks at them again a year later, and records where they ended up.
What a migration matrix measures
Start with the idea of a risk grade. A lender scores each borrower, using a scorecard like those of Module 5 or a rating from an agency, and groups the scores into a few bands. Here we use five grades: A is the safest, E is the riskiest, and a sixth state, Default, sits at the end. Banks and rating agencies use letter or number grades; a retail lender might use score bands such as 750 and above, 700 to 749 and so on. The method is the same.
A migration matrix has one row per starting grade and one column per ending grade, over a fixed horizon, usually one year. Each cell is:
> Share of borrowers who started in grade X and ended in grade Y = borrowers who moved from X to Y ÷ borrowers who started in X
Each row therefore adds to 100 per cent, as with the roll rate table. The difference is in what the states and the horizon mean.
· Roll rate table (Lesson 3.3) · Migration matrix (this lesson)States · Delinquency buckets: current, 1 to 30, 31 to 60 and so on · Risk grades, from safest to riskiest, then default
Horizon · One month · Usually one year
Who is in it · Loans that are late or about to be · All borrowers, including those who are fully up to date
Main question · How fast is stress turning into default? · How is credit quality shifting, and what is the default risk of each grade?
## An illustrative matrix
Here is a one-year migration matrix for an illustrative lender. Read each row as: of borrowers who started the year in this grade, what percentage ended the year in each grade, or in default.
From \ To · A · B · C · D · E · DefaultA · 92.0% · 6.0% · 1.2% · 0.5% · 0.2% · 0.1%
B · 4.0% · 86.0% · 7.0% · 1.8% · 0.7% · 0.5%
C · 1.0% · 6.0% · 80.0% · 9.0% · 2.5% · 1.5%
D · 0.5% · 2.0% · 8.0% · 74.0% · 10.0% · 5.5%
E · 0.0% · 0.5% · 2.0% · 8.5% · 62.0% · 27.0%
Default · 0% · 0% · 0% · 0% · 0% · 100%
The last row says that once a borrower has defaulted, it stays in default. Default is an absorbing state: for the purposes of the matrix, a borrower who defaults does not come back. Recoveries and cures after default are handled separately, in the loss analysis of Lesson 3.1.
Check that every row adds to 100 per cent. Grade C: 1.0 + 6.0 + 80.0 + 9.0 + 2.5 + 1.5 = 100.0. If a row does not add up, a destination is missing.
Counts underneath the percentages
A percentage is only as good as the count behind it. The row for grade D comes from the following counts, for a group of 2,000 borrowers who started the year in grade D.
Ended in · A · B · C · D · E · Default · TotalBorrowers · 10 · 40 · 160 · 1,480 · 200 · 110 · 2,000
Divide each count by 2,000: 10 ÷ 2,000 = 0.5 per cent, 40 ÷ 2,000 = 2.0 per cent, 160 ÷ 2,000 = 8.0 per cent, 1,480 ÷ 2,000 = 74.0 per cent, 200 ÷ 2,000 = 10.0 per cent, and 110 ÷ 2,000 = 5.5 per cent. The matrix is nothing more than the table of counts with every row divided by its own total.
How to read it: four things to look for
1. The diagonal is persistence. The diagonal cells show the share who stay in the same grade. Here they run from 92 per cent in A down to 62 per cent in E. A high diagonal means a stable portfolio. The diagonal usually falls as grades worsen, because riskier borrowers' situations are more volatile. A lender whose diagonal falls over time is seeing more churn in its customers' quality.
2. Above and below the diagonal are upgrades and downgrades. In this layout, cells to the right of the diagonal are downgrades (a worse grade) and cells to the left are upgrades. Add them up for each row. For grade C, upgrades are 1.0 + 6.0 = 7.0 per cent. Downgrades, including default, are 9.0 + 2.5 + 1.5 = 13.0 per cent. A grade C borrower is nearly twice as likely to be downgraded as upgraded. Do the same for every row and you have the lender's drift.
Grade · Upgraded · Stayed · Downgraded (including default)A · none possible · 92.0% · 8.0%
B · 4.0% · 86.0% · 10.0%
C · 7.0% · 80.0% · 13.0%
D · 10.5% · 74.0% · 15.5%
E · 11.0% · 62.0% · 27.0%
The rows show a general rule: the riskier the grade, the more likely a downgrade and the less likely it is that a borrower stays. For grade E, "downgraded" means defaulted, since E is the lowest grade.
3. The Default column is the one-year probability of default for each grade. This is the most useful single column. It reads 0.1, 0.5, 1.5, 5.5 and 27.0 per cent. These are the PDs that Lesson 1.1 used as inputs, now estimated from behaviour. The range is wide: a borrower in E is 270 times as likely to default in the year as one in A. That spread is what the scorecard exists to produce.
4. The shape of the row shows where borrowers go. Look at the whole row of grade C.
Predict first: a borrower starts the year in grade C. What is the chance that she is in grade C or better at the end of the year, and is she more likely to be upgraded or downgraded? Work it out before reading on.
Grade C or better means A, B or C: 1.0 + 6.0 + 80.0 = 87.0 per cent. She is more likely to be downgraded (13.0 per cent) than upgraded (7.0 per cent). In plain words, the typical outcome is no change, and the rest of the movement leans to the bad side. That lean is what lenders mean by negative drift, and it is the reason a book of C borrowers gets riskier on average over time unless new, better borrowers are added.
From the matrix to the portfolio
A matrix describes how each grade behaves. To apply it to a book, combine it with the grade mix. Suppose a lender has ₹1,000 crore of loans with this mix: 30 per cent in A, 30 per cent in B, 25 per cent in C, 10 per cent in D and 5 per cent in E. The expected share of the book defaulting in the next year is the mix times the default column:
0.30 × 0.1% + 0.30 × 0.5% + 0.25 × 1.5% + 0.10 × 5.5% + 0.05 × 27.0%
= 0.03% + 0.15% + 0.375% + 0.55% + 1.35% = 2.455%
On ₹1,000 crore, that is about ₹24.6 crore of expected defaulted balance. Notice that grade E is only 5 per cent of the book but contributes 1.35 of the 2.455 points, more than half of the expected defaults. Grade A, with 30 per cent of the book, contributes 0.03 points. Risk is concentrated at the bottom of the scale, so a small change in the weight of the bottom grades moves the whole portfolio.
Try moving 5 points of the book from grade B to grade E, which raises the E share from 5 to 10 per cent. The expected default rate rises from 2.5 per cent to about 3.8 per cent, an increase of more than half from a five-point change in mix. This is why a lender that loosens approval criteria to grow volume sees its default rate move so much more than the growth itself.
Good times and bad times
A matrix is estimated from a particular period, and it reflects that period's economy. The same lender in a downturn might see a different row for grade C.
Grade C row · A · B · C · D · E · DefaultNormal year · 1.0% · 6.0% · 80.0% · 9.0% · 2.5% · 1.5%
Downturn year · 0.5% · 4.0% · 74.0% · 13.0% · 5.0% · 3.5%
The downturn row adds to 100.0 per cent (0.5 + 4.0 + 74.0 + 13.0 + 5.0 + 3.5). The default rate for grade C is 3.5 per cent against 1.5 per cent, more than twice as high, and the diagonal falls from 80 to 74 per cent as borrowers move down. Two matrices are therefore useful: an average through-the-cycle matrix, built over several years, for long-run planning, and a point-in-time or downturn matrix for stress testing. Mixing them without saying so is a common source of confusion. A PD taken from a boom year will understate the risk of a recession, and a PD from a recession year will overstate the cost of normal lending.
Noise: how much of a matrix to trust
Every cell in a matrix is an estimate from a finite number of borrowers. Small groups are noisy, and the thin rows are usually the riskiest grades, where precision matters most.
Take grade E. Suppose the lender had only 100 borrowers in E at the start of the year, and 27 defaulted. The estimated PD is 27 per cent. The standard error of a proportion p from n observations is the square root of p × (1 − p) ÷ n. Here that is the square root of 0.27 × 0.73 ÷ 100 = the square root of 0.001971 = 0.0444, or 4.4 percentage points. An approximate 95 per cent range is plus or minus 1.96 times this, about 8.7 points: from roughly 18 to 36 per cent. A PD of 27 per cent from 100 borrowers cannot be told apart from 20 or 35.
Compare grade D, with 2,000 borrowers and 110 defaults: p = 0.055, the standard error is the square root of 0.055 × 0.945 ÷ 2,000 = the square root of 0.000026 = 0.0051, about 0.5 points, and the range is about 4.5 to 6.5 per cent. The bigger group is far more precise.
This is why migration studies often pool several years of data, combine neighbouring grades when counts are thin, and report the number of borrowers beside each row. A matrix with many empty or tiny cells should be smoothed before being used as an input to anything else, a point that Lesson 4.2 returns to.
Building the matrix in Python
The procedure is a merge on the borrower identifier between two dated snapshots, followed by a cross-tabulation. The first snapshot gives the starting grade. The second gives the ending grade, with default taken from the lender's definition of Lesson 1.4 applied over the year, not just at the final date.
python
import pandas as pd
start = pd.readcsv("grades202509.csv") # borrowerid, grade
end = pd.readcsv("grades202609.csv") # borrowerid, grade
defaults = pd.readcsv("defaults202510to202609.csv") # borrowerid (defaulted in the window)
m = start.merge(end, on="borrowerid", how="left", suffixes=("start", "end"))
m["gradeend"] = m["gradeend"].astype(object)
m.loc[m["borrowerid"].isin(defaults["borrowerid"]), "gradeend"] = "Default"
m["gradeend"] = m["gradeend"].fillna("Exited") # closed accounts, no longer observed
counts = pd.crosstab(m["gradestart"], m["gradeend"])
print(counts)
percentages, leaving out borrowers who exited
kept = counts.drop(columns="Exited", errors="ignore")
matrix = kept.div(kept.sum(axis=1), axis=0) 100
print(matrix.round(1))
Two choices in this code matter. First, a borrower who defaulted at any time in the window is marked as defaulted, even if the borrower later returned to a good grade; otherwise the default column would understate PD. Second, borrowers who left the book, for instance by repaying a loan in full, are removed from the denominator. Treating them as "stayed" would inflate the diagonal, and treating them as defaults would be plainly wrong. Say which treatment you use, and report how many borrowers exited.
A worked example: two lenders, same book size
Two lenders each lend ₹1,000 crore. Their grade mixes are the same, but their migration matrices differ in the middle grades. Lender P has the matrix of this lesson. Lender Q has a grade C row of 0.5, 4.0, 74.0, 13.0, 5.0, 3.5 (the downturn row), because its borrowers are less stable.
Compare the two C rows. Lender P's C borrowers default at 1.5 per cent. Lender Q's default at 3.5 per cent. If each has 25 per cent of its book in grade C, that is ₹250 crore, so P expects 250 × 1.5% = ₹3.75 crore of defaults from grade C, and Q expects 250 × 3.5% = ₹8.75 crore. Q expects five crore more from one grade alone. A reader who compared only the grade mix, which is identical, or only the headline NPA ratio today, would miss it. The matrix shows that Q's borrowers are more likely to deteriorate and the difference will appear in next year's NPAs.
Take one more step. In Lender Q's row, the share of C borrowers moving to D or E is 13.0 + 5.0 = 18.0 per cent, against 11.5 per cent for P. Next year Q will have a worse grade mix than P even if it lends the same way, because its borrowers drift down faster. Migration matrices are therefore leading indicators: they show what the portfolio will look like, and not only what it looks like.
Matrix, roll rate or something else
A migration matrix and a roll rate table both record movement between states, but they answer different questions. Roll rates tell a collections manager how many of this month's late loans will go bad next month. Migration matrices tell a portfolio manager how the quality of all borrowers is shifting over a year, including those who have never missed a payment. A lender uses both, along with the vintage analysis of Lesson 4.3, and Lesson 4.4 sets out how to choose among the three.
Common mistakes
Rows that do not add to 100 per cent. A destination such as Exited is missing, or the denominator is wrong.
Treating the default column as a PD without checking the horizon. It is a PD over the matrix's horizon, usually one year.
Dropping borrowers who defaulted and then recovered. Mark default whenever it occurred in the window.
Treating exits as stays. Report them and remove them from the denominator.
Reading thin rows as precise. Give the count of borrowers and a range.
Mixing a boom matrix with a downturn use. State the period the matrix describes.
Ignoring the mix. A matrix is only a portfolio answer when applied to the actual grade weights.
Comparing lenders without matching grade definitions. An A at one lender is not an A at another.
Key takeaways
A migration matrix records where borrowers in each starting grade stand after a fixed horizon. Each row adds to 100 per cent.
The diagonal shows persistence, the cells either side show upgrades and downgrades, and the default column gives the one-year PD of each grade.
PD rises steeply as grade falls: from 0.1 per cent in A to 27 per cent in E. Applied to the grade mix, the riskiest grades often produce most of the expected defaults.
Matrices depend on the economic period. Keep a through-the-cycle matrix and a downturn matrix, and say which you are using.
Small starting groups give noisy rows. A PD of 27 per cent from 100 borrowers carries a range of about plus or minus 9 points.
Migration shows quality drifting before defaults happen, which makes it a leading indicator and a complement to the roll rates of Module 3.
Check yourself
1. In a one-year matrix, 500 borrowers start in grade B. 20 move to A, 430 stay in B, 35 move to C, 10 move to D and 5 default. What are the stay rate and the PD of grade B?
Stay 430 ÷ 500 = 86 per cent. PD is 5 ÷ 500 = 1.0 per cent. The counts add to 500.
2. A book has 40 per cent in grade A (PD 0.1 per cent), 40 per cent in grade B (0.5 per cent) and 20 per cent in grade C (1.5 per cent). What is the expected default rate?
0.4 × 0.1 + 0.4 × 0.5 + 0.2 × 1.5 = 0.04 + 0.20 + 0.30 = 0.54 per cent.
3. Why is a matrix built from a boom year a poor guide to a recession?
In a downturn borrowers are downgraded and default more often, so the diagonal falls and the default column rises. A boom matrix understates both.
4. Of 50 borrowers in a rare grade, 4 defaulted. Why would you hesitate to publish a PD of 8 per cent for it?
The standard error is about 3.8 points, so the 95 per cent range runs from near 0 to over 15 per cent. Pool more years or neighbouring grades before relying on it.
5. What does it mean that default is an absorbing state in the matrix, and what does the matrix leave out as a result?
Defaulted borrowers stay in the default state, so the matrix does not show cures or recoveries. Those are measured separately, in the loss analysis.
Try this
Build a migration matrix from two snapshots of your own. Set aside forty to forty-five minutes.
1. Invent a table of at least 500 borrowers with a grade from A to E at the start of a year. Make about 10 per cent of them E and 5 per cent A.
2. For the end of the year, assign each borrower a grade, a default flag or an exit, with realistic stickiness: most stay put, some move one step, a few move two.
3. Build the table of counts by starting and ending grade. Check that every row adds to its starting total.
4. Divide each row by its total, leaving out exits, and write down the default column as the PD by grade.
5. Add up upgrades, stays and downgrades for each grade. Find the grade where downgrades most exceed upgrades.
6. Apply the default column to the grade mix of your book to find the expected default rate. Use the simulator to see what shifting five points of the book into grade E does.
7. For the thinnest row, compute the standard error of its default rate and write the range. Write a four-sentence note for a credit head about which grade worries you, what the drift says and how reliable the numbers are.
A good result is a six-by-six matrix whose rows add up, a PD by grade with a range on the thin rows, and a portfolio default rate you can explain. Lesson 4.2 takes the same matrix and multiplies it by itself, to look beyond one year.
Tags: Credit Risk Analytics Migration Matrix Risk Grades PD Portfolio Quality