Learn R Programming

dbacf (version 0.2.8)

dbacf_AR1: Robust dbacf in change point regression with AR(1) errors

Description

In the context of change point regression with a stationary AR(1) error process, this function estimates the autoregressive coefficient along with the autocovariance/correlation function as a function of given lags.

Usage

dbacf_AR1(data, type = c("covariance", "correlation"), lags)

Value

An object of class "dbacf" containing:

  • acf numeric vector of length lags + 1 giving estimated (auto)covariance/correlation function

  • rho numeric, estimate of autoregressive coefficient

  • acfType string indicating whether covariance or correlation has been computed

  • n integer giving length(data)

Arguments

data

numeric vector or a univariate object of class ts.

type

character string specifying whether covariance (default) or correlation must be computed.

lags

numeric giving the number of lags to compute.

References

Chakar, S. and Lebarbier, E. and Lévy-Leduc, C. and Robin, S. (2017). A robust approach for estimating change-points in the mean of an AR(1) process, Bernoulli, 23(2), 1408-1447

Examples

Run this code
ar1 <- arima.sim(n = 50, model = list(ar = c(0.5), order = c(1, 0, 0)), 
                 sd = 0.25)
dbacf_AR1(ar1, type="correlation", lags=10)

Run the code above in your browser using DataLab