Cholesky | R Documentation |
Constructs a valid variance - covariance matrix by using the Cholesky LDL decomposition.
Cholesky(param = NULL, format = NULL, decompositions = TRUE)
param |
Vector containing the parameters used to construct the variance - covariance matrix. |
format |
Matrix representing the format for the Loading matrix L and Diagonal matrix D. The lower triangular part of the format is used as the format for the Loading matrix L. The diagonal of the format is used as the format for the Diagonal matrix D. Must be a matrix. |
decompositions |
Boolean indicating whether the loading and diagonal matrix of the Cholesky decomposition, and the correlation matrix and standard deviations should be returned. |
format
is used to specify which elements of the loading and diagonal
matrix should be non-zero. The elements of param
are then distributed
along the non-zero elements of the loading and diagonal matrix.
The parameters for the diagonal matrix are transformed using exp(2 * x)
.
A valid variance - covariance matrix.
If decompositions = TRUE
then it returns a list containing:
cov_mat
: The variance - covariance matrix.
loading_matrix
: The loading matrix of the Cholesky decomposition.
diagonal_matrix
: The diagonal matrix of the Cholesky decomposition.
correlation_matrix
: Matrix containing the correlations.
stdev_matrix
: Matrix containing the standard deviations on the diagonal.
Dylan Beijers, dylanbeijers@gmail.com
format <- diag(1, 2, 2) format[2, 1] <- 1 Cholesky(param = c(2, 4, 1), format = format, decompositions = TRUE)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.