Record Class NelsonSiegel.Fit

java.lang.Object
java.lang.Record
com.quantfinlib.rates.NelsonSiegel.Fit
Enclosing class:
NelsonSiegel

public static record NelsonSiegel.Fit(double b0, double b1, double b2, double lambda, double rmse) extends Record
Fitted parameters plus the fit's root-mean-square error.
  • Constructor Summary

    Constructors
    Constructor
    Description
    Fit(double b0, double b1, double b2, double lambda, double rmse)
    Creates an instance of a Fit record class.
  • Method Summary

    Modifier and Type
    Method
    Description
    double
    b0()
    Returns the value of the b0 record component.
    double
    b1()
    Returns the value of the b1 record component.
    double
    b2()
    Returns the value of the b2 record component.
    final boolean
    Indicates whether some other object is "equal to" this one.
    final int
    Returns a hash code value for this object.
    double
    Returns the value of the lambda record component.
    double
    The long-end asymptote z(∞) = b0.
    double
    Returns the value of the rmse record component.
    double
    The short-rate limit z(0+) = b0 + b1 (exact in the model).
    final String
    Returns a string representation of this record class.
    double
    zeroRate(double t)
    Model zero rate at tenor t years, > 0.

    Methods inherited from class java.lang.Object

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

    • Fit

      public Fit(double b0, double b1, double b2, double lambda, double rmse)
      Creates an instance of a Fit record class.
      Parameters:
      b0 - the value for the b0 record component
      b1 - the value for the b1 record component
      b2 - the value for the b2 record component
      lambda - the value for the lambda record component
      rmse - the value for the rmse record component
  • Method Details

    • zeroRate

      public double zeroRate(double t)
      Model zero rate at tenor t years, > 0.
    • shortRate

      public double shortRate()
      The short-rate limit z(0+) = b0 + b1 (exact in the model).
    • longRate

      public double longRate()
      The long-end asymptote z(∞) = b0.
    • 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. All components in this record class 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.
    • b0

      public double b0()
      Returns the value of the b0 record component.
      Returns:
      the value of the b0 record component
    • b1

      public double b1()
      Returns the value of the b1 record component.
      Returns:
      the value of the b1 record component
    • b2

      public double b2()
      Returns the value of the b2 record component.
      Returns:
      the value of the b2 record component
    • lambda

      public double lambda()
      Returns the value of the lambda record component.
      Returns:
      the value of the lambda record component
    • rmse

      public double rmse()
      Returns the value of the rmse record component.
      Returns:
      the value of the rmse record component