cov_AR: Covariance estimation by AR fitting

Description Usage Arguments Value References Examples

View source: R/slm-main.R

Description

Fit an autoregressive model to the process and compute the theoretical autocovariances of the fitted AR process. By default, the order is chosen by using the AIC criterion (model_selec = -1).

Usage

1
cov_AR(epsilon, model_selec = -1, plot = FALSE)

Arguments

epsilon

numeric vector. An univariate process.

model_selec

integer or -1. The order of the method, that is the order of the AR process to be fitted on the residuals. If model_selec = -1, it is chosen automatically by using the AIC criterion.

plot

logical. By default, plot = FALSE. If plot = TRUE, then the ACF and the PACF of the vector epsilon are plotted.

Value

The function returns the vector of the theoretical autocovariances of the AR process fitted on the process epsilon.

model_selec

the order selected.

cov_st

the vector of theoretical autocovariances of the fitted AR process.

References

P.J. Brockwell and R.A. Davis (1991). Time Series: Theory and Methods. Springer Science & Business Media.

E. Caron, J. Dedecker and B. Michel (2019). Linear regression with stationary errors: the R package slm. arXiv preprint arXiv:1906.06583. https://arxiv.org/abs/1906.06583.

Examples

1
2
x = arima.sim(list(ar=c(0.4,0.2)),1000)
cov_AR(x, model_selec = 2, plot = TRUE)

slm documentation built on Aug. 31, 2020, 5:11 p.m.