rmvnorm {RprobitB} | R Documentation |
Draw from multivariate normal distribution
Description
This function draws from a multivariate normal distribution.
Usage
rmvnorm(mu, Sigma)
Arguments
mu |
The mean vector of length |
Sigma |
The covariance matrix of dimension |
Details
The function builds upon the following fact: If \epsilon = (\epsilon_1,\dots,\epsilon_n)
,
where each \epsilon_i
is drawn independently from a standard normal distribution,
then \mu+L\epsilon
is a draw from the multivariate normal distribution
N(\mu,\Sigma)
, where L
is the lower triangular factor of the
Choleski decomposition of \Sigma
.
Value
A numeric vector of length n
.
Examples
mu <- c(0,0)
Sigma <- diag(2)
rmvnorm(mu = mu, Sigma = Sigma)
[Package RprobitB version 1.1.4 Index]