Class PairsHedger
java.lang.Object
com.quantfinlib.hedging.PairsHedger
Statistical (pairs) hedging: regresses one price series on another to get
the hedge ratio, builds the spread, and characterizes its mean reversion —
z-score for entry/exit signals and half-life (from an AR(1) fit of spread
changes on spread levels) for expected holding time.
-
Nested Class Summary
Nested Classes -
Method Summary
Modifier and TypeMethodDescriptionstatic PairsHedger.PairsAnalysisanalyze(double[] pricesA, double[] pricesB) static doublehalfLife(double[] spread) Mean-reversion half-life in bars from the AR(1)-style regressionΔs(t) = c + λ·s(t-1): half-life = -ln(2)/λ.
-
Method Details
-
analyze
-
halfLife
public static double halfLife(double[] spread) Mean-reversion half-life in bars from the AR(1)-style regressionΔs(t) = c + λ·s(t-1): half-life = -ln(2)/λ. Returns +INF when the spread shows no mean reversion (λ >= 0).
-