Skip to content

B %*% t(B) = R , then solve for B

2 messages · Shawn Koppenhoefer, Doran, Harold

#
Solution found...

Sorry for not having known this,...

Apparently, what I was after is called a "Choleski factorization".


The solution pops right out of R, as follows:

 > M<-matrix(c(0.6098601,  0.2557882,   0.1857773,
+             0.2557882,  0.5127065,  -0.1384238,
+             0.1857773, -0.1384238,   0.9351089 ),
+       nrow=3, ncol=3, byrow=TRUE)
 > chol(M)
           [,1]      [,2]       [,3]
[1,] 0.7809354 0.3275408  0.2378907
[2,] 0.0000000 0.6367288 -0.3397722
[3,] 0.0000000 0.0000000  0.8735398
 >



Thanks again for all your help!


/shawn
1 day later
#
Correct. In the example I gave you yesterday, I used a different matrix, but showed this solution because it also answered the other question you had about doing it on non-square matrices. Of course, Spencer Graves also gave a very useful answer suggesting QR decomposition. 

I also gave you the example in the context of linear regression because that is commonly why statisticians will use these factorizations. 

If your matrix is small, chol() works fine. If your matrix is big and sparse, see Cholesky() in the matrix package (a package that I often refer to as a God-send)