Become an expert in R — Interactive courses, Cheat Sheets, certificates and more!
Get Started for Free

rqmvnorm

Random sample from the multivariate normal distribution


Description

Draw a quasi or pseudo random sample from the MVN distribution. For details on the implemented lattice rule for quasi-random numbers see Cools et al. (2006).

Usage

rqmvnorm(n, mean = rep(0, nrow(sigma)), sigma = diag(length(mean)),
  type = c("quasirandom", "pseudorandom"))

Arguments

n

Number of samples, when type = "quasirandom" is used this number is rounded up to the next power of 2 (e.g. 1000 to 1024=2^10) and at least 1024.

mean

Mean vector

sigma

Covariance matrix

type

What type of random numbers to use. quasirandom uses a randomized Lattice rule, and should be more efficient than pseudorandom that uses ordinary (pseudo) random numbers.

Value

Matrix of simulated values

Author(s)

We thank Dr. Frances Kuo for the permission to use the generating vectors (order 2 lattice rule) obtained from her website http://web.maths.unsw.edu.au/~fkuo/lattice/.

References

Cools, R., Kuo, F. Y., and Nuyens, D. (2006) Constructing embedded lattice rules for multivariate integration. SIAM Journal of Scientific Computing, 28, 2162-2188.

Examples

sims <- rqmvnorm(100, mean = 1:2, sigma = diag(2))
plot(sims)

gMCP

Graph Based Multiple Comparison Procedures

v0.8-15
GPL (>= 2)
Authors
Kornelius Rohmeyer [aut, cre], Florian Klinglmueller [aut]
Initial release

We don't support your browser anymore

Please choose more modern alternatives, such as Google Chrome or Mozilla Firefox.