View source: R/Simulate_Data.R
corr_matrix | R Documentation |
Compute an autocorrelation matrix.
corr_matrix(diagonal, ksi)
diagonal |
a numerical vector corresponding to the diagonal. |
ksi |
a numerical value, related to the correlation. |
a symmetric matrix.
### Test 1 : weak autocorrelation
ksi <- 1
diagVar <- abs(rnorm(100,50,5))
Sigma <- corr_matrix(diagVar,ksi^2)
persp(Sigma)
### Test 2 : strong autocorrelation
ksi <- 0.2
diagVar <- abs(rnorm(100,50,5))
Sigma <- corr_matrix(diagVar,ksi^2)
persp(Sigma)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.