Class CointegrationTest
java.lang.Object
com.quantfinlib.hedging.CointegrationTest
Engle-Granger two-step cointegration test: regress one price series on the
other, then run an augmented Dickey-Fuller test (no constant) on the
residual spread. This is the statistical justification
PairsHedger
needs before a pairs trade — a high return correlation is not enough; the
spread must be stationary.
Critical values are the Engle-Granger two-variable, no-trend asymptotics: -3.90 (1%), -3.34 (5%), -3.04 (10%). More negative ADF t-statistics mean stronger evidence of cointegration.
-
Nested Class Summary
Nested Classes -
Field Summary
FieldsModifier and TypeFieldDescriptionstatic final doublestatic final doublestatic final double -
Method Summary
Modifier and TypeMethodDescriptionstatic doubleadfTStatistic(double[] series) Dickey-Fuller t-statistic (no constant, no lags — appropriate for mean-zero regression residuals): regressΔe_t = γ e_{t-1} + u_tand returnt = γ̂ / se(γ̂).engleGranger(double[] pricesA, double[] pricesB) Full Engle-Granger test of prices A against prices B.
-
Field Details
-
CRITICAL_1PCT
public static final double CRITICAL_1PCT- See Also:
-
CRITICAL_5PCT
public static final double CRITICAL_5PCT- See Also:
-
CRITICAL_10PCT
public static final double CRITICAL_10PCT- See Also:
-
-
Method Details
-
engleGranger
Full Engle-Granger test of prices A against prices B. -
adfTStatistic
public static double adfTStatistic(double[] series) Dickey-Fuller t-statistic (no constant, no lags — appropriate for mean-zero regression residuals): regressΔe_t = γ e_{t-1} + u_tand returnt = γ̂ / se(γ̂).
-