unstructured: Generate random correlation matrix

Description Usage Arguments Value Examples

Description

'unstructured' generates a random correlation matrix of dimension T with random entries. To ensure positive definiteness, a matrix of partial correlations with random entries uniform on [-0.9, 0.9] will be generated an the corresponding correlation matrix be calculated from it using a bijective recursive relation between them.

Usage

1
unstructured(dimension)

Arguments

dimension

Dimension T of the correlation matrix.

Value

A correlation matrix of dimension T x T.

Examples

1

Example output

             [,1]         [,2]       [,3]       [,4]        [,5]         [,6]
 [1,]  1.00000000 -0.620989122  0.3289006  0.7393350  0.40260256  0.268405958
 [2,] -0.62098912  1.000000000 -0.0900375 -0.9231988  0.05919254 -0.003953234
 [3,]  0.32890056 -0.090037502  1.0000000  0.1826484  0.61478409 -0.148065654
 [4,]  0.73933497 -0.923198769  0.1826484  1.0000000  0.10292552 -0.107032780
 [5,]  0.40260256  0.059192537  0.6147841  0.1029255  1.00000000 -0.398964610
 [6,]  0.26840596 -0.003953234 -0.1480657 -0.1070328 -0.39896461  1.000000000
 [7,] -0.05381109  0.584459820  0.5229646 -0.5221624  0.52552225  0.042833922
 [8,] -0.20104957  0.531662103 -0.5807965 -0.3954397 -0.16029406  0.118862751
 [9,]  0.21124747 -0.741687692 -0.2499445  0.6154342 -0.31401585  0.034576648
[10,] -0.19295827 -0.248455451  0.2722344  0.0782153  0.04855364 -0.304102044
             [,7]        [,8]        [,9]       [,10]
 [1,] -0.05381109 -0.20104957  0.21124747 -0.19295827
 [2,]  0.58445982  0.53166210 -0.74168769 -0.24845545
 [3,]  0.52296460 -0.58079650 -0.24994452  0.27223444
 [4,] -0.52216239 -0.39543968  0.61543425  0.07821530
 [5,]  0.52552225 -0.16029406 -0.31401585  0.04855364
 [6,]  0.04283392  0.11886275  0.03457665 -0.30410204
 [7,]  1.00000000 -0.03742784 -0.56911413 -0.20138012
 [8,] -0.03742784  1.00000000 -0.35874746 -0.46579020
 [9,] -0.56911413 -0.35874746  1.00000000  0.09205291
[10,] -0.20138012 -0.46579020  0.09205291  1.00000000

corcounts documentation built on May 29, 2017, 6 p.m.