standard_est: Computes the Standard Estimator of the Autocovariance...

View source: R/standard_est.R

standard_estR Documentation

Computes the Standard Estimator of the Autocovariance Function.

Description

This function computes the following two estimates of the autocovariance function depending on the parameter pd, see the Details section.

Usage

standard_est(
  X,
  pd = TRUE,
  maxLag = length(X) - 1,
  x = 0:length(X),
  type = c("autocovariance", "autocorrelation"),
  meanX = mean(X)
)

Arguments

X

A vector representing observed values of the time series.

pd

Whether a positive-definite estimate should be used. Defaults to TRUE.

maxLag

An optional parameter that determines the maximum lag to compute the estimated autocovariance function at. Defaults to length(X) - 1.

x

A vector of lag indices. Defaults to the sequence 0:length(X). Must be at least as large as maxLag + 1.

type

Compute either the 'autocovariance' or 'autocorrelation'. Defaults to 'autocovariance'.

meanX

The average value of X. Defaults to mean(X).

Details

For pd = TRUE:

\widehat{C}(h) = \frac{1}{N} \sum_{j=1}^{N-h} ( X(j) - \bar{X} ) ( X(j + h) - \bar{X} ) .

For pd = FALSE:

\widehat{C}(h) = \frac{1}{N - h} \sum_{j=1}^{N-h} ( X(j) - \bar{X} ) ( X(j + h) - \bar{X} ) .

This function will generate autocovariance values for lags h from the set \{0, \dots, \mbox{maxLag}\}.

The positive-definite estimator must be used cautiously when estimating over all lags as the sum of all values of the autocorrelation function equals to -1/2. For the nonpositive-definite estimator a similar constant summation property holds.

Value

A CovEsts S3 object (list) with the following values

acf

A numeric vector containing the autocovariance/autocorrelation estimates.

lags

A numeric vector containing the lag indices used to compute the estimates on.

est_type

The type of estimate, namely 'autocorrelation' or 'autocovariance', this depends on the type parameter.

est_used

The estimator function used, in this case, 'standard_est'.

References

Bilchouris, A. & Olenko, A (2025). On Nonparametric Estimation of Covariogram. Austrian Statistical Society 54(1), 112-137. https://doi.org/10.17713/ajs.v54i1.1975

Examples

X <- c(1, 2, 3)
standard_est(X, pd = FALSE, maxLag = 2, meanX = mean(X))

CovEsts documentation built on April 19, 2026, 5:06 p.m.