Learn R Programming

bliss (version 1.0.5)

corr_matrix: corr_matrix

Description

Compute an autocorrelation matrix.

Usage

corr_matrix(diagonal, ksi)

Value

a symmetric matrix.

Arguments

diagonal

a numerical vector corresponding to the diagonal.

ksi

a numerical value, related to the correlation.

Examples

Run this code
### 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)

Run the code above in your browser using DataLab