corr_matrix: corr_matrix

View source: R/Simulate_Data.R

corr_matrixR Documentation

corr_matrix

Description

Compute an autocorrelation matrix.

Usage

corr_matrix(diagonal, ksi)

Arguments

diagonal

a numerical vector corresponding to the diagonal.

ksi

a numerical value, related to the correlation.

Value

a symmetric matrix.

Examples

### 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)

bliss documentation built on May 29, 2024, 8:35 a.m.