Learn R Programming

s2dverification (version 2.4.0)

FitAutocor: Fits an AR1 Autocorrelation Function Using Dichotomy

Description

This function fits the theoretical autocorrelation function of an AR1 to the first guess of estimated autocorrelation function estacf containing any number of lags. The fitting relies on a dichotomial minimisation of the mean square differences between both autocorrelation functions. It returns the autocorrelation at lag 1 of the fitted AR1 process.

Usage

FitAutocor(estacf, window = c(-1, 1), prec = 0.01)

Arguments

Value

Best estimate of the autocorrelation at lag 1

Examples

Run this code
series <- GenSeries(1000, 0.35, 2, 1)
estacf <- acf(series[951:1000], plot = FALSE)$acf
alpha <-  FitAutocor(estacf, c(-1, 1), 0.01)
print(alpha)

Run the code above in your browser using DataLab