diag_Omegas {gmvarkit} | R Documentation |
Simultaneously diagonalize two covariance matrices
Description
diag_Omegas
Simultaneously diagonalizes two covariance matrices using
eigenvalue decomposition.
Usage
diag_Omegas(Omega1, Omega2)
Arguments
Omega1 |
a positive definite |
Omega2 |
another positive definite |
Details
See the return value and Muirhead (1982), Theorem A9.9 for details.
Value
Returns a length vector where the first
elements
are
with the columns of
being (specific) eigenvectors of
the matrix
and the rest
elements are the
corresponding eigenvalues "lambdas". The result satisfies
and
.
If Omega2
is not supplied, returns a vectorized symmetric (and pos. def.)
square root matrix of Omega1
.
Warning
No argument checks! Does not work with dimension !
References
Muirhead R.J. 1982. Aspects of Multivariate Statistical Theory, Wiley.
Examples
d <- 2
W0 <- matrix(1:(d^2), nrow=2)
lambdas0 <- 1:d
(Omg1 <- W0%*%t(W0))
(Omg2 <- W0%*%diag(lambdas0)%*%t(W0))
res <- diag_Omegas(Omg1, Omg2)
W <- matrix(res[1:(d^2)], nrow=d, byrow=FALSE)
tcrossprod(W) # == Omg1
lambdas <- res[(d^2 + 1):(d^2 + d)]
W%*%diag(lambdas)%*%t(W) # == Omg2
[Package gmvarkit version 2.1.2 Index]