build.cov {simer} | R Documentation |
Correlation building
Description
To bulid correlation of variables.
Usage
build.cov(df = NULL, mu = rep(0, nrow(Sigma)), Sigma = diag(2), tol = 1e-06)
Arguments
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. |
Details
Build date: Oct 10, 2019 Last update: Apr 28, 2022
Value
a data frame with expected correlation
Author(s)
Dong Yin and R
References
B. D. Ripley (1987) Stochastic Simulation. Wiley. Page 98
Examples
df <- data.frame(tr1 = rnorm(100), tr2 = rnorm(100))
df.cov <- build.cov(df)
var(df.cov)
[Package simer version 0.9.0.4 Index]