cov2theta {epigrowthfit}R Documentation

Compute a Packed Representation of a Covariance Matrix

Description

Transform covariances matrices to a “packed” representation or compute the inverse transformation.

Usage

cov2theta(Sigma)
theta2cov(theta)

Arguments

Sigma

an nn-by-nn real, symmetric positive definite matrix. Only the upper triangle is “seen”.

theta

a numeric vector of length n(n+1)/2n(n+1)/2 whose first nn elements are positive.

Details

An nn-by-nn real, symmetric, positive definite matrix Σ\Sigma can be factorized as

Σ=RR.\Sigma = R' R\,.

The upper triangular Cholesky factor RR can be written as

R=R1D1/2Dσ1/2,R = R_{1} D^{-1/2} D_{\sigma}^{1/2}\,,

where R1R_{1} is a unit upper triangular matrix and D=diag(diag(R1R1))D = \mathrm{diag}(\mathrm{diag}(R_{1}' R_{1})) and Dσ=diag(diag(Σ))D_{\sigma} = \mathrm{diag}(\mathrm{diag}(\Sigma)) are diagonal matrices.

cov2theta takes Σ\Sigma and returns the vector θ\theta of length n(n+1)/2n(n+1)/2 containing the log diagonal entries of DσD_{\sigma} followed by (in column-major order) the strictly upper triangular entries of R1R_{1}. theta2cov computes the inverse transformation.

Value

A vector like theta (cov2theta) or a matrix like Sigma (theta2cov); see ‘Details’.


[Package epigrowthfit version 0.15.3 Index]