Dear R helpers, is there a function or way within R to solve A'A=S for A, where all matrices have p x p order and S is a variance-covariance matrix? Thank you, Ralf Engelhorn
Ralf Engelhorn wrote:> Dear R helpers, > > is there a function or way within R to solve A'A=S for A, where all > matrices have p x p order and S is a variance-covariance matrix? > > Thank you, > Ralf Engelhorn > > ______________________________________________ > R-help at stat.math.ethz.ch mailing list > http://www.stat.math.ethz.ch/mailman/listinfo/r-help >See ?chol. Here's an example: R> S = diag(4) R> S[row(S) < col(S)] + S[row(S) > col(S)] = 0.5 R> S [,1] [,2] [,3] [,4] [1,] 1.0 0.5 0.5 0.5 [2,] 0.5 1.0 0.5 0.5 [3,] 0.5 0.5 1.0 0.5 [4,] 0.5 0.5 0.5 1.0 R> A = chol(S) R> t(A) %*% A [,1] [,2] [,3] [,4] [1,] 1.0 0.5 0.5 0.5 [2,] 0.5 1.0 0.5 0.5 [3,] 0.5 0.5 1.0 0.5 [4,] 0.5 0.5 0.5 1.0 R> Sundar
Use eigen() or any of the principal component analysis functions. If K has eigenvectors and D has eigenvalues, then A'=KD^{1/2} is a orthogonal solution, and A=A'=KD^{1/2}K' is a symmetric solution. On Thursday, Feb 13, 2003, at 10:46 US/Pacific, Ralf Engelhorn wrote:> Dear R helpers, > > is there a function or way within R to solve A'A=S for A, where all > matrices have p x p order and S is a variance-covariance matrix? > > Thank you, > Ralf Engelhorn > > ______________________________________________ > R-help at stat.math.ethz.ch mailing list > http://www.stat.math.ethz.ch/mailman/listinfo/r-help > >==Jan de Leeuw; Professor and Chair, UCLA Department of Statistics; Editor: Journal of Multivariate Analysis, Journal of Statistical Software US mail: 9432 Boelter Hall, Box 951554, Los Angeles, CA 90095-1554 phone (310)-825-9550; fax (310)-206-5658; email: deleeuw at stat.ucla.edu homepage: http://gifi.stat.ucla.edu ------------------------------------------------------------------------ ------------------------- No matter where you go, there you are. --- Buckaroo Banzai http://gifi.stat.ucla.edu/sounds/nomatter.au ------------------------------------------------------------------------ -------------------------