I want to compute B=A^{1/2} such that B*B=A.

For example

 a=matrix(c(1,.2,.2,.2,1,.2,.2,.2,1),ncol=3)

so
> a
     [,1] [,2] [,3]
[1,]  1.0  0.2  0.2
[2,]  0.2  1.0  0.2
[3,]  0.2  0.2  1.0
> a%*%a
     [,1] [,2] [,3]
[1,] 1.08 0.44 0.44
[2,] 0.44 1.08 0.44
[3,] 0.44 0.44 1.08
> b=a%*%a

i have tried to use singular value decomposion

> c=svd(b)

> c$u%*%diag(sqrt(c$d))
           [,1]          [,2]       [,3]
[1,] -0.8082904  2.043868e-18  0.6531973
[2,] -0.8082904 -5.656854e-01 -0.3265986
[3,] -0.8082904  5.656854e-01 -0.3265986

this does not come close to the original a. Can anybody on this forum
enlight me on how to get a which is the square root of b?

        [[alternative HTML version deleted]]

______________________________________________
R-help@stat.math.ethz.ch mailing list
https://stat.ethz.ch/mailman/listinfo/r-help
PLEASE do read the posting guide http://www.R-project.org/posting-guide.html
and provide commented, minimal, self-contained, reproducible code.

Reply via email to