fill_matrix: Create a correlation matrix, checking for positive definite

Description Usage Arguments Value Examples

View source: R/qlr_functions.R

Description

Create a correlation matrix, checking for positive definite

Usage

1
fill_matrix(size = 6, cors = c("high", "mid", "low"), check.pd = TRUE)

Arguments

size

Number of variables in the variance/covariance matrix

cors

The size of the correlations between variables. Current options include "high", "mid", and "low". Future iterations may include "toeplitz" and maybe other options

check.pd

Should the matrix be checked for a positive definite matrix? Defaults to TRUE. Probably should be FALSE if the number of variables is high.

Value

A randomly-generated correlation matrix

Examples

1
2
fill_matrix(size=5, cors="high")
fill_matrix(size=25, cors="high", check.pd=FALSE)

dustinfife/qlr documentation built on April 28, 2021, 3:23 a.m.