RandomCorm: Generate a valid correlation matrix

Description Usage Arguments Value Examples

View source: R/combined.R

Description

Generates a valid correlation matrix of desired size. Repeatedly augments until desired size is met. Currently implimented in both R and C++. The C++ version is faster while the R version is easier for the expected user base to read and modify as needed.

Usage

1
2
  RandomCorm(nvars, buff = sqrt(.Machine$double.eps))
  RandomCormCPP(nvars, buff = sqrt(.Machine$double.eps))

Arguments

nvars

numeric size of desired correlation matrix

buff

numeric. A buffer to avoid numeric positive non-definiteness.

Value

A valid nvars by nvars correlation matrix.

Examples

1
2

christophercschwarz/DOPE documentation built on April 10, 2020, 4:43 a.m.