liveBook · Manning

Fundamental matrix

As explained in Statistics Every Programmer Needs

A fundamental matrix is the matrix obtained by inverting the difference between the identity matrix and the transient-state transition matrix in an absorbing Markov chain.

A fundamental matrix summarizes how a system moves from transient states toward absorbing states in an absorbing Markov chain. It is computed as F = (I − B)⁻¹, where I is the identity matrix and B contains transient-to-transient transition probabilities. section 11.4 section 11.4.1

Compute and apply the matrix in three stages:

  • Partition the transition matrix into I, A, and B, separating absorbing-state and transient-state transitions. section 11.4.1
  • Subtract B from I, then invert the difference to obtain F. Larger matrices make inversion increasingly complex. section 11.4.1
  • Multiply F by A to obtain FA, whose rows give probabilities of reaching each absorbing state from each transient state. section 11.4.2
  • Use NumPy to automate partitioning, inversion, multiplication, and output, reducing manual calculation errors. section 11.4.3

Account delinquency states

For Harmony Finance, transient states represent early- and late-stage delinquency, while absorbing states represent current and charged-off accounts. The computed FA matrix is [[0.9833, 0.0167], [0.85, 0.15]], indicating approximately 98.3% versus 1.7% outcomes for early delinquency and 85% versus 15% for late delinquency. section 11.4.2 section 11.4.3

>>> P = np.array([
>>>     [1, 0, 0, 0],
>>>     [0, 1, 0, 0],
>>>     [0.80, 0, 0.10, 0.10],
>>>     [0.30, 0.10, 0.30, 0.30]
>>> ])    #1

>>> I = np.array([
>>>     [1, 0],
>>>     [0, 1]
>>> ])     #2

>>> A = np.array([
>>>     [0.80, 0],
>>>     [0.30, 0.10]
>>> ])   #3

>>> B = np.array([
>>>     [0.10, 0.10],
>>>     [0.30, 0.30]
>>> ])     #4

>>> I_minus_B = I – B     #5
>>> F = np.linalg.inv(I_minus_B)     #6

>>> FA = np.dot(F, A)     #7

>>> print('The final matrix FA is:')
>>> print(FA)     #8

The final matrix FA is:
[[0.98333333 0.01666667]
 [0.85       0.15      ]]

Inspect the NumPy listing that constructs P, I, A, and B, computes F = (I − B)⁻¹, and prints FA. section 11.4.3

How Statistics Every Programmer Needs covers it

How deep it goes
Explains partitioning, matrix inversion, multiplication, rounding adjustment, and NumPy implementation, without developing a general proof.
Examples
Uses delinquent-account transition matrices, manual 2 × 2 inversion, and a NumPy calculation producing the FA probability matrix.
What it assumes
Assumes transition probabilities and matrix operations, while defining identity matrices, transient states, absorbing states, and inversion steps.
What you can do after
Build it from scratch by partitioning transition matrices, computing F, and deriving absorbing-state probabilities with NumPy.
How it connects
Connects absorbing Markov chains, transition matrices, transient states, absorbing states, matrix inversion, and NumPy.

Related concepts

This explainer was generated by Manning's knowledge graph from the text of Statistics Every Programmer Needs. The section links point to the parts of the book it draws on.