rcorr: Random correlation matrix

Description Usage Arguments Details Value Author(s) References See Also Examples

Description

Generates a random correlation matrix with the method of Marsaglia and Olkin (1984).

Usage

1
rcorr(d)

Arguments

d

an integer > 0, the order of the correlation matrix.

Details

The algorithm uses rsphere to generate d vectors on a sphere in d-space. If Z is a matrix with such vectors as rows, then the random correlation matrix is ZZ'.

Value

a correlation matrix of order d.

Author(s)

Giovanni M. Marchetti

References

Marshall, G.\& Olkin, I. (1984).Generating correlation matrices. SIAM J. Sci. Stat. Comput., 5, 2, 470–475.

See Also

rsphere

Examples

1
2
3
4
## A random correlation matrix of order 3
rcorr(3)
## A random correlation matrix of order 5
rcorr(5)

ggm documentation built on March 26, 2020, 7:49 p.m.

Related to rcorr in ggm...