Learn R Programming

MultiRNG (version 1.2.4)

draw.d.variate.uniform: Pseudo-Random Number Generation under Multivariate Uniform Distribution

Description

This function implements pseudo-random number generation for a multivariate uniform distribution with specified mean vector and covariance matrix.

Usage

draw.d.variate.uniform(no.row,d,cov.mat)

Arguments

no.row

Number of rows to generate.

d

Number of variables to generate.

cov.mat

Variance-covariance matrix.

Value

A \(no.row \times d\) matrix of generated data.

References

Falk, M. (1999). A simple approach to the generation of uniformly distributed random variables with prescribed correlations. Communications in Statistics, Simulation and Computation, 28(3), 785-791.

Examples

Run this code
# NOT RUN {
cmat<-matrix(c(1,0.2,0.3,0.2,1,0.2,0.3,0.2,1), nrow=3, ncol=3)
mydata=draw.d.variate.uniform(no.row=1e5,d=3,cov.mat=cmat)
apply(mydata,2,mean)-rep(0.5,3)
cor(mydata)-cmat
# }

Run the code above in your browser using DataLab