Class RegimeDetector.RegimeModel

java.lang.Object
com.quantfinlib.ml.RegimeDetector.RegimeModel
Enclosing class:
RegimeDetector

public static final class RegimeDetector.RegimeModel extends Object
  • Constructor Details

    • RegimeModel

      public RegimeModel(double[] means, double[] stdDevs, double[][] transition, double logLikelihood, double[] smoothedHighVolProbability, double[] filteredHighVolProbability, double[] currentProbabilities, int currentRegime)
      Creates the value; array and collection arguments are copied.
      Parameters:
      means - per-state mean return
      stdDevs - per-state volatility (state 1 = high vol)
      transition - transition[i][j] = P(next=j | now=i)
      smoothedHighVolProbability - P(high vol at t | all data): ex post only
      filteredHighVolProbability - P(high vol at t | data up to t): causal
      currentProbabilities - filtered P(state | data up to T)
  • Method Details

    • means

      public double means(int i)
      Element i of means (per-state mean return).
    • meansLength

      public int meansLength()
      Length of means.
    • meansCopy

      public double[] meansCopy()
      A fresh copy of means.
    • stdDevs

      public double stdDevs(int i)
      Element i of stdDevs (per-state volatility (state 1 = high vol)).
    • stdDevsLength

      public int stdDevsLength()
      Length of stdDevs.
    • stdDevsCopy

      public double[] stdDevsCopy()
      A fresh copy of stdDevs.
    • transition

      public double transition(int i, int j)
      Element [i][j] of transition (transition[i][j] = P(next=j | now=i)).
    • transitionRows

      public int transitionRows()
      Number of rows of transition.
    • transitionCopy

      public double[][] transitionCopy()
      A deep copy of transition.
    • logLikelihood

      public double logLikelihood()
      logLikelihood.
    • smoothedHighVolProbability

      public double smoothedHighVolProbability(int i)
      Element i of smoothedHighVolProbability (P(high vol at t | all data): ex post only).
    • smoothedHighVolProbabilityLength

      public int smoothedHighVolProbabilityLength()
      Length of smoothedHighVolProbability.
    • smoothedHighVolProbabilityCopy

      public double[] smoothedHighVolProbabilityCopy()
      A fresh copy of smoothedHighVolProbability.
    • filteredHighVolProbability

      public double filteredHighVolProbability(int i)
      Element i of filteredHighVolProbability (P(high vol at t | data up to t): causal).
    • filteredHighVolProbabilityLength

      public int filteredHighVolProbabilityLength()
      Length of filteredHighVolProbability.
    • filteredHighVolProbabilityCopy

      public double[] filteredHighVolProbabilityCopy()
      A fresh copy of filteredHighVolProbability.
    • currentProbabilities

      public double currentProbabilities(int i)
      Element i of currentProbabilities (filtered P(state | data up to T)).
    • currentProbabilitiesLength

      public int currentProbabilitiesLength()
      Length of currentProbabilities.
    • currentProbabilitiesCopy

      public double[] currentProbabilitiesCopy()
      A fresh copy of currentProbabilities.
    • currentRegime

      public int currentRegime()
      currentRegime.
    • expectedDuration

      public double expectedDuration(int state)
      Expected persistence of a regime in periods: 1 / (1 - p_stay).
    • 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