triDec {ggm} | R Documentation |
Triangular decomposition of a covariance matrix
Description
Decomposes a symmetric positive definite matrix with a variant of the Cholesky decomposition.
Usage
triDec(Sigma)
Arguments
Sigma |
a symmetric positive definite matrix. |
Details
Any symmetric positive definite matrix
can be decomposed as
where
is upper triangular with ones
along the main diagonal and
is diagonal. If
is a covariance
matrix, the concentration matrix is
where
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
is regressed on the variables
.
The elements on the diagonal of
are the partial variances.
Value
A |
a square upper triangular matrix of the same order as
|
B |
the inverse of |
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
Examples
## 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)