Crandore Hub

randcorr

Generate a Random p x p Correlation Matrix

Implements the algorithm by Pourahmadi and Wang (2015) <doi:10.1016/j.spl.2015.06.015> for generating a random p x p correlation matrix. Briefly, the idea is to represent the correlation matrix using Cholesky factorization and p(p-1)/2 hyperspherical coordinates (i.e., angles), sample the angles from a particular distribution and then convert to the standard correlation matrix form. The angles are sampled from a distribution with pdf proportional to sin^k(theta) (0 < theta < pi, k >= 1) using the efficient sampling algorithm described in Enes Makalic and Daniel F. Schmidt (2018) <arXiv:1809.05212>.

Versions across snapshots

VersionRepositoryFileSize
1.0 rolling linux/jammy R-4.5 randcorr_1.0.tar.gz 17.0 KiB
1.0 rolling linux/noble R-4.5 randcorr_1.0.tar.gz 16.9 KiB
1.0 rolling source/ R- randcorr_1.0.tar.gz 3.6 KiB
1.0 latest linux/jammy R-4.5 randcorr_1.0.tar.gz 17.0 KiB
1.0 latest linux/noble R-4.5 randcorr_1.0.tar.gz 16.9 KiB
1.0 latest source/ R- randcorr_1.0.tar.gz 3.6 KiB
1.0 2026-04-26 source/ R- randcorr_1.0.tar.gz 3.6 KiB
1.0 2026-04-23 source/ R- randcorr_1.0.tar.gz 3.6 KiB
1.0 2026-04-09 windows/windows R-4.5 randcorr_1.0.zip 20.0 KiB
1.0 2025-04-20 source/ R- randcorr_1.0.tar.gz 3.6 KiB