Class PairsHedger.PairsAnalysis

java.lang.Object
com.quantfinlib.hedging.PairsHedger.PairsAnalysis
Enclosing class:
PairsHedger

public static final class PairsHedger.PairsAnalysis extends Object
  • Constructor Summary

    Constructors
    Constructor
    Description
    PairsAnalysis(double hedgeRatio, double intercept, double correlation, double halfLifeBars, double lastZScore, double[] spread)
    Creates the value; array and collection arguments are copied.
  • Method Summary

    Modifier and Type
    Method
    Description
    double
    correlation (return correlation of the pair).
    boolean
    equals(Object other)
     
    double
    halfLifeBars (mean-reversion half-life (+INF if not mean-reverting)).
    int
     
    double
    hedgeRatio (units of B per unit of A (OLS beta)).
    double
    intercept.
    double
    lastZScore (current spread z-score).
    double
    spread(int i)
    Element i of spread.
    double[]
    A fresh copy of spread.
    int
    Length of spread.
     

    Methods inherited from class Object

    clone, finalize, getClass, notify, notifyAll, wait, wait, wait
  • Constructor Details

    • PairsAnalysis

      public PairsAnalysis(double hedgeRatio, double intercept, double correlation, double halfLifeBars, double lastZScore, double[] spread)
      Creates the value; array and collection arguments are copied.
      Parameters:
      hedgeRatio - units of B per unit of A (OLS beta)
      correlation - return correlation of the pair
      halfLifeBars - mean-reversion half-life (+INF if not mean-reverting)
      lastZScore - current spread z-score
  • Method Details

    • hedgeRatio

      public double hedgeRatio()
      hedgeRatio (units of B per unit of A (OLS beta)).
    • intercept

      public double intercept()
      intercept.
    • correlation

      public double correlation()
      correlation (return correlation of the pair).
    • halfLifeBars

      public double halfLifeBars()
      halfLifeBars (mean-reversion half-life (+INF if not mean-reverting)).
    • lastZScore

      public double lastZScore()
      lastZScore (current spread z-score).
    • spread

      public double spread(int i)
      Element i of spread.
    • spreadLength

      public int spreadLength()
      Length of spread.
    • spreadCopy

      public double[] spreadCopy()
      A fresh copy of spread.
    • equals

      public boolean equals(Object other)
      Overrides:
      equals in class Object
    • hashCode

      public int hashCode()
      Overrides:
      hashCode in class Object
    • toString

      public String toString()
      Overrides:
      toString in class Object