Class HullWhiteOneFactorPiecewiseConstantInterestRateModel

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

    public final class HullWhiteOneFactorPiecewiseConstantInterestRateModel
    extends Object
    implements org.joda.beans.ImmutableBean, Serializable
    Methods related to the Hull-White one factor (extended Vasicek) model with piecewise constant volatility.
    See Also:
    Serialized Form
    • Method Detail

      • futuresConvexityFactor

        public double futuresConvexityFactor​(HullWhiteOneFactorPiecewiseConstantParameters data,
                                             double t0,
                                             double t1,
                                             double t2)
        Calculates the future convexity factor used in future pricing.

        The factor is called gamma in the reference: Henrard, M. "The Irony in the derivatives discounting Part II: the crisis", Wilmott Journal, 2010, 2, 301-316

        Parameters:
        data - the Hull-White model parameters
        t0 - the first expiry time
        t1 - the first reference time
        t2 - the second reference time
        Returns:
        the factor
      • futuresConvexityFactorAdjoint

        public ValueDerivatives futuresConvexityFactorAdjoint​(HullWhiteOneFactorPiecewiseConstantParameters data,
                                                              double t0,
                                                              double t1,
                                                              double t2)
        Calculates the future convexity factor and its derivatives with respect to the model volatilities.

        The factor is called gamma in the reference: Henrard, M. "The Irony in the derivatives discounting Part II: the crisis", Wilmott Journal, 2010, 2, 301-316

        Parameters:
        data - the Hull-White model parameters
        t0 - the expiry time
        t1 - the first reference time
        t2 - the second reference time
        Returns:
        the factor and drivatives
      • paymentDelayConvexityFactor

        public double paymentDelayConvexityFactor​(HullWhiteOneFactorPiecewiseConstantParameters parameters,
                                                  double startExpiry,
                                                  double endExpiry,
                                                  double u,
                                                  double v,
                                                  double tp)
        Calculates the payment delay convexity factor used in coupons with mismatched dates pricing.
        Parameters:
        parameters - the Hull-White model parameters
        startExpiry - the start expiry time
        endExpiry - the end expiry time
        u - the fixing period start time
        v - the fixing period end time
        tp - the payment time
        Returns:
        the factor
      • alpha

        public double alpha​(HullWhiteOneFactorPiecewiseConstantParameters data,
                            double startExpiry,
                            double endExpiry,
                            double numeraireTime,
                            double bondMaturity)
        Calculates the (zero-coupon) bond volatility divided by a bond numeraire, i.e., alpha, for a given period.
        Parameters:
        data - the Hull-White model data
        startExpiry - the start time of the expiry period
        endExpiry - the end time of the expiry period
        numeraireTime - the time to maturity for the bond numeraire
        bondMaturity - the time to maturity for the bond
        Returns:
        the re-based bond volatility
      • alphaAdjoint

        public ValueDerivatives alphaAdjoint​(HullWhiteOneFactorPiecewiseConstantParameters data,
                                             double startExpiry,
                                             double endExpiry,
                                             double numeraireTime,
                                             double bondMaturity)
        Calculates the (zero-coupon) bond volatility divided by a bond numeraire, i.e., alpha, for a given period and its derivatives.

        The derivative values are the derivatives of the function alpha with respect to the piecewise constant volatilities.

        Parameters:
        data - the Hull-White model data
        startExpiry - the start time of the expiry period
        endExpiry - the end time of the expiry period
        numeraireTime - the time to maturity for the bond numeraire
        bondMaturity - the time to maturity for the bond
        Returns:
        The re-based bond volatility
      • kappa

        public double kappa​(DoubleArray discountedCashFlow,
                            DoubleArray alpha)
        Calculates the exercise boundary for swaptions.

        Reference: Henrard, M. (2003). "Explicit bond option and swaption formula in Heath-Jarrow-Morton one-factor model". International Journal of Theoretical and Applied Finance, 6(1):57--72.

        Parameters:
        discountedCashFlow - the cash flow equivalent discounted to today
        alpha - the zero-coupon bond volatilities
        Returns:
        the exercise boundary
      • beta

        public double beta​(HullWhiteOneFactorPiecewiseConstantParameters data,
                           double startExpiry,
                           double endExpiry)
        Calculates the beta parameter.

        This is intended to be used in particular for Bermudan swaption first step of the pricing.

        Reference: Henrard, "M. Bermudan Swaptions in Gaussian HJM One-Factor Model: Analytical and Numerical Approaches". SSRN, October 2008. Available at SSRN: http://ssrn.com/abstract=1287982

        Parameters:
        data - the Hull-White model data
        startExpiry - the start time of the expiry period
        endExpiry - the end time of the expiry period
        Returns:
        the re-based bond volatility
      • lambda

        public double lambda​(DoubleArray discountedCashFlow,
                             DoubleArray alpha2,
                             DoubleArray hwH)
        Calculates the common part of the exercise boundary of European swaptions forward.

        This is intended to be used in particular for Bermudan swaption first step of the pricing.

        Reference: Henrard, "M. Bermudan Swaptions in Gaussian HJM One-Factor Model: Analytical and Numerical Approaches". SSRN, October 2008. Available at SSRN: http://ssrn.com/abstract=1287982

        Parameters:
        discountedCashFlow - the swap discounted cash flows
        alpha2 - square of the alpha parameter
        hwH - the H factors
        Returns:
        the exercise boundary
      • volatilityMaturityPart

        public DoubleMatrix volatilityMaturityPart​(HullWhiteOneFactorPiecewiseConstantParameters hwParameters,
                                                   double u,
                                                   DoubleMatrix v)
        Calculates the maturity dependent part of the volatility (function called H in the implementation note).
        Parameters:
        hwParameters - the model parameters
        u - the start time
        v - the end time
        Returns:
        the volatility
      • swapRate

        public double swapRate​(double x,
                               DoubleArray discountedCashFlowFixed,
                               DoubleArray alphaFixed,
                               DoubleArray discountedCashFlowIbor,
                               DoubleArray alphaIbor)
        Calculates the swap rate for a given value of the standard normal random variable in the P(*,theta) numeraire.
        Parameters:
        x - the random variable value
        discountedCashFlowFixed - the discounted cash flows equivalent of the swap fixed leg
        alphaFixed - the zero-coupon bond volatilities for the swap fixed leg
        discountedCashFlowIbor - the discounted cash flows equivalent of the swap Ibor leg
        alphaIbor - the zero-coupon bond volatilities for the swap Ibor leg
        Returns:
        the swap rate
      • swapRateDx1

        public double swapRateDx1​(double x,
                                  DoubleArray discountedCashFlowFixed,
                                  DoubleArray alphaFixed,
                                  DoubleArray discountedCashFlowIbor,
                                  DoubleArray alphaIbor)
        Calculates the first order derivative of the swap rate with respect to the value of the standard normal random variable in the P(*,theta) numeraire.
        Parameters:
        x - the random variable value
        discountedCashFlowFixed - the discounted cash flows equivalent of the swap fixed leg
        alphaFixed - the zero-coupon bond volatilities for the swap fixed leg
        discountedCashFlowIbor - the discounted cash flows equivalent of the swap Ibor leg
        alphaIbor - the zero-coupon bond volatilities for the swap Ibor leg
        Returns:
        the first derivative of the swap rate
      • swapRateDx2

        public double swapRateDx2​(double x,
                                  DoubleArray discountedCashFlowFixed,
                                  DoubleArray alphaFixed,
                                  DoubleArray discountedCashFlowIbor,
                                  DoubleArray alphaIbor)
        Calculates the second order derivative of the swap rate with respect to the value of the standard normal random variable in the P(*,theta) numeraire.
        Parameters:
        x - the random variable value
        discountedCashFlowFixed - the discounted cash flows equivalent of the swap fixed leg
        alphaFixed - the zero-coupon bond volatilities for the swap fixed leg
        discountedCashFlowIbor - the discounted cash flows equivalent of the swap Ibor leg
        alphaIbor - the zero-coupon bond volatilities for the swap Ibor leg
        Returns:
        the second derivative of the swap rate
      • swapRateDdcfi1

        public ValueDerivatives swapRateDdcfi1​(double x,
                                               DoubleArray discountedCashFlowFixed,
                                               DoubleArray alphaFixed,
                                               DoubleArray discountedCashFlowIbor,
                                               DoubleArray alphaIbor)
        Calculates the first order derivative of the swap rate with respect to the discountedCashFlowIbor in the P(*,theta) numeraire.
        Parameters:
        x - the random variable value
        discountedCashFlowFixed - the discounted cash flows equivalent of the swap fixed leg
        alphaFixed - the zero-coupon bond volatilities for the swap fixed leg
        discountedCashFlowIbor - the discounted cash flows equivalent of the swap Ibor leg
        alphaIbor - the zero-coupon bond volatilities for the swap Ibor leg
        Returns:
        the swap rate and derivatives
      • swapRateDdcff1

        public ValueDerivatives swapRateDdcff1​(double x,
                                               DoubleArray discountedCashFlowFixed,
                                               DoubleArray alphaFixed,
                                               DoubleArray discountedCashFlowIbor,
                                               DoubleArray alphaIbor)
        Calculates the first order derivative of the swap rate with respect to the discountedCashFlowFixed in the P(*,theta) numeraire.
        Parameters:
        x - the random variable value
        discountedCashFlowFixed - the discounted cash flows equivalent of the swap fixed leg
        alphaFixed - the zero-coupon bond volatilities for the swap fixed leg
        discountedCashFlowIbor - the discounted cash flows equivalent of the swap Ibor leg
        alphaIbor - the zero-coupon bond volatilities for the swap Ibor leg
        Returns:
        the swap rate and derivatives
      • swapRateDai1

        public ValueDerivatives swapRateDai1​(double x,
                                             DoubleArray discountedCashFlowFixed,
                                             DoubleArray alphaFixed,
                                             DoubleArray discountedCashFlowIbor,
                                             DoubleArray alphaIbor)
        Calculates the first order derivative of the swap rate with respect to the alphaIbor in the P(*,theta) numeraire.
        Parameters:
        x - the random variable value
        discountedCashFlowFixed - the discounted cash flows equivalent of the swap fixed leg
        alphaFixed - the zero-coupon bond volatilities for the swap fixed leg
        discountedCashFlowIbor - the discounted cash flows equivalent of the swap Ibor leg
        alphaIbor - the zero-coupon bond volatilities for the swap Ibor leg
        Returns:
        the swap rate and derivatives
      • swapRateDaf1

        public ValueDerivatives swapRateDaf1​(double x,
                                             DoubleArray discountedCashFlowFixed,
                                             DoubleArray alphaFixed,
                                             DoubleArray discountedCashFlowIbor,
                                             DoubleArray alphaIbor)
        Calculates the first order derivative of the swap rate with respect to the alphaFixed in the P(*,theta) numeraire.
        Parameters:
        x - the random variable value.
        discountedCashFlowFixed - the discounted cash flows equivalent of the swap fixed leg
        alphaFixed - the zero-coupon bond volatilities for the swap fixed leg
        discountedCashFlowIbor - the discounted cash flows equivalent of the swap Ibor leg
        alphaIbor - the zero-coupon bond volatilities for the swap Ibor leg
        Returns:
        the swap rate and derivatives
      • swapRateDx2Ddcf1

        public Pair<DoubleArray,​DoubleArray> swapRateDx2Ddcf1​(double x,
                                                                    DoubleArray discountedCashFlowFixed,
                                                                    DoubleArray alphaFixed,
                                                                    DoubleArray discountedCashFlowIbor,
                                                                    DoubleArray alphaIbor)
        Calculates the first order derivative with respect to the discountedCashFlowFixed and to the discountedCashFlowIbor of the of swap rate second derivative with respect to the random variable x in the P(*,theta) numeraire.

        The result is made of a pair of arrays. The first one is the derivative with respect to discountedCashFlowFixed and the second one with respect to discountedCashFlowIbor.

        Parameters:
        x - the random variable value
        discountedCashFlowFixed - the discounted cash flows equivalent of the swap fixed leg
        alphaFixed - the zero-coupon bond volatilities for the swap fixed leg
        discountedCashFlowIbor - the discounted cash flows equivalent of the swap Ibor leg
        alphaIbor - the zero-coupon bond volatilities for the swap Ibor leg
        Returns:
        the swap rate derivatives
      • swapRateDx2Da1

        public Pair<DoubleArray,​DoubleArray> swapRateDx2Da1​(double x,
                                                                  DoubleArray discountedCashFlowFixed,
                                                                  DoubleArray alphaFixed,
                                                                  DoubleArray discountedCashFlowIbor,
                                                                  DoubleArray alphaIbor)
        Calculates the first order derivative with respect to the alphaFixed and to the alphaIbor of the of swap rate second derivative with respect to the random variable x in the P(*,theta) numeraire.

        The result is made of a pair of arrays. The first one is the derivative with respect to alphaFixed and the second one with respect to alphaIbor.

        Parameters:
        x - the random variable value
        discountedCashFlowFixed - the discounted cash flows equivalent of the swap fixed leg
        alphaFixed - the zero-coupon bond volatilities for the swap fixed leg
        discountedCashFlowIbor - the discounted cash flows equivalent of the swap Ibor leg
        alphaIbor - the zero-coupon bond volatilities for the swap Ibor leg
        Returns:
        the swap rate derivatives
      • hashCode

        public int hashCode()
        Overrides:
        hashCode in class Object