redecompose_Omegas: In the decomposition of the covariance matrices (Muirhead,...

View source: R/matcal.R

redecompose_OmegasR Documentation

In the decomposition of the covariance matrices (Muirhead, 1982, Theorem A9.9), change the order of the covariance matrices.

Description

redecompose_Omegas exchanges the order of the covariance matrices in the decomposition of Muirhead (1982, Theorem A9.9) and returns the new decomposition.

Usage

redecompose_Omegas(M, d, W, lambdas, perm = 1:sum(M))

Arguments

M
For GMVAR and StMVAR models:

a positive integer specifying the number of mixture components.

For G-StMVAR models:

a size (2x1) integer vector specifying the number of GMVAR type components M1 in the first element and StMVAR type components M2 in the second element. The total number of mixture components is M=M1+M2.

d

the number of time series in the system.

W

a length d^2 vector containing the vectorized W matrix.

lambdas

a length d*(M-1) vector of the form \lambda_{2},...,\lambda_{M} where \lambda_{m}=(\lambda_{m1},...,\lambda_{md})

perm

a vector of length M giving the new order of the covarince matrices (relative to the current order)

Details

We consider the following decomposition of positive definite covariannce matrices: \Omega_1 = WW', \Omega_m = W\Lambda_{m}W', m=2,..,M where \Lambda_{m} = diag(\lambda_{m1},...,\lambda_{md}) contains the strictly postive eigenvalues of \Omega_m\Omega_1^{-1} and the column of the invertible W are the corresponding eigenvectors. Note that this decomposition does not necessarily exists for M > 2.

See Muirhead (1982), Theorem A9.9 for more details on the decomposition and the source code for more details on the reparametrization.

Value

Returns a d^2 + (M - 1)*d x 1 vector of the form c(vec(new_W), new_lambdas) where the lambdas parameters are in the regimewise order (first regime 2, then 3, etc) and the "new W" and "new lambdas" are constitute the new decomposition with the order of the covariance matrices given by the argument perm. Notice that if the first element of perm is one, the W matrix will be the same and the lambdas are just re-ordered.

Note that unparametrized zero elements ARE present in the returned W!

Warning

No argument checks! Does not work with dimension d=1 or with only one mixture component M=1.

References

  • Muirhead R.J. 1982. Aspects of Multivariate Statistical Theory, Wiley.

Examples

 d <- 2
 M <- 2
 Omega1 <- matrix(c(2, 0.5, 0.5, 2), nrow=d)
 Omega2 <- matrix(c(1, -0.2, -0.2, 1), nrow=d)

 # Decomposition with Omega1 as the first covariance matrix:
 decomp1 <- diag_Omegas(Omega1, Omega2)
 W <- matrix(decomp1[1:d^2], nrow=d, ncol=d)
 lambdas <- decomp1[(d^2 + 1):length(decomp1)]
 tcrossprod(W) # = Omega1
 W%*%tcrossprod(diag(lambdas), W) # = Omega2

 # Reorder the covariance matrices in the decomposition so that now
 # the first covariance matrix is Omega2:
 decomp2 <- redecompose_Omegas(M=M, d=d, W=as.vector(W), lambdas=lambdas,
                               perm=2:1)
 new_W <- matrix(decomp2[1:d^2], nrow=d, ncol=d)
 new_lambdas <- decomp2[(d^2 + 1):length(decomp2)]
 tcrossprod(new_W) # = Omega2
 new_W%*%tcrossprod(diag(new_lambdas), new_W) # = Omega1

saviviro/gmvarkit documentation built on March 8, 2024, 4:15 a.m.