rmultnorm {MSBVAR} | R Documentation |
Generates multivariate normal random variates for give mean and covariance vectors. Can also handle generation of multivariate normal deviates with singular covariance distributions via singular value decomposition (SVD).
rmultnorm(n, mu, vmat, tol = 1e-10)
n |
Number of variates to draw. |
mu |
m column matrix of multivariate means |
vmat |
m xm covariance matrix |
tol |
Tolerance level used for SVD of the covariance. Default is 1e-10 |
Generates n draws from a multivariate normal distribution with mean
matrix mu
and covariance matrix vmat
.
Matrix of the random draw that is conformable with the input mu
.
Based on code by Jeff Gill. This function is called in the hard
condition forecasting in hc.forecast
for simulating
the structural innovations.
Patrick T. Brandt
rmultnorm(1, matrix(c(1,2),2,1), vmat=matrix(c(1,1,0,1),2,2))