Record Class RegimeDetector.RegimeModel
java.lang.Object
java.lang.Record
com.quantfinlib.ml.RegimeDetector.RegimeModel
- Enclosing class:
RegimeDetector
public static record RegimeDetector.RegimeModel(double[] means, double[] stdDevs, double[][] transition, double logLikelihood, double[] smoothedHighVolProbability, double[] currentProbabilities, int currentRegime)
extends Record
-
Constructor Summary
ConstructorsConstructorDescriptionRegimeModel(double[] means, double[] stdDevs, double[][] transition, double logLikelihood, double[] smoothedHighVolProbability, double[] currentProbabilities, int currentRegime) Creates an instance of aRegimeModelrecord class. -
Method Summary
Modifier and TypeMethodDescriptiondouble[]Returns the value of thecurrentProbabilitiesrecord component.intReturns the value of thecurrentRegimerecord component.final booleanIndicates whether some other object is "equal to" this one.doubleexpectedDuration(int state) Expected persistence of a regime in periods: 1 / (1 - p_stay).final inthashCode()Returns a hash code value for this object.doubleReturns the value of thelogLikelihoodrecord component.double[]means()Returns the value of themeansrecord component.double[]Returns the value of thesmoothedHighVolProbabilityrecord component.double[]stdDevs()Returns the value of thestdDevsrecord component.final StringtoString()Returns a string representation of this record class.double[][]Returns the value of thetransitionrecord component.
-
Constructor Details
-
RegimeModel
public RegimeModel(double[] means, double[] stdDevs, double[][] transition, double logLikelihood, double[] smoothedHighVolProbability, double[] currentProbabilities, int currentRegime) Creates an instance of aRegimeModelrecord class.- Parameters:
means- the value for themeansrecord componentstdDevs- the value for thestdDevsrecord componenttransition- the value for thetransitionrecord componentlogLikelihood- the value for thelogLikelihoodrecord componentsmoothedHighVolProbability- the value for thesmoothedHighVolProbabilityrecord componentcurrentProbabilities- the value for thecurrentProbabilitiesrecord componentcurrentRegime- the value for thecurrentRegimerecord component
-
-
Method Details
-
expectedDuration
public double expectedDuration(int state) Expected persistence of a regime in periods: 1 / (1 - p_stay). -
toString
-
hashCode
-
equals
Indicates whether some other object is "equal to" this one. The objects are equal if the other object is of the same class and if all the record components are equal. Reference components are compared withObjects::equals(Object,Object); primitive components are compared with thecomparemethod from their corresponding wrapper classes. -
means
public double[] means()Returns the value of themeansrecord component.- Returns:
- the value of the
meansrecord component
-
stdDevs
public double[] stdDevs()Returns the value of thestdDevsrecord component.- Returns:
- the value of the
stdDevsrecord component
-
transition
public double[][] transition()Returns the value of thetransitionrecord component.- Returns:
- the value of the
transitionrecord component
-
logLikelihood
public double logLikelihood()Returns the value of thelogLikelihoodrecord component.- Returns:
- the value of the
logLikelihoodrecord component
-
smoothedHighVolProbability
public double[] smoothedHighVolProbability()Returns the value of thesmoothedHighVolProbabilityrecord component.- Returns:
- the value of the
smoothedHighVolProbabilityrecord component
-
currentProbabilities
public double[] currentProbabilities()Returns the value of thecurrentProbabilitiesrecord component.- Returns:
- the value of the
currentProbabilitiesrecord component
-
currentRegime
public int currentRegime()Returns the value of thecurrentRegimerecord component.- Returns:
- the value of the
currentRegimerecord component
-