Description Usage Arguments Details Value See Also Examples
View source: R/multivariatenormal.R
Function to generate draws from a multivariate Normal distribution, given Cholesky factor of the covariance.
1 | rmvnorm_cholesky(n, mean, cholesky)
|
n |
is the number of desired samples |
mean |
is the mean vector |
cholesky |
is the cholesky factor of the covariance matrix, obtained e.g. with |
This function does not check anything (i.e. that the given covariance is PSD). Thus it is faster than functions in standard packages, but more risky.
a n x d matrix where d is both the length of mean
and the dimension of cholesky
. Each row contains a draw from
the desired multivariate Normal.
rmvnorm
, dmvnorm
, dmvnorm_cholesky_inverse
1 | rmvnorm_cholesky(10, rep(0, 5), chol(diag(1, 5, 5)))
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.