ARMA.autocov: Auto-covariance/auto-correlation function for the stationary...

Description Usage Arguments Examples

View source: R/ARMA.autocov.R

Description

This function computes a vector of output values from the auto-covariance/auto-correlation function for a stationary auto-regressive moving-average (ARMA) model. The user specifies the vector size n and the function returns a vector of auto-covariance/ auto-correlation values at all lags Lag[0], ... , Lag[n-1]. The function requires the model to be stationary, which means that the vector of auto-regression coefficients must give an auto-regressive characteristic polynomial with roots outside the unit circle.

Usage

1
ARMA.autocov(n, ar = numeric(0), ma = numeric(0), corr = FALSE)

Arguments

n

Positive integer giving the number of consecutive values in the time-series (output is a vector of length n)

ar

Vector of auto-regressive coefficients (all roots of AR characteristic polynomial must be outside the unit circle)

ma

Vector of moving-average coefficients

corr

Logical; if TRUE the function returns the auto-correlation function; if FALSE the function returns the auto-covariance function

Examples

1
2
3
4
5
6
data(garma)

AR <- c(0.8, -0.2)
MA <- c(0.6,  0.3)
#Compute the auto-correlation function
ARMA.autocov(n = 6, ar = AR, ma = MA, corr = TRUE)

ts.extend documentation built on Nov. 15, 2020, 1:06 a.m.