Learn R Programming

MixMatrix (version 0.2.8)

ARgenerate: Generate a unit AR(1) covariance matrix

Description

generate AR(1) correlation matrices

Usage

ARgenerate(n, rho)

Value

Toeplitz \(n \times n\) matrix with 1 on the diagonal and \(rho^k\) on the other diagonals, where \(k\) is distance from the main diagonal. Used internally but it is useful for generating your own random matrices.

Arguments

n

number of columns/rows

rho

correlation parameter

See Also

Examples

Run this code
ARgenerate(6, .9)

Run the code above in your browser using DataLab