Record Class AlphaRiskModels.Spec

java.lang.Object
java.lang.Record
com.quantfinlib.alpha.AlphaRiskModels.Spec
Record Components:
window - estimation periods (≥ 2)
momentumLookback - momentum lookback in bars
volLookback - low-volatility lookback in bars
capWindow - bars of dollar volume for the size proxy
model - factor risk model settings
Enclosing class:
AlphaRiskModels

public static record AlphaRiskModels.Spec(int window, int momentumLookback, int volLookback, int capWindow, FactorRiskModel.Settings model) extends Record
Risk model specification.
  • Constructor Details

    • Spec

      public Spec(int window, int momentumLookback, int volLookback, int capWindow, FactorRiskModel.Settings model)
      Creates an instance of a Spec record class.
      Parameters:
      window - the value for the window record component
      momentumLookback - the value for the momentumLookback record component
      volLookback - the value for the volLookback record component
      capWindow - the value for the capWindow record component
      model - the value for the model record component
  • Method Details

    • defaults

      public static AlphaRiskModels.Spec defaults()
      120-period window, 60-bar momentum and volatility, 20-bar size proxy, default model.
    • firstIndex

      public int firstIndex()
      First bar at which a model can be built.
    • toString

      public final String toString()
      Returns a string representation of this record class. The representation contains the name of the class, followed by the name and value of each of the record components.
      Specified by:
      toString in class Record
      Returns:
      a string representation of this object
    • hashCode

      public final int hashCode()
      Returns a hash code value for this object. The value is derived from the hash code of each of the record components.
      Specified by:
      hashCode in class Record
      Returns:
      a hash code value for this object
    • equals

      public final boolean equals(Object o)
      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 with Objects::equals(Object,Object); primitive components are compared with the compare method from their corresponding wrapper classes.
      Specified by:
      equals in class Record
      Parameters:
      o - the object with which to compare
      Returns:
      true if this object is the same as the o argument; false otherwise.
    • window

      public int window()
      Returns the value of the window record component.
      Returns:
      the value of the window record component
    • momentumLookback

      public int momentumLookback()
      Returns the value of the momentumLookback record component.
      Returns:
      the value of the momentumLookback record component
    • volLookback

      public int volLookback()
      Returns the value of the volLookback record component.
      Returns:
      the value of the volLookback record component
    • capWindow

      public int capWindow()
      Returns the value of the capWindow record component.
      Returns:
      the value of the capWindow record component
    • model

      public FactorRiskModel.Settings model()
      Returns the value of the model record component.
      Returns:
      the value of the model record component