redecompose_Omegas function

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)=(\lambda_{m1},...,\lambda_{md})

  • perm: a vector of length M giving the new order of the covariance matrices (relative to the current order)

Returns

Returns a d2+(M1)d×1d^2 + (M - 1)d \times 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\Omega_1 = WW', Ωm=WΛmW\Omega_m = W\Lambda_{m}W', m=2,..,Mm=2,..,M where Λm=diag(λm1,...,λmd)\Lambda_{m} = diag(\lambda_{m1},...,\lambda_{md}) contains the strictly postive eigenvalues of ΩmΩ11\Omega_m\Omega_1^{-1} and the column of the invertible WW are the corresponding eigenvectors. Note that this decomposition does not necessarily exists for M>2M > 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=1d=1 or with only one mixture component M=1M=1.

Examples

# Create two (2x2) coviance matrices: d <- 2 # The dimension M <- 2 # The number of covariance matrices Omega1 <- 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 W lambdas <- decomp1[(d^2 + 1):length(decomp1)] # Recover lambdas 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) # Recover W new_lambdas <- decomp2[(d^2 + 1):length(decomp2)] # Recover lambdas tcrossprod(new_W) # = Omega2 new_W%*%tcrossprod(diag(new_lambdas), new_W) # = Omega1

References

  • Muirhead R.J. 1982. Aspects of Multivariate Statistical Theory, Wiley.
  • Maintainer: Savi Virolainen
  • License: GPL-3
  • Last published: 2025-02-27