Class HullWhiteOneFactorPiecewiseConstantParameters

  • All Implemented Interfaces:
    java.io.Serializable, Bean, ImmutableBean

    public final class HullWhiteOneFactorPiecewiseConstantParameters
    extends java.lang.Object
    implements ImmutableBean, java.io.Serializable
    Data bundle related to the Hull-White one factor (extended Vasicek) model with piecewise constant volatility.
    See Also:
    Serialized Form
    • Method Detail

      • of

        public static HullWhiteOneFactorPiecewiseConstantParameters of​(double meanReversion,
                                                                       DoubleArray volatility,
                                                                       DoubleArray volatilityTime)
        Obtains an instance from the model parameters.

        volatilityTime should be sorted in increasing order. The first time (0) and the last time (1000) will be added within this method. Thus the size of volatility should be greater than that of volatilityTime by one.

        Parameters:
        meanReversion - the mean reversion speed (a) parameter
        volatility - the volatility parameters
        volatilityTime - the times separating the constant volatility periods
        Returns:
        the instance
      • getLastVolatility

        public double getLastVolatility()
        Gets the last volatility of the volatility parameters.
        Returns:
        the last volatility
      • withLastVolatility

        public HullWhiteOneFactorPiecewiseConstantParameters withLastVolatility​(double volatility)
        Returns a copy with the last volatility of the volatility parameters changed.
        Parameters:
        volatility - the new volatility
        Returns:
        the new instance
      • withVolatilityAdded

        public HullWhiteOneFactorPiecewiseConstantParameters withVolatilityAdded​(double volatility,
                                                                                 double volatilityTime)
        Returns a copy with an extra volatility and volatility time added at the end of the respective arrays.
        Parameters:
        volatility - the volatility
        volatilityTime - the times separating the constant volatility periods. Must be larger than the previous one
        Returns:
        the new instance
      • getMeanReversion

        public double getMeanReversion()
        Gets the mean reversion speed parameter.
        Returns:
        the value of the property, not null
      • getVolatility

        public DoubleArray getVolatility()
        Gets the volatility parameters.

        The volatility is constant between the volatility times, i.e., volatility value at t is volatility.get(i) for any t between volatilityTime.get(i) and volatilityTime.get(i+1).

        Returns:
        the value of the property, not null
      • getVolatilityTime

        public DoubleArray getVolatilityTime()
        Gets the times separating the constant volatility periods.

        The time should be sorted by increasing order. The first time is 0 and the last time is 1000 (represents infinity). These extra times are added in of(double, DoubleArray, DoubleArray).

        Returns:
        the value of the property, not null
      • equals

        public boolean equals​(java.lang.Object obj)
        Overrides:
        equals in class java.lang.Object
      • hashCode

        public int hashCode()
        Overrides:
        hashCode in class java.lang.Object
      • toString

        public java.lang.String toString()
        Overrides:
        toString in class java.lang.Object