AR1: Covariance Matrix with AR(1) Structure

Description Usage Arguments Value Author(s) Examples

View source: R/functions.R

Description

Generate Covariance Matrix with an Autoregression (1) Structrue

Usage

1
AR1(p,rho=0.5)

Arguments

p

the dimension of a covariance matrix.

rho

the default value is 0.5.

Value

a p*p matrix.

Author(s)

Binhuan Wang

Examples

1
2
3
p <- 5;
Sigma <- AR1(p, rho=0.9);
Sigma;

Example output

       [,1]  [,2] [,3]  [,4]   [,5]
[1,] 1.0000 0.900 0.81 0.729 0.6561
[2,] 0.9000 1.000 0.90 0.810 0.7290
[3,] 0.8100 0.900 1.00 0.900 0.8100
[4,] 0.7290 0.810 0.90 1.000 0.9000
[5,] 0.6561 0.729 0.81 0.900 1.0000

CVTuningCov documentation built on May 29, 2017, 9:07 p.m.