0

I have a series of cumulative transition matrices (5y, 10y, ..., 30y), and am trying to get the one year annualised transition matrices defined as 1-Year Matrix ^ T = T-year Matrix So I am solving for the one-year matrix as 1-Year Matrix = (T-Year Matrix)^(1/T).

In Python, I am trying the following two methods:

  1. Using inbuilt fractional_matrix_power function in scipy.linalg.

  2. Use the taylor series expansion as to avoid fractional matrices (i.e. 1 Year Matrix = exp ( ln(T-Year Matrix) / T) = 1 + (ln(T-Year Matrix) / 1)/1! + ... where the logarithms are applied after diagonalisation of the matrix.

Both methods seem to be working well, except the resulting 1y matrices for the 30y cumulative matrices have complex numbers (albeit with very small imaginary components). I was wondering whether anybody has faced the same problem, and if there are workarounds? Or maybe does this imply that the 30y matrix is invalid? Or maybe there is an issue with the methodology?

4
  • Seems to imply your model is wrong? Is your list of transition matrices consistent with themselves i.e. (5-Year)^6 = (30-Year)? Commented Jul 30, 2024 at 14:29
  • Actually they are not consistent by design. The cumulative matrices themselves are stressed outputs based on external variables. But that is a good point Commented Jul 30, 2024 at 15:10
  • 2
    For anybody else that gets the same problem: I solved this by observing that some of the eigenvalues of the matrix were computed as -0 in Python (which taking the logarithm of leads to complex numbers). So I set values of -0 to 0. Commented Jul 30, 2024 at 16:36
  • Go ahead and post that as an answer and accept it. Commented Jul 30, 2024 at 17:09

1 Answer 1

0

For anybody else that gets the same problem: I solved this by observing that some of the eigenvalues of the matrix were computed as -0 in Python (which taking the logarithm of leads to complex numbers). So I set values of -0 to 0.

Sign up to request clarification or add additional context in comments.

Comments

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.