[R] How to solve A'A=S for A
Peter Dalgaard BSA
p.dalgaard at biostat.ku.dk
Tue Feb 18 23:52:10 CET 2003
Spencer Graves <spencer.graves at pdf.com> writes:
> I think it's interesting that solve(chol(W)) is not the same as
> chol(solve(W)), but I'll let someone else comment on that.
That's basically because inv(R'R) = inv(R)inv(R') = inv(R)inv(R)'
Notice that the last form is upper tri by lower tri, whereas the
Choleski factorization is the other way around. Actually, this UU'
factorization works just like the Choleski factorization taking the
rows and columns of W in the reverse order so we have
> solve(chol(W))
[,1] [,2] [,3]
[1,] 1 0.0 -2.0
[2,] 0 0.5 -0.5
[3,] 0 0.0 1.0
> zapsmall(chol(solve(W)[3:1,3:1]))[3:1,3:1]
[,1] [,2] [,3]
[1,] 1 0.0 0
[2,] 0 0.5 0
[3,] -2 -0.5 1
which are each others transposes.
--
O__ ---- Peter Dalgaard Blegdamsvej 3
c/ /'_ --- Dept. of Biostatistics 2200 Cph. N
(*) \(*) -- University of Copenhagen Denmark Ph: (+45) 35327918
~~~~~~~~~~ - (p.dalgaard at biostat.ku.dk) FAX: (+45) 35327907
More information about the R-help
mailing list