# rmultiunit generates multivariate draws constrained to
# the unit interval, with known mean, standard deviation,
# and (optionally) covariance/correlation structure
rmultiunit(n = 10, mean = c(0.25, 0.5, 0.75), sd = c(0.1, 0.4, 0.25))
# add in a correlation structure
omega_set <- cbind(
c(1, 0.25, 0.01),
c(0.25, 1, 0.5),
c(0.01, 0.5, 1)
)
rmultiunit(
n = 10,
mean = c(0.25, 0.5, 0.75),
sd = c(0.1, 0.4, 0.25),
Omega = omega_set
)
Run the code above in your browser using DataLab