# Default 3x3 correlation matrix
sim.correlation(3)
# 5x5 matrix concentrated near identity (eta=3)
sim.correlation(5, eta = 3)
# Skewed toward positive correlations (no permutation)
sim.correlation(4, skew = 0.7, permute = FALSE)
# Positive partial correlations (enforced positive definiteness)
R <- sim.correlation(6, positive = TRUE)
min(eigen(R, symmetric = TRUE, only.values = TRUE)$values) # > 1e-8
# High-dimensional case (I=20) with theoretical guarantee
R <- sim.correlation(20, eta = 10) # eta=10 > (20-2)/2=9
min(eigen(R, symmetric = TRUE, only.values = TRUE)$values)
Run the code above in your browser using DataLab