Class HullWhiteOneFactorPiecewiseConstantParameters

  • All Implemented Interfaces:
    Serializable, org.joda.beans.Bean, org.joda.beans.ImmutableBean

    public final class HullWhiteOneFactorPiecewiseConstantParameters
    extends Object
    implements org.joda.beans.ImmutableBean, 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
      • hashCode

        public int hashCode()
        Overrides:
        hashCode in class Object