[R] chol2inv question
Peter Dalgaard BSA
p.dalgaard at biostat.ku.dk
Tue Mar 21 14:14:23 CET 2000
"cwu" <cwu at fcu.edu.tw> writes:
> Hi there,
>
> Please help me this out.
>
> > m
> [,1] [,2]
> [1,] 1.1 1.0
> [2,] 1.0 1.1
> > chol2inv(m)
> [,1] [,2]
> [1,] 1.5094597 -0.7513148
> [2,] -0.7513148 0.8264463
What's the trouble? Are you aware that me is expected to contain a
Choleski factor in the upper triangle?
> m
[,1] [,2]
[1,] 1.1 1.0
[2,] 0.0 1.1
> t(m)%*%m
[,1] [,2]
[1,] 1.21 1.10
[2,] 1.10 2.21
> chol(t(m)%*%m)
[,1] [,2]
[1,] 1.1 1.0
[2,] 0.0 1.1
> solve(t(m)%*%m)
[,1] [,2]
[1,] 1.5094597 -0.7513148
[2,] -0.7513148 0.8264463
--
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
-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-
r-help mailing list -- Read http://www.ci.tuwien.ac.at/~hornik/R/R-FAQ.html
Send "info", "help", or "[un]subscribe"
(in the "body", not the subject !) To: r-help-request at stat.math.ethz.ch
_._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._
More information about the R-help
mailing list