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

Description Usage Arguments Value Author(s) References Examples

Description

Generate a random correlation matrix based on random partial correlations.

Usage

1
  rcorrmatrix(d,alphad=1)

Arguments

d

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

alphad

α parameter for partial of 1,d given 2,…,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 [email protected]
Harry Joe [email protected]

References

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

Examples

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

Example output

Loading required package: MASS
           [,1]       [,2]       [,3]
[1,]  1.0000000 -0.7259991  0.7813495
[2,] -0.7259991  1.0000000 -0.3427959
[3,]  0.7813495 -0.3427959  1.0000000
           [,1]       [,2]       [,3]       [,4]       [,5]
[1,]  1.0000000 -0.7694079 -0.0979106  0.3622889  0.3226552
[2,] -0.7694079  1.0000000 -0.2275129  0.2592960 -0.6295379
[3,] -0.0979106 -0.2275129  1.0000000 -0.6014483  0.3851946
[4,]  0.3622889  0.2592960 -0.6014483  1.0000000 -0.3419719
[5,]  0.3226552 -0.6295379  0.3851946 -0.3419719  1.0000000
           [,1]        [,2]        [,3]        [,4]        [,5]
[1,]  1.0000000 -0.29502492 -0.42937474 -0.46924940 -0.27508214
[2,] -0.2950249  1.00000000 -0.04574242 -0.00810043  0.13924974
[3,] -0.4293747 -0.04574242  1.00000000 -0.11005353  0.24428541
[4,] -0.4692494 -0.00810043 -0.11005353  1.00000000 -0.08086215
[5,] -0.2750821  0.13924974  0.24428541 -0.08086215  1.00000000

clusterGeneration documentation built on May 2, 2019, 6:53 a.m.