sigma2 {robcp}R Documentation

Autocorrelation

Description

Estimates the long run variance respectively covariance matrix of the supplied time series.

Usage

sigma2(x, b_n)

Arguments

x

vector or matrix with each column representing a time series (numeric).

b_n

Must be greater than 0. default is n^{1/3} with n being the number of observations.

Details

The long run variance equals n times the asymptotic variance of the arithmetic mean of a short range dependent time series, where n is the length of the time series. It is used to standardize CUSUM Tests.

The long run variance is estimated by a kernel estimator using the bandwidth b_n = n^{1/3} and the flat top kernel

k(x) = x * 1_{|x| < 0.5} + (2 - |x|) * 1_{0.5 < |x| < 1}

. In the one dimensional case this results in:

\hat{σ}^2 = (1 / n) ∑_{i = 1}^n (x[i] - mean(x))^2 + (2 / n) ∑_{h = 1}^{b_n} ∑_{i = 1}^{n - h} (x[i] - mean(x)) * (x[i + h] - mean(x)) * k(h / b_n).

If x is a multivariate timeseries the k,l-element of Σ is estimated by

\hat{Σ}^{(k,l)} = (1 / n) ∑_{i,j = 1}^{n}(x[i]^{(k)} - mean(x)^{(k)}) * (x[j]^{(l)} - mean(x)^{(l)}) * k((i-j) / b_n).

Value

long run variance sigma^2 respectively Σ (numeric)

Author(s)

Sheila Görz

See Also

psi, h_cumsum, teststat, pKSdist, huber_cusum

Examples

Z <- c(rnorm(20), rnorm(20, 2))
sigma2(Z)

[Package robcp version 0.2.4 Index]