sigma2 {robcp} | R Documentation |
Estimates the long run variance respectively covariance matrix of the supplied time series.
sigma2(x, b_n)
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. |
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).
long run variance sigma^2 respectively Σ (numeric)
Sheila Görz
psi
,
h_cumsum
, teststat
, pKSdist
,
huber_cusum
Z <- c(rnorm(20), rnorm(20, 2)) sigma2(Z)