PhillipsPerron

Incremental, causal technical analysis documentation

Phillips–Perron Z-tau test using a Bartlett long-run variance estimate.

Use n=w−1 observations for the unaugmented DF regression. Let g=RSS/n, s²=RSS/(n−p), λ² the Bartlett long-run variance of residuals, and σ the classical standard error of γ. Zτ = √(g/λ²) tγ − (λ²−g)nσ/(2λs). Reject the unit-root null in the left tail. Specify integer bandwidth b from zero to n−1; zero reduces to DF. Rolling QR and lagged score cross-products yield O(b+1) amortized ingestion and O(1) inference, O(w) storage and O(w(b+1)) periodic reconstruction or cancellation fallback. Compared with arch.unitroot.PhillipsPerron(test_type='tau') for the statistic and statsmodels MacKinnon tau surfaces for inference.

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.PhillipsPerron(window=64, bandwidth=4)
for i in range(64):
    value = rng.gauss(0, 1)
    result = model.update(value)
print(result.statistic)

Reference

Phillips and Perron (1988), Testing for a unit root in time series regression. Newey and West (1987).