ar1_cov: Covariance matrix for a stationary Gaussian AR(1) process.

Description Usage Arguments Value Examples

Description

Creates the covariance matrix of an AR(1) process with parameters rho and sigma, observed at the time points in the vector times. The process is assumed to be in stationarity and to have Gaussian errors. If times is a vector of length 1, and its value is a positive integer n, then the covariance matrix for n consecutive time points is created instead.

Usage

1
ar1_cov(times, rho, sigma)

Arguments

times

An vector of positive integers, preferably ordered.

rho

A real number strictly less than 1 in absolute value.

sigma

A positive real number.

Value

A square matrix with length(times) rows if times has more than 1 element. Otherwise, a matrix with length(times[1]) elements.

Examples

1
2
3
4
times <- c(1, 4:5, 7)
rho <- 0.5
sigma <- 1
ar1_cov(times, rho, sigma)

BenjaK/irregulAR1 documentation built on May 30, 2019, 3:51 p.m.