rmvn: Multivariate normal distribution

Description Usage Arguments Value Author(s) See Also Examples

View source: R/rmvn.R

Description

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

Usage

1
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.

Author(s)

Peter Solymos

See Also

mvrnorm

Examples

1
2
3
4
5
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))))

bSims documentation built on Oct. 7, 2021, 9:13 a.m.