Kernel Long-Run Variance Estimation (HAC)
The long-run variance of a series is the variance that governs averages of serially correlated data; it equals the variance plus twice the sum of all autocovariances. Kernel estimators weight the sample autocovariances with a kernel such as Bartlett, Parzen or quadratic spectral, with a bandwidth chosen by the Andrews or Newey-West rules, optionally after prewhitening. The result gives a standard error of the mean that remains valid under autocorrelation.
계열의 장기분산은 계열상관이 있는 자료의 평균을 지배하는 분산으로, 분산에 모든 자기공분산 합의 두 배를 더한 값입니다. 커널 추정량은 바틀렛, 파르젠, 이차 스펙트럼 같은 커널로 표본 자기공분산에 가중치를 주며, 대역폭은 앤드루스 규칙이나 뉴이-웨스트 규칙으로 정하고 필요하면 사전 백색화를 합니다. 그 결과 자기상관이 있어도 타당한 평균의 표준오차를 얻습니다.
How uncertain is the mean of an autocorrelated series, and how much larger is its long-run variance than its ordinary variance?
자기상관이 있는 계열의 평균은 얼마나 불확실하며, 장기분산은 보통 분산보다 얼마나 큽니까?
The method returns the long-run variance, the bandwidth and how it was chosen, the ratio to the ordinary variance, the HAC standard error and 95% interval of the mean, and the estimates under all five kernels for comparison.
When to use Kernel Long-Run Variance Estimation (HAC)
- You need a standard error of a mean or average from serially correlated data.
- You build test statistics that need a long-run variance, such as in forecast comparisons.
- You want to compare kernels and bandwidth rules.
When to use something else
- You need HAC standard errors for regression coefficients: use Regression with Robust Standard Errors
- Data are spatially correlated: use Conley Spatial HAC Standard Errors
- The series has a unit root, test for a unit root first: use Augmented Dickey-Fuller Test
Assumptions and requirements
- Covariance stationary series with short memory
- Bandwidth grows slowly relative to the series length
What the analysis reports
- Long-run variance and bandwidth
- Ratio to the short-run variance
- HAC standard error and interval for the mean
- Comparison across kernels
How to report it
The quadratic spectral kernel long-run variance (bandwidth [value], n = [value]) was [value], [value] times the ordinary variance; the HAC standard error of the mean was [value].
Related methods
- Autocorrelation Analysis (ACF, PACF, Ljung-Box)
- Conley Spatial HAC Standard Errors
- Spectral Analysis (Periodogram)
- Regression with Robust Standard Errors
How this method is validated
이 방법의 검증 근거
- Independent computation. 1 reference test compares the results with arch, statsmodels and direct computations (formulas, enumeration or simulation) at a stated tolerance of 1e-10.
독립 계산. arch·statsmodels·직접 계산(식·열거·모의실험) 대조 참조 시험 1건 통과(허용오차 1e-10).
Tolerances are relative differences (absolute differences for values near zero). R comparisons and reference tests are re-run before each release of the analysis engine.
허용오차는 상대 차이입니다(0 근처 값은 절대 차이). R 대조와 참조 시험은 분석 엔진을 배포할 때마다 다시 돌립니다.
Run Kernel Long-Run Variance Estimation (HAC) on Quorant
- Data you need
- a table (CSV or Excel) with an outcome variable
- Price
- 250 credits for one analysis up to 10,000 rows (complexity level 2); larger or wider data costs more. Optional methodologist review: 1200 credits.
- Checking
- Compared with independent computations
- Before you pay
- A free pre-analysis diagnosis checks your data and gives an exact quote; nothing is deducted until you approve it.