Description Usage Arguments Details Value
Simulate multiple iid correlated uniform random variates.
1 | runif_corr(n, corr, min = -1, max = 1)
|
n |
Number of random variates to generate. |
corr |
Correlation between the random variates. Must be a p x p diagonal matrix, with 1 on the diagonal. |
min |
lower limit of the distribution |
max |
upper limit of the distribution |
First, with a given correlation matrix corr, we simulate
(X_i1, ..., X_ip) ~ MVN(0, corr)
for i = 1, 2, ... n. Then, we obtain
(U_i1, ..., U_ip) = (F(X_i1), ..., F_(X_ip)),
where F is the standard normal PDF (note marginally, X_i1 ~ N(0, 1) since corr is assumed to have 1 on the diagonals). Then, the U will marginally be uniformly distributed on (0, 1), with some correlation. Finally, we transform U_ij using (max - min) * U_ij + min to get a random variable uniformly distributed on (min, max).
n x p matrix of correlated uniform random variates, where each row is iid.
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.