[R] 12th Root of a Square (Transition) Matrix
clangkamp
christian.langkamp at gmxpro.de
Fri Nov 4 11:34:08 CET 2011
I have tried this method, but the result is not working, at least not as I
expect:
I used the CreditMetrics package transition matrix
rc <- c("AAA", "AA", "A", "BBB", "BB", "B", "CCC", "D")
M <- matrix(c(90.81, 8.33, 0.68, 0.06, 0.08, 0.02, 0.01, 0.01,
0.70, 90.65, 7.79, 0.64, 0.06, 0.13, 0.02, 0.01,
0.09, 2.27, 91.05, 5.52, 0.74, 0.26, 0.01, 0.06,
0.02, 0.33, 5.95, 85.93, 5.30, 1.17, 1.12, 0.18,
0.03, 0.14, 0.67, 7.73, 80.53, 8.84, 1.00, 1.06,
0.01, 0.11, 0.24, 0.43, 6.48, 83.46, 4.07, 5.20,
0.21, 0, 0.22, 1.30, 2.38, 11.24, 64.86, 19.79,
0, 0, 0, 0, 0, 0, 0, 100
)/100, 8, 8, dimnames = list(rc, rc), byrow = TRUE)
then followed through with the steps:
nth_root <- X %*% L_star %*% X_inv
But the check (going back 12 to the power again) doesn't yield the original
matrix. Now some rounding errors can be expected, but I didn't expect a
perfectly diagonal matrix, when the initial matrix isn't diagonal at all.
> round(nth_root^12,4)
[,1] [,2] [,3] [,4] [,5] [,6] [,7] [,8]
[1,] 0.9078 0.0000 0.0000 0.0000 0.0000 0.0000 0.0000 0
[2,] 0.0000 0.9053 0.0000 0.0000 0.0000 0.0000 0.0000 0
[3,] 0.0000 0.0000 0.9079 0.0000 0.0000 0.0000 0.0000 0
[4,] 0.0000 0.0000 0.0000 0.8553 0.0000 0.0000 0.0000 0
[5,] 0.0000 0.0000 0.0000 0.0000 0.7998 0.0000 0.0000 0
[6,] 0.0000 0.0000 0.0000 0.0000 0.0000 0.8285 0.0000 0
[7,] 0.0000 0.0000 0.0000 0.0000 0.0000 0.0000 0.6457 0
[8,] 0.0000 0.0000 0.0000 0.0000 0.0000 0.0000 0.0000 1
Any takers
-----
Christian Langkamp
christian.langkamp-at-gmxpro.de
--
View this message in context: http://r.789695.n4.nabble.com/12th-Root-of-a-Square-Transition-Matrix-tp2259736p3989618.html
Sent from the R help mailing list archive at Nabble.com.
More information about the R-help
mailing list