Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How can I find an orthogonal matrix in R?

Tags:

r

I want to find an orthogonal matrix (G) in R such that G'CG=L=diag(l1,l2,...lp) where l1>l2>...>lp>0 are the eigen values of known matrix C. I find a matrix with using code eigen(C)$vectors but the result matrix (L) is not a diagonal one. Is there anyone who can help me? thanks in advance

like image 582
user2227801 Avatar asked Dec 21 '25 10:12

user2227801


1 Answers

Your only restriction on C shown is that all eigenvalues are positive. However, this is equivalent to saying that C is positive definite.

In that case, given e <- eigen(C), we have the following:

Q = e$vectors
l = e$values

Conj(t(Q)) = Q^-1

Q %*% diag(l) %*% Conj(t(Q)) = C

Equivalently:

diag(l) = Conj(t(Q)) %*% C %*% Q

As the eigenvalues in l are stored in decreasing order, you are done.

like image 144
Matthew Lundberg Avatar answered Dec 23 '25 23:12

Matthew Lundberg



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!