Samples the lower triangular Cholesky factor of a Wishart random matrix.
rwishart_chol(n, nu, Sigma, epsilon = 0)
sample size, a positive integer
degrees of freedom, a number strictly greater than
scale matrix, a positive definite real matrix
a number involved in the algorithm only if it positive; its role is to guarantee the invertibility of the sampled matrices; see Details
epsilon is a threshold whose role is to guarantee
that the algorithm samples invertible matrices.
The matrices sampled by the algorithm are theoretically invertible.
However, because of numerical precision, they are not always invertible when
nu is close to
p-1, i.e. when
nu-p+1 is small. In this case,
the simulations of chi-squared distributions involved in the algorithm can
generate zero values or values close to zero, yielding the non-invertibility
of the sampled matrices. These values are replaced with
epsilon if they are
A numeric three-dimensional array; simulations are stacked along the third dimension (see example).
1 2 3 4 5 6
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.