bSims (version 0.2-1)

rmvn: Multivariate normal distribution

Description

A shim of mvrnorm to return matrix when n < 2.

Usage

rmvn(n = 1L, mu, Sigma, ...)

Arguments

n

number of random vectors desired (nonnegative integer, can be 0).

mu

mean vector.

Sigma

variance-covariance matrix.

other arguments passed to mvrnorm.

Value

A matrix with n rows and length(mu) columns.

See Also

mvrnorm

Examples

Run this code
# NOT RUN {
rmvn(0, c(a=0, b=0), diag(1, 2, 2))
rmvn(1, c(a=0, b=0), diag(1, 2, 2))
rmvn(2, c(a=0, b=0), diag(1, 2, 2))

sapply(0:10, function(n) dim(rmvn(n, c(a=0, b=0), diag(1, 2, 2))))
# }

Run the code above in your browser using DataLab