Class PairsHedger

java.lang.Object
com.quantfinlib.hedging.PairsHedger

public final class PairsHedger extends Object
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.
  • Method Details

    • analyze

      public static PairsHedger.PairsAnalysis analyze(double[] pricesA, double[] pricesB)
    • 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).