powered by
To bulid correlation of variables.
build.cov(df = NULL, mu = rep(0, nrow(Sigma)), Sigma = diag(2), tol = 1e-06)
a data frame with expected correlation
a data frame needing building correlation.
means of the variables.
covariance matrix of variables.
tolerance (relative to largest variance) for numerical lack of positive-definiteness in Sigma.
Dong Yin and R
Build date: Oct 10, 2019 Last update: Apr 28, 2022
B. D. Ripley (1987) Stochastic Simulation. Wiley. Page 98
df <- data.frame(tr1 = rnorm(100), tr2 = rnorm(100)) df.cov <- build.cov(df) var(df.cov)
Run the code above in your browser using DataLab