powered by
rnormCS efficiently generates samples from a multivariate normal distribution with compound symmetry correlation structure (all features equally correlated).
rnormCS
rnormCS(n, p, rho = 0.5, means = 0, variances = 1)
A numeric \(n \times p\) matrix with the specified correlation, means, and variances.
Number of observations.
Number of features.
Common correlation coefficient.
Numeric vector of feature means (length \(1\) or \(p\)).
Numeric vector of feature variances (length \(1\) or \(p\)).
X1 <- rnormCS(10, 5) X2 <- rnormCS(10, 5, rho = 0.3, means = 2, variances = 4) X3 <- rnormCS(10, 5, rho = 0.4, means = 1:5, variances = 3:7)
Run the code above in your browser using DataLab