Skip to contents

Create auto-correlation matrix

Usage

autocorr.mat(p, rho)

Arguments

p

dimension of matrix

rho

autocorrelation value

Value

auto-matrix of size p with parameter rho

Examples

# Create 4x4 matrix with correlation between adjacent enties is 0.9
autocorr.mat(4, .9)
#>       [,1] [,2] [,3]  [,4]
#> [1,] 1.000 0.90 0.81 0.729
#> [2,] 0.900 1.00 0.90 0.810
#> [3,] 0.810 0.90 1.00 0.900
#> [4,] 0.729 0.81 0.90 1.000