triDec | R Documentation |
Decomposes a symmetric positive definite matrix with a variant of the Cholesky decomposition.
triDec(Sigma)
Sigma |
a symmetric positive definite matrix. |
Any symmetric positive definite matrix \Sigma
can be decomposed as
\Sigma = B \Delta B^T
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 \Sigma^{-1} = A^T \Delta^{-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, \dots, d
.
The elements on the diagonal of \Delta
are the partial variances.
A |
a square upper triangular matrix of the same order as
|
B |
the inverse of |
Delta |
a vector containing the diagonal values of |
Giovanni M. Marchetti
Cox, D. R. & Wermuth, N. (1996). Multivariate dependencies. London: Chapman & Hall.
chol
## 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)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.