generateCov: Generates the square root of the covariance matrix

Description Usage Arguments Value Examples

Description

Generates the square root of the covariance matrix

Usage

1
generateCov(p, type = c("diag", "corrUniform", "corrDecay"), rho = 0.8)

Arguments

p

the number of predictors

type

'diag' (the default) gives the identity matrix, 'corrUniform' gives a matrix with 1 on the diagonal and rho off the diagonal, and 'corrDecay' gives the AR covariance matrix (1 on the diagonal, ρ^|i-j| off the diagonal)

rho

the correlation, ignored for type='diag'

Value

Returns the square root of the covariance

Examples

1
2
3
generateCov(10,'diag')
generateCov(10, 'corrDecay')
generateCov(10, 'corrDecay',.9)

dajmcdon/cplr documentation built on May 14, 2019, 3:29 p.m.