Note
Go to the end to download the full example code or to run this example in your browser via JupyterLite.
Jarrow, Lando and Turnbull: generator matrices#
Jarrow, Lando and Turnbull (1997) put rating migration in continuous time. A generator \(\Lambda\), with non-negative off-diagonal intensities and rows summing to zero, gives the transition matrix for every horizon, \(P(t) = e^{\Lambda t}\). Default probabilities by rating, and risky bond prices with recovery of treasury, follow for any maturity, including fractions of a year that an annual matrix cannot provide.
import matplotlib.pyplot as plt
import numpy as np
from financialkit.credit import RATINGS, creditmetrics_matrix, generator_from_transition, jlt_risky_zero, regularize_generator, transition_from_generator
from financialkit.credit.visualizers import plot_transition_matrix
G = regularize_generator(generator_from_transition(creditmetrics_matrix()))
plot_transition_matrix(G, labels=RATINGS, fmt="{:.1f}")
plt.title("generator (% per year)")

Text(0.5, 1.0, 'generator (% per year)')
The term structure of default probabilities#

<matplotlib.legend.Legend object at 0x1165667b0>
exp(G t) interpolates the annual matrix powers#
<matplotlib.legend.Legend object at 0x116565940>
Risky zero-coupon spreads by rating#

Total running time of the script: (0 minutes 0.138 seconds)