Lesson 4.2: The Markov chain method for credit migration
Multiply a migration matrix by itself to get multi-year transition and cumulative default probabilities, and learn where the Markov assumption fails.
By the end of this lesson you will be able to take a one-year credit migration matrix and extend it to longer horizons using matrix multiplication. You will compute two-year and three-year transition probabilities by hand on a small matrix, read off cumulative and marginal default probabilities, see why a three-year default probability is not three times the one-year figure, estimate the expected time to default, and judge when the method can be trusted. You should have read Lesson 4.1, which built the one-year matrix. The arithmetic is multiplication and addition, and the hand calculations use a matrix with only three states so that every number can be checked.
A one-year matrix is enough for a one-year question. A five-year loan, a mortgage, or an accounting standard that asks for lifetime expected losses needs default probabilities over many years, and a lender rarely has enough history to measure a five-year matrix directly. The Markov chain method gets there with the matrix it already has, by assuming that each year's movement follows the same rules.
The Markov assumption
A Markov chain is a process that moves between states with a rule that depends only on where it is now. Two statements capture the idea.
1. No memory. The chance of moving from grade C to grade D next year depends only on the borrower being in grade C today. It does not depend on how long the borrower has been in C, or on whether the borrower came from B or from D.
2. Same rules every year. The matrix is the same in year 2 and year 3 as in year 1. This is called time-homogeneity or stationarity.
If both hold, then the probability of getting from state i to state j in two years is a sum over every state the borrower might pass through in between. In symbols, writing P for the one-year matrix, the two-year matrix is P multiplied by P, written P². The three-year matrix is P³, and so on. This is ordinary matrix multiplication, which is the same operation as adding up probabilities of paths.
A small example by hand
Reduce the world to three states for the first calculation: Good, Weak and Default. The one-year matrix is:
From \ To · Good · Weak · DefaultGood · 0.92 · 0.07 · 0.01
Weak · 0.20 · 0.65 · 0.15
Default · 0 · 0 · 1
A Good borrower has a 1 per cent chance of defaulting in a year, a 7 per cent chance of slipping to Weak and a 92 per cent chance of staying Good. A Weak borrower defaults with probability 15 per cent, recovers to Good with probability 20 per cent and stays Weak with probability 65 per cent.
The two-year matrix
Take a Good borrower and ask where she stands after two years. Every path must be counted.
Ends Good: Good then Good (0.92 × 0.92 = 0.8464), or Weak in between and back to Good (0.07 × 0.20 = 0.0140). Total 0.8464 + 0.0140 = 0.8604.
Ends Weak: Good then Weak (0.92 × 0.07 = 0.0644), or Weak then Weak (0.07 × 0.65 = 0.0455). Total 0.1099.
Ends in Default: Default in year 1 (0.01), or Good then Default (0.92 × 0.01 = 0.0092), or Weak then Default (0.07 × 0.15 = 0.0105). Total 0.01 + 0.0092 + 0.0105 = 0.0297.
Check: 0.8604 + 0.1099 + 0.0297 = 1.0000. The same recipe for a Weak borrower gives Good 0.20 × 0.92 + 0.65 × 0.20 = 0.314, Weak 0.20 × 0.07 + 0.65 × 0.65 = 0.4365, and Default 0.20 × 0.01 + 0.65 × 0.15 + 0.15 = 0.2495.
The two-year matrix is therefore:
From \ To · Good · Weak · DefaultGood · 0.8604 · 0.1099 · 0.0297
Weak · 0.3140 · 0.4365 · 0.2495
Default · 0 · 0 · 1
The recipe for each cell is "row of the first matrix times column of the second", which is how matrices are multiplied. Whatever tool you use, the idea underneath is this tally of paths.
Predict first: a Good borrower has a 1 per cent chance of default each year. After three years, is the cumulative probability of default about 3 per cent, noticeably more, or noticeably less? Decide before reading on.
The answer is noticeably more. Multiplying the two-year matrix by the one-year matrix again gives the three-year row for a Good borrower: Good 0.8135, Weak 0.1317 and Default 0.0548. The cumulative default probability is 5.5 per cent, almost double the naive 3 per cent. The reason is migration. Over the three years some Good borrowers slide into Weak, where the annual default rate is 15 per cent, and those drifting borrowers add to the defaults. A PD that only scaled the first-year figure would ignore this slide.
Horizon · Cumulative PD, starting Good · Cumulative PD, starting Weak1 year · 1.00% · 15.00%
2 years · 2.97% · 24.95%
3 years · 5.48% · 31.81%
4 years · 8.27% · 36.77%
5 years · 11.18% · 40.56%
The curves show two different stories. A borrower who starts Weak is already close to the edge, and about a quarter has defaulted within two years. Yet the Weak borrowers who survive are not stuck: many recover. The chart below shows where a Weak borrower stands after three years.
The three shares add to 100 per cent. That recovery is why a Weak borrower is not simply a future default, and it is the reason the expected time to default, computed later in this lesson, is so much longer than a one-year PD of 15 per cent would suggest.
Cumulative, marginal and conditional default probability
Three quantities are easy to confuse, and they are all read from the Default column.
Cumulative PD at year n is the probability of having defaulted by the end of year n. For a Good borrower: 1.00, 2.97, 5.48 per cent.
Marginal PD in year n is the probability of defaulting in that particular year, seen from today. It is the difference between consecutive cumulative figures: year 2 is 2.97 − 1.00 = 1.97 per cent, and year 3 is 5.48 − 2.97 = 2.51 per cent.
Conditional PD in year n is the probability of defaulting in year n given that the borrower had not defaulted before. For year 2 it is the marginal PD divided by the survival probability: 1.97 ÷ (100 − 1.00) = 1.99 per cent. For year 3 it is 2.51 ÷ (100 − 2.97) = 2.59 per cent.
Notice that the conditional PD of a Good borrower rises year by year, 1.00, 1.99, 2.59 per cent, even though the matrix has the same row every year. That is migration again. The Good borrowers who survive include a growing share who have slipped to Weak, so the surviving group is riskier on average. Which of the three a model needs depends on the use. Pricing and lifetime expected loss need marginal PDs, because each year's loss depends on the chance of defaulting in that year. A survival model for the borrower uses conditional PDs.
Lifetime expected loss
The cumulative and marginal PDs connect straight to the expected loss of Lesson 3.2. For an exposure that does not amortise, the lifetime expected loss is the cumulative PD times LGD times EAD. Take ₹100 crore of Good-rated loans with an LGD of 50 per cent and a three-year life:
> 0.0548 × 50% × ₹100 crore = ₹2.74 crore of expected loss over the three years.
The one-year figure would be 0.0100 × 50% × 100 = ₹0.50 crore. Looking only at the first year understates the lifetime cost by more than five times. This is the quantity that expected credit loss accounting needs, which Module 10 develops in full. It also needs the exposure to amortise, and the losses to be discounted, as Lesson 3.1 showed.
Raise the Good to Weak probability from 7 to 15 per cent and the three-year default figure grows faster than the naive one. Set it to zero and the two agree closely. The gap between them is a direct measure of how much migration matters in the book.
Expected time to default
One more result follows from the matrix, and it shows the long-run character of the chain. Suppose we ignore the loan's maturity and ask how many years, on average, a borrower spends in each non-default state before finally defaulting. Take the block of the matrix for the non-default states:
Q = [[0.92, 0.07], [0.20, 0.65]]
The expected number of years spent in each state is given by the matrix (I − Q)⁻¹, called the fundamental matrix. Here I − Q = [[0.08, −0.07], [−0.20, 0.35]]. The determinant is 0.08 × 0.35 − 0.07 × 0.20 = 0.028 − 0.014 = 0.014. The inverse is (1 ÷ 0.014) × [[0.35, 0.07], [0.20, 0.08]] = [[25.0, 5.0], [14.3, 5.7]].
Read each row. A borrower who starts Good expects to spend 25.0 years in Good and 5.0 in Weak before default, a total of 30 years. A borrower who starts Weak expects 14.3 years in Good and 5.7 years in Weak, a total of 20 years. These numbers are long, because a 1 per cent annual default rate means a typical wait of decades, and they assume the loan never matures. Real loans mature, and borrowers repay, so these are measures of the underlying risk and not of the life of a loan. The useful comparison is between the two: a Weak borrower's expected time to default is one-third shorter than a Good borrower's, even though her annual PD is fifteen times higher. The ability of Weak borrowers to recover to Good makes up most of the difference.
Doing it in Python
The method needs matrix powers, which a numerical library supplies directly.
python
import numpy as np
P = np.array([
[0.92, 0.07, 0.01], # Good
[0.20, 0.65, 0.15], # Weak
[0.00, 0.00, 1.00], # Default (absorbing)
])
for n in range(1, 6):
Pn = np.linalg.matrixpower(P, n)
print(f"Year {n}: Good -> Default {Pn[0, 2]:.4f} Weak -> Default {Pn[1, 2]:.4f}")
marginal and conditional PD for a borrower who starts Good
cum = [np.linalg.matrixpower(P, n)[0, 2] for n in range(0, 6)]
for n in range(1, 6):
marginal = cum[n] - cum[n - 1]
conditional = marginal / (1 - cum[n - 1])
print(f"Year {n}: marginal {marginal:.4f} conditional {conditional:.4f}")
expected years in each transient state before default
Q = P[:2, :2]
N = np.linalg.inv(np.eye(2) - Q)
print(N.round(1), N.sum(axis=1).round(1))
For the full five-grade matrix of Lesson 4.1, the same lines work with a six-by-six array. Check that every row of the powered matrix still adds to one, and that the Default row stays at one. If a row drifts away from one, the input matrix had a rounding error or a missing destination.
A worked example: pricing a three-year loan
A lender makes a three-year bullet loan, with a single repayment at the end, of ₹100 crore to a Good-grade borrower. The loan earns 11 per cent a year and costs 8 per cent to fund, so the spread is 3 per cent, ₹3 crore a year on a balance that stays at ₹100 crore until it is repaid or defaults. LGD is 50 per cent.
Using a one-year PD of 1 per cent for all three years. Expected loss is 3 × 1% × 50% × 100 = ₹1.50 crore over the loan's life. Total spread income is ₹9 crore, so the margin after loss looks like 9 − 1.5 = ₹7.5 crore.
Using the Markov cumulative PD of 5.48 per cent. Expected loss is 5.48% × 50% × 100 = ₹2.74 crore. The margin after loss is 9 − 2.74 = ₹6.26 crore. (This is slightly generous to the lender, because it counts three full years of spread even for loans that default early.)
The naive calculation overstated the margin by ₹1.24 crore, nearly a fifth of the total. At the lender's scale of thousands of loans, a systematic error of this size shows up as a persistent shortfall in profit. The remedy is neither complex nor expensive: multiply the matrix. What it cannot fix is a wrong matrix, which brings us to the assumptions.
Where the Markov assumption fails
The method is elegant, and an analyst should know exactly where it bends.
Memory exists. Real borrowers have momentum. A borrower who has just been downgraded is more likely to be downgraded again than one who has sat in the same grade for years. The chain assumes both have the same next-step probabilities. Evidence from rating studies and retail portfolios often finds this "ratings drift". The practical effect is that the chain tends to understate long-horizon default risk for borrowers who have recently moved down.
The rules change. A matrix measured in a benign period is applied to years that include a recession. The chain cannot know. Solutions include using different matrices for different phases of the cycle, and scaling the default column by a factor linked to economic conditions, which Module 10 uses in expected credit loss models.
Duration matters. Retail loans have a pattern in how default risk changes with the age of the loan. Default risk often peaks in the second year and falls after, as the weaker borrowers have already dropped out. A grade matrix that ignores the age of the loan averages across that pattern. Vintage analysis, in Lesson 4.3, is built to capture it.
Thin data. Five-grade matrices need enough borrowers in every row, as Lesson 4.1 showed. When a cell has almost no observations, its error spreads through every power of the matrix. Pool years, merge grades or smooth the rows before multiplying.
Annual steps may be too coarse. Credit quality can change several times in a year. Some lenders estimate a monthly or quarterly matrix and raise it to the right power. The result differs a little from a yearly estimate, and it uses information that annual snapshots throw away.
None of these makes the method wrong to use. It is a first-order tool whose output is a sensible starting point and whose weaknesses are well understood. The professional habit is to compare the Markov projection with actual multi-year outcomes whenever the history allows, and to adjust when they differ.
Common mistakes
Multiplying the first-year PD by the number of years. It ignores migration and understates the cumulative figure.
Mixing up cumulative, marginal and conditional PD. Use marginal for expected loss in a given year, cumulative for the whole life.
Raising a matrix whose rows do not add to one. Errors compound with each power.
Forgetting that default must be absorbing. If the Default row is not one, defaulted borrowers will appear to recover and the cumulative PD will fall.
Applying a benign-period matrix to a recession. State the period, and test a stressed matrix.
Treating the expected time to default as the loan's life. It assumes no maturity or repayment.
Using a thin matrix. Noisy small cells are magnified by multiplication.
Ignoring memory and age effects. Compare the projection with real multi-year history before relying on it.
Key takeaways
If borrowers move between states with the same probabilities every year and with no memory, the n-year matrix is the one-year matrix multiplied by itself n times.
Each cell of the product is a tally of paths. A Good borrower's two-year default probability of 2.97 per cent includes the path through Weak.
Cumulative PD is not the one-year PD times the number of years. In the example it was 5.48 per cent over three years against a naive 3 per cent, because borrowers drift.
Marginal PD is the chance of defaulting in a given year, conditional PD adjusts it for survival, and lifetime expected loss uses the cumulative figure with LGD and EAD.
The fundamental matrix gives expected years in each state before default, which compares the long-run quality of grades.
The method fails when borrowers have memory, when conditions change and when data are thin. Always compare it with actual multi-year outcomes.
Check yourself
1. A matrix has Good to Good 0.90, Good to Default 0.02, Good to Weak 0.08, Weak to Good 0.10, Weak to Weak 0.70, Weak to Default 0.20. What is the two-year default probability of a Good borrower?
Default in year 1 is 0.02. Good then default: 0.90 × 0.02 = 0.018. Weak then default: 0.08 × 0.20 = 0.016. Total 0.02 + 0.018 + 0.016 = 0.054, or 5.4 per cent.
2. Cumulative PDs for a grade are 2.0, 4.5 and 7.5 per cent for years 1, 2 and 3. What are the marginal PDs for years 2 and 3, and the conditional PD for year 2?
Marginal year 2 is 2.5 per cent and year 3 is 3.0 per cent. Conditional for year 2 is 2.5 ÷ 98 = 2.55 per cent.
3. Why is the conditional PD of a Good borrower rising with the year when the matrix is unchanged?
Surviving borrowers include an increasing share who have slipped to the weaker state, so the surviving group is riskier on average.
4. A lender prices a three-year loan using a one-year PD of 0.8 per cent for all years, but the Markov three-year cumulative PD is 3.0 per cent. With LGD of 45 per cent and a loan of ₹50 crore, how much expected loss did the naive method miss?
Naive: 3 × 0.8% × 45% × 50 = ₹0.54 crore. Markov: 3.0% × 45% × 50 = ₹0.675 crore. The miss is ₹0.135 crore, a fifth of the true figure.
5. Name two reasons the Markov assumption can fail for retail loans.
Momentum, where recently downgraded borrowers keep sliding, and loan age effects, where default risk changes with time on book. A changing economy and thin data also matter.
Try this
Extend a matrix of your own to a multi-year view. Set aside forty to forty-five minutes.
1. Take the five-grade matrix you built in Lesson 4.1, or use the one printed there, and check that every row adds to 100 per cent and that Default is absorbing.
2. Collapse it to three states by merging A, B and C into Good, D and E into Weak, using the exposure weights of your book to average the rows. Check that the rows still add to one.
3. Compute the two-year matrix by hand for one starting state, writing out the path tally. Check that the row adds to one.
4. Use the simulator or a few lines of Python to extend the cumulative default probability to five years for Good and Weak starts. Draw the two curves.
5. Compute the marginal and conditional PD for years 2 to 5 for a Good borrower. Explain in two sentences why the conditional PD rises.
6. Take a three-year loan of ₹50 crore with an LGD you choose. Compute its expected loss using the first-year PD three times and using the cumulative PD. Write down the gap.
7. Write a five-sentence note to a risk committee: the cumulative PD you would use, what assumptions it needs, the main reason it may be too low, and what test you would run against actual history.
A good result is two default curves that you can explain, a table of cumulative, marginal and conditional PDs, and a pricing comparison that shows the cost of the naive shortcut. Lesson 4.3 changes the angle: rather than following borrowers between grades, it follows each year's new loans as they age.
Tags: Credit Risk Analytics Markov Chain Migration Matrix Cumulative PD Lifetime Loss