genW: Generate correlated variables

Description Usage Arguments Value Examples

View source: R/utils.R

Description

genW generates different sets of centered normal distribution tables with specified correlations.

Usage

1
genW(correl, s = 1000, p = 50)

Arguments

correl

Matrix. Correlation matrix for the inputs.

s

Numeric. Number of simulation. Default to 1000.

p

Number of periods. Default to 50.

Value

An array of dimension s * p * dim(correl) corresponding to the simulations.

Examples

1
2
correl <- cbind(c(1,-0.9, 0.25, 0.25),c(-0.9,1, 0, 0), c(0.25, 0, 1, 0.25), c(0.25, 0, 0.25, 1))
varCor <- genW(correl, 1000, 50)

ArnaudBu/esg2 documentation built on Oct. 20, 2021, 10:01 a.m.