corDensity: Generate the marginal density of a correlation from a...

View source: R/corDensity.R

corDensityR Documentation

Generate the marginal density of a correlation from a uniformly sampled R matrix.

Description

Generate the marginal density of a correlation from a uniformly sampled R matrix.

Usage

corDensity(NVar)

Arguments

NVar

(integer) The order of the correlation matrix.

Value

corDensity returns the following objects:

  • r (numeric) A sequence of numbers from -1, to 1 in .001 increments.

  • rDensity (numeric) The density of r.

Author(s)

Niels G. Waller

References

Hürlimann, W. (2012). Positive semi-definite correlation matrices: Recursive algorithmic generation and volume measure. Pure Mathematical Science, 1(3), 137–149.

Joe, H. (2006). Generating random correlation matrices based on partial correlations. Journal of Multivariate Analysis, 97(10), 2177–2189.

Examples


  out <- corDensity(NVar = 5)
  
  plot(out$r, out$rDensity, 
       typ = "l",
       xlab = "r",
       ylab = "Density of r",
       main = "")

fungible documentation built on May 29, 2024, 8:28 a.m.