build.cov {simer} | R Documentation |
To bulid correlation of variables.
build.cov(df = NULL, mu = rep(0, nrow(Sigma)), Sigma = diag(2), tol = 1e-06)
df |
a data frame needing building correlation. |
mu |
means of the variables. |
Sigma |
covariance matrix of variables. |
tol |
tolerance (relative to largest variance) for numerical lack of positive-definiteness in Sigma. |
Build date: Oct 10, 2019 Last update: Apr 28, 2022
a data frame with expected correlation
Dong Yin and R
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)