triDec: Triangular decomposition of a covariance matrix

Description Usage Arguments Details Value Author(s) References See Also Examples

Description

Decomposes a symmetric positive definite matrix with a variant of the Cholesky decomposition.

Usage

1
triDec(Sigma)

Arguments

Sigma

a symmetric positive definite matrix.

Details

Any symmetric positive definite matrix Sigma can be decomposed as Sigma = B %*% Delta %*% t(B) where B is upper triangular with ones along the main diagonal and Delta is diagonal. If Sigma is a covariance matrix, the concentration matrix is Σ^{-1} = A^T Δ^{-1} A where A = B^{-1} is the matrix of the regression coefficients (with the sign changed) of a system of linear recursive regression equations with independent residuals. In the equations each variable i is regressed on the variables i+1, …, d. The elements on the diagonal of Δ are the partial variances.

Value

A

a square upper triangular matrix of the same order as Sigma with ones on the diagonal.

B

the inverse of A, another triangular matrix with unit diagonal.

Delta

a vector containing the diagonal values of Δ.

Author(s)

Giovanni M. Marchetti

References

Cox, D. R. \& Wermuth, N. (1996). Multivariate dependencies. London: Chapman \& Hall.

See Also

chol

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
## Triangular decomposition of a covariance matrix
B <- matrix(c(1,  -2, 0, 1,
              0,   1, 0, 1,
              0,   0, 1, 0,
              0,   0, 0, 1), 4, 4, byrow=TRUE)
B
D <- diag(c(3, 1, 2, 1))
S <- B %*% D %*% t(B)
triDec(S)
solve(B)

ggm documentation built on March 26, 2020, 7:49 p.m.

Related to triDec in ggm...