randcorr

This function implements the algorithm by Pourahmadi and Wang for generating a random p x p correlation matrix.

Vous suivez désormais cette soumission

This function implements the algorithm by Pourahmadi and Wang [1] 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 form a particular distribution and then convert to the standard correlation matrix form. The angles are sampled from a distribution with probability density function sin^k(theta) (0 < theta < pi, k >= 1) using the efficient sampling algorithm described in [2].

References:
[1] Mohsen Pourahmadi and Xiao Wang, Distribution of random correlation matrices: Hyperspherical parameterization of the Cholesky factor, Statistics & Probability Letters, Volume 106, November 2015, Pages 5-12

[2] Enes Makalic and Daniel F. Schmidt, An efficient algorithm for sampling from $\sin^k(x)$ for generating random correlation matrices, arxiv, 2018

Citation pour cette source

Statovic (2026). randcorr (https://fr.mathworks.com/matlabcentral/fileexchange/68810-randcorr), MATLAB Central File Exchange. Extrait(e) le .

Catégories

En savoir plus sur Genomics and Next Generation Sequencing dans Help Center et MATLAB Answers

Add the first tag.

Informations générales

Compatibilité avec les versions de MATLAB

  • Compatible avec toutes les versions

Plateformes compatibles

  • Windows
  • macOS
  • Linux
Version Publié le Notes de version Action
1.1.1

-added code to ensure that all diagonal entries are set to 1

1.1.0

-Code is now vectorised and is approximately 10x faster than the previous (non-vectorised) version.

1.0.0