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.

Usage

standard_est(
  X,
  pd = TRUE,
  maxLag = length(X) - 1,
  type = "autocovariance",
  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.

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 vector whose values are the autocovariance estimates.

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 Sept. 10, 2025, 10:39 a.m.