AugmentedDickeyFuller

Incremental, causal technical analysis documentation

Fixed-lag augmented Dickey–Fuller unit-root test.

Fit Δyₜ = Dₜ + γyₜ₋₁ + Σⱼ φⱼΔyₜ₋ⱼ + eₜ with L fixed augmenting lags. Return γ/SE(γ) and reject the unit-root null for sufficiently negative values. The raw window supplies exactly w−1−L rows. Choose L before constructing the indicator; there is no automatic IC search. A ring of levels feeds RollingOLS, whose last w−1−L rows stay aligned as the window moves. With k=1+L+deterministic columns, cost is O(k²) amortized ingest, O(k³) inference and O(wk) storage, including O(wk²) periodic QR reconstruction. Compared to statsmodels adfuller with matching regression, maxlag and autolag=None.

The econometric conventions specify input validation, warm-up, reset, result fields, numerical rank and critical-value order.

Python example

import random
import rtta

rng = random.Random(42)
model = rtta.AugmentedDickeyFuller(window=64, lags=2, regression='trend')
for i in range(64):
    value = rng.gauss(0, 1)
    result = model.update(value)
print(result.statistic)

Reference

Dickey and Fuller (1979, 1981). MacKinnon (1994), Approximate asymptotic distribution functions for unit-root and cointegration tests. MacKinnon (2010), Critical Values for Cointegration Tests.