Class RegimeDetector.RegimeModel
java.lang.Object
com.quantfinlib.ml.RegimeDetector.RegimeModel
- Enclosing class:
RegimeDetector
-
Constructor Summary
ConstructorsConstructorDescriptionRegimeModel(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. -
Method Summary
Modifier and TypeMethodDescriptiondoublecurrentProbabilities(int i) ElementiofcurrentProbabilities(filtered P(state | data up to T)).double[]A fresh copy ofcurrentProbabilities.intLength ofcurrentProbabilities.intcurrentRegime.booleandoubleexpectedDuration(int state) Expected persistence of a regime in periods: 1 / (1 - p_stay).doublefilteredHighVolProbability(int i) ElementioffilteredHighVolProbability(P(high vol at t | data up to t): causal).double[]A fresh copy offilteredHighVolProbability.intLength offilteredHighVolProbability.inthashCode()doublelogLikelihood.doublemeans(int i) Elementiofmeans(per-state mean return).double[]A fresh copy ofmeans.intLength ofmeans.doublesmoothedHighVolProbability(int i) ElementiofsmoothedHighVolProbability(P(high vol at t | all data): ex post only).double[]A fresh copy ofsmoothedHighVolProbability.intLength ofsmoothedHighVolProbability.doublestdDevs(int i) ElementiofstdDevs(per-state volatility (state 1 = high vol)).double[]A fresh copy ofstdDevs.intLength ofstdDevs.toString()doubletransition(int i, int j) Element[i][j]oftransition(transition[i][j] = P(next=j | now=i)).double[][]A deep copy oftransition.intNumber of rows oftransition.
-
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 returnstdDevs- 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 onlyfilteredHighVolProbability- P(high vol at t | data up to t): causalcurrentProbabilities- filtered P(state | data up to T)
-
-
Method Details
-
means
public double means(int i) Elementiofmeans(per-state mean return). -
meansLength
public int meansLength()Length ofmeans. -
meansCopy
public double[] meansCopy()A fresh copy ofmeans. -
stdDevs
public double stdDevs(int i) ElementiofstdDevs(per-state volatility (state 1 = high vol)). -
stdDevsLength
public int stdDevsLength()Length ofstdDevs. -
stdDevsCopy
public double[] stdDevsCopy()A fresh copy ofstdDevs. -
transition
public double transition(int i, int j) Element[i][j]oftransition(transition[i][j] = P(next=j | now=i)). -
transitionRows
public int transitionRows()Number of rows oftransition. -
transitionCopy
public double[][] transitionCopy()A deep copy oftransition. -
logLikelihood
public double logLikelihood()logLikelihood. -
smoothedHighVolProbability
public double smoothedHighVolProbability(int i) ElementiofsmoothedHighVolProbability(P(high vol at t | all data): ex post only). -
smoothedHighVolProbabilityLength
public int smoothedHighVolProbabilityLength()Length ofsmoothedHighVolProbability. -
smoothedHighVolProbabilityCopy
public double[] smoothedHighVolProbabilityCopy()A fresh copy ofsmoothedHighVolProbability. -
filteredHighVolProbability
public double filteredHighVolProbability(int i) ElementioffilteredHighVolProbability(P(high vol at t | data up to t): causal). -
filteredHighVolProbabilityLength
public int filteredHighVolProbabilityLength()Length offilteredHighVolProbability. -
filteredHighVolProbabilityCopy
public double[] filteredHighVolProbabilityCopy()A fresh copy offilteredHighVolProbability. -
currentProbabilities
public double currentProbabilities(int i) ElementiofcurrentProbabilities(filtered P(state | data up to T)). -
currentProbabilitiesLength
public int currentProbabilitiesLength()Length ofcurrentProbabilities. -
currentProbabilitiesCopy
public double[] currentProbabilitiesCopy()A fresh copy ofcurrentProbabilities. -
currentRegime
public int currentRegime()currentRegime. -
expectedDuration
public double expectedDuration(int state) Expected persistence of a regime in periods: 1 / (1 - p_stay). -
equals
-
hashCode
-
toString
-