randmvn: Randomly Generate a Multivariate Normal Distribution
Description
Randomly generate a mean vector and covariance matrix describing
a multivariate normal (MVN) distribution, and then sample from it
Usage
randmvn(N, d)
Arguments
N
number of samples to draw
d
dimension of the MVN, i.e., the length of the mean vector
and the number of rows/cols of the covariance matrix
Value
The return value is a list with the following components:
murandomly generated mean vector of length d
Srandomly generated covariance matrix with d
rows and d columns
xif N > 0 then x is an N by dmatrix of N samples from the MVN with mean vector
mu and covariance matrixS; otherwise when
N = 0 this component is not included
Details
The components of the mean vector mu are iid from a
standard normal distribution, and the covariance matrix S is
drawn from an inverse--Wishart distribution with degrees of freedom
d + 2 and mean (centering matrix) diag(d)