View source: R/matrixparametrizations.R
UpperTriFactor | R Documentation |
This function is an analog to the Cholesky decomposition.
UpperTriFactor(Sigma)
Sigma |
A symmetric positive definite k x k matrix that can be
passed as argument to |
an upper triangular matrix Sigma_x, such that Sigma = Sigma_x %*% t(Sigma_x)
chol
;
the option PCMBase.Transpose.Sigma_x
in PCMOptions
.
# S is a symmetric positive definite matrix M<-matrix(rexp(9),3,3); S <- M %*% t(M) # This should return a zero matrix: UpperTriFactor(S) %*% t(UpperTriFactor(S)) - S # This should return a zero matrix too: t(chol(S)) %*% chol(S) - S # Unless S is diagonal, in the general case, this will return a # non-zero matrix: chol(S) %*% t(chol(S)) - S
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.