BTW,
The same solution can be found using SVD (Singular Value Decomposition)
example,
## Define the matrix that we want to decompose into the product of a
matrix and its transform
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)
## Compute the singular-value decomposition, and construct F from its pieces
SVD=svd(M, nu=3, nv=3)
U=SVD$u
D=diag(SVD$d)
V=SVD$v
U %*% D %*% t(V)
F = U %*% sqrt(diag(SVD$d))
## Test to see of the product of F with its transpose is equal to M
F %*% t(F) #
[,1] [,2] [,3]
[1,] 0.6098601 0.2557882 0.1857773
[2,] 0.2557882 0.5127065 -0.1384238
[3,] 0.1857773 -0.1384238 0.9351089
/Shawn
p.s.
HOWEVER I would still like to find a solution that gives me a diagonal
matrix for F.
For example, I would like this result:,
> F
[,1] [,2] [,3]
[1,] 0.781 0.000 0.000
[2,] 0.328 0.637 0.000
[3,] 0.238 -0.341 0.873
[[alternative HTML version deleted]]
______________________________________________
[email protected] 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.