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:sum(M))
Returns a 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!
a positive integer specifying the number of mixture components.
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
.
the number of time series in the system.
a length d^2
vector containing the vectorized W matrix.
a length d*(M-1)
vector of the form
a vector of length M
giving the new order of the covarince matrices
(relative to the current order)
No argument checks! Does not work with dimension
We consider the following decomposition of positive definite covariannce matrices:
See Muirhead (1982), Theorem A9.9 for more details on the decomposition and the source code for more details on the reparametrization.
Muirhead R.J. 1982. Aspects of Multivariate Statistical Theory, Wiley.
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
Run the code above in your browser using DataLab