rmvnorm_cpp {oeli} | R Documentation |
This function draws from a multivariate normal distribution.
rmvnorm_cpp(mean, Sigma, log = FALSE)
mean |
A |
Sigma |
A |
log |
A |
The function builds upon the following fact:
If \epsilon = (\epsilon_1,\dots,\epsilon_p)
,
where each \epsilon_i
is drawn independently from a standard normal
distribution, then \mu + L\epsilon
is a draw from the p
-variate
normal distribution N(\mu,\Sigma)
, where L
is the lower
triangular factor of the Choleski decomposition of \Sigma
.
This function performs no input checks. See rmvnorm
for the version with input checks.
A column vector of length p
, the random draw.