Creates a random Multivariate Normal when given number of obs, mean, and sigma.

rmvnorm(n, mu, S)

Arguments

n

An integer, which gives the number of observations. (> 0)

mu

A vector length m that represents the means of the normals.

S

A matrix with dimensions m x m that provides Sigma, the covariance matrix.

Value

A matrix that is a Multivariate Normal distribution.

Author

James Joseph Balamuta

Examples

# Call with the following data: 
rmvnorm(2, c(0,0), diag(2))
#>            [,1]      [,2]
#> [1,]  1.2956653 -1.392028
#> [2,] -0.3047622 -1.049459