Skip to content
Prev 175180 / 398506 Next

about the Choleski factorization

On 3/27/2009 11:46 AM, 93354504 wrote:
> rev <- matrix(c(0,0,1,0,1,0,1,0,0),3,3)
 > rev
      [,1] [,2] [,3]
[1,]    0    0    1
[2,]    0    1    0
[3,]    1    0    0

(the matrix that reverses the row and column order when you pre and post 
multiply it).

Then

L <- rev %*% chol(rev %*% x %*% rev) %*% rev

is what you want, i.e. you reverse the row and column order of the 
Choleski square root of the reversed x:

 > x
      [,1] [,2] [,3]
[1,]    5    1    2
[2,]    1    3    1
[3,]    2    1    4

 > L <- rev %*% chol(rev %*% x %*% rev) %*% rev
 > L
           [,1]     [,2] [,3]
[1,] 1.9771421 0.000000    0
[2,] 0.3015113 1.658312    0
[3,] 1.0000000 0.500000    2
 > t(L) %*% L
      [,1] [,2] [,3]
[1,]    5    1    2
[2,]    1    3    1
[3,]    2    1    4

Duncan Murdoch