rcorrmatrix: GENERATE A RANDOM CORRELATION MATRIX BASED ON RANDOM PARTIAL...

View source: R/hjrancor.R

rcorrmatrixR Documentation

GENERATE A RANDOM CORRELATION MATRIX BASED ON RANDOM PARTIAL CORRELATIONS

Description

Generate a random correlation matrix based on random partial correlations.

Usage

  rcorrmatrix(d, alphad = 1)

Arguments

d

Dimension of the matrix. d should be a non-negative integer.

alphad

\alpha parameter for partial of 1,d given 2,\ldots,d-1, for generating random correlation matrix based on the method proposed by Joe (2006), where d is the dimension of the correlation matrix. The default value alphad=1 leads to a random matrix which is uniform over space of positive definite correlation matrices. Each correlation has a Beta(a,a) distribution on (-1,1) where a=alphad+(d-2)/2. alphad should be a positive number.

Value

A correlation matrix.

Author(s)

Weiliang Qiu weiliang.qiu@gmail.com
Harry Joe harry@stat.ubc.ca

References

Joe, H. (2006) Generating Random Correlation Matrices Based on Partial Correlations. Journal of Multivariate Analysis, 97, 2177–2189.

Examples

rcorrmatrix(3)
rcorrmatrix(5)
rcorrmatrix(5, alphad = 2.5)

clusterGeneration documentation built on Aug. 16, 2023, 9:07 a.m.