In the decomposition of the covariance matrices (Muirhead, 1982, Theorem A9.9), change the ordering of the covariance matrices.
In the decomposition of the covariance matrices (Muirhead, 1982, Theorem A9.9), change the ordering of the covariance matrices.
redecompose_Omegas exchanges the order of the covariance matrices in the decomposition of Muirhead (1982, Theorem A9.9) and returns the new decomposition.
redecompose_Omegas(M, d, W, lambdas, perm =1:M)
Arguments
M: the number of regimes in the model
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} =(λm1,...,λmd)
perm: a vector of length M giving the new order of the covariance matrices (relative to the current order)
Returns
Returns a d2+(M−1)d×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!
Details
We consider the following decomposition of positive definite covariannce matrices: Ω1=WW′, Ωm=WΛmW′, m=2,..,M where Λm=diag(λm1,...,λmd) contains the strictly postive eigenvalues of ΩmΩ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.
Warning
No argument checks! Does not work with dimension d=1 or with only one mixture component M=1.
Examples
# Create two (2x2) coviance matrices:d <-2# The dimensionM <-2# The number of covariance matricesOmega1 <- matrix(c(2,0.5,0.5,2), nrow=d)Omega2 <- matrix(c(1,-0.2,-0.2,1), nrow=d)# The decomposition with Omega1 as the first covariance matrix:decomp1 <- diag_Omegas(Omega1, Omega2)W <- matrix(decomp1[1:d^2], nrow=d, ncol=d)# Recover Wlambdas <- decomp1[(d^2+1):length(decomp1)]# Recover lambdastcrossprod(W)# = Omega1W%*%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)# Recover Wnew_lambdas <- decomp2[(d^2+1):length(decomp2)]# Recover lambdastcrossprod(new_W)# = Omega2new_W%*%tcrossprod(diag(new_lambdas), new_W)# = Omega1
References
Muirhead R.J. 1982. Aspects of Multivariate Statistical Theory, Wiley.