Class FDMHullWhiteModel

java.lang.Object
net.finmath.finitedifference.interestrate.models.FDMHullWhiteModel
All Implemented Interfaces:
FiniteDifferenceModel, FiniteDifferenceInterestRateModel, Model

public class FDMHullWhiteModel extends Object implements FiniteDifferenceInterestRateModel
One-factor Hull-White interest-rate model for finite-difference valuation.

The model is formulated in shifted-state form

r^{d}(t) = x(t) + \alpha(t),

where r^d denotes the discounting short rate, x is the one-dimensional Markovian state variable, and \alpha is the deterministic shift ensuring exact fit to the initial discount curve.

The Markovian state variable follows

d x(t) = -a(t) x(t)\,dt + \sigma(t)\,dW(t), \qquad x(0)=0,

where the mean reversion a and the instantaneous short-rate volatility \sigma are provided by a ShortRateVolatilityModel. As in the Monte Carlo Hull-White implementation of finmath, these coefficients are interpreted as piecewise constant on the volatility-model time discretization.

The discount bond is represented in affine form

P^{d}(t,T) = A(t,T)\exp\bigl(-B(t,T)x(t)\bigr).

In a multiple-curve setting, forwarding rates are constructed through a deterministic multiplicative-spread extension. If \delta = T_{2}-T_{1}, we set

1 + \delta F^{j}(t;T_{1},T_{2}) = S^{j}(T_{1},T_{2}) \bigl(1 + \delta F^{d}(t;T_{1},T_{2})\bigr),

where F^d is the discount-curve forward rate implied by the model and the deterministic spread factor is calibrated from the initial curves by

S^{j}(T_{1},T_{2}) = \frac{1+\delta F^{j}(0;T_{1},T_{2})} {1+\delta F^{d}(0;T_{1},T_{2})}.

This keeps the finite-difference state dimension equal to one while remaining consistent with the initial multi-curve market configuration represented by the AnalyticModel.

The class is deliberately close in spirit to the Monte Carlo HullWhiteModelWithShiftExtension, while exposing the ingredients required by the finite-difference framework.

Author:
Alessandro Gnoatto
  • Constructor Details

    • FDMHullWhiteModel

      public FDMHullWhiteModel(AnalyticModel analyticModel, DiscountCurve discountCurve, ShortRateVolatilityModel volatilityModel, SpaceTimeDiscretization spaceTimeDiscretization)
      Creates a one-factor Hull-White finite-difference model.
      Parameters:
      analyticModel - The initial analytic multi-curve model.
      discountCurve - The discount curve used for discount-bond calibration.
      volatilityModel - The short-rate volatility model specifying mean reversion and volatility.
      spaceTimeDiscretization - The finite-difference space-time discretization.
  • Method Details

    • getAnalyticModel

      public AnalyticModel getAnalyticModel()
      Description copied from interface: FiniteDifferenceInterestRateModel
      Returns the analytic multi-curve model used as the initial condition of the stochastic term-structure model.

      The returned AnalyticModel is assumed to contain the bootstrapped market curves used to anchor the model to the observed initial term structure.

      Specified by:
      getAnalyticModel in interface FiniteDifferenceInterestRateModel
      Returns:
      The initial analytic multi-curve model.
    • getDiscountCurve

      public DiscountCurve getDiscountCurve()
      Returns the discount curve used for discount-bond calibration.
      Returns:
      The discount curve.
    • getVolatilityModel

      public ShortRateVolatilityModel getVolatilityModel()
      Returns the short-rate volatility model.
      Returns:
      The short-rate volatility model.
    • getSpaceTimeDiscretization

      public SpaceTimeDiscretization getSpaceTimeDiscretization()
      Description copied from interface: FiniteDifferenceModel
      Returns the space-time discretization used by this finite difference model.

      The discretization defines the grid in both time and space on which the PDE approximation is constructed.

      Specified by:
      getSpaceTimeDiscretization in interface FiniteDifferenceModel
      Returns:
      The SpaceTimeDiscretization used by this model.
    • getInitialValue

      public double[] getInitialValue()
      Description copied from interface: FiniteDifferenceInterestRateModel
      Returns the initial value of the Markovian state variables.
      Specified by:
      getInitialValue in interface FiniteDifferenceInterestRateModel
      Returns:
      The initial state vector.
    • getDrift

      public double[] getDrift(double time, double... stateVariables)
      Description copied from interface: FiniteDifferenceInterestRateModel
      Returns the drift vector of the Markovian state process.

      This method provides the deterministic part of the state dynamics

      dX_t = \mu(t,X_t)\,dt + \lambda(t,X_t)\,dW_t.

      Specified by:
      getDrift in interface FiniteDifferenceInterestRateModel
      Parameters:
      time - The current time.
      stateVariables - The current state vector.
      Returns:
      The drift vector at the given state.
    • getFactorLoading

      public double[][] getFactorLoading(double time, double... stateVariables)
      Description copied from interface: FiniteDifferenceInterestRateModel
      Returns the factor-loading matrix of the Markovian state process.

      If d denotes the state dimension and m the Brownian dimension, then the returned array has shape d x m.

      Specified by:
      getFactorLoading in interface FiniteDifferenceInterestRateModel
      Parameters:
      time - The current time.
      stateVariables - The current state vector.
      Returns:
      The factor-loading matrix at the given state.
    • getDiscountBond

      public double getDiscountBond(double time, double maturity, double... stateVariables)
      Description copied from interface: FiniteDifferenceInterestRateModel
      Returns the value at time time of the discount bond maturing at maturity, conditional on the current model state.

      In a multi-curve setting this method refers to the discounting curve.

      Specified by:
      getDiscountBond in interface FiniteDifferenceInterestRateModel
      Parameters:
      time - The evaluation time.
      maturity - The maturity of the discount bond.
      stateVariables - The current state vector.
      Returns:
      The discount bond value.
    • getDeterministicShortRateShift

      public double getDeterministicShortRateShift(double time)
      Returns the deterministic shift alpha(t) in the representation r(t) = x(t) + alpha(t).
      Parameters:
      time - The time t.
      Returns:
      The deterministic short-rate shift alpha(t).
    • getForwardRate

      public double getForwardRate(String forwardCurveName, double time, double periodStart, double periodEnd, double... stateVariables)
      Description copied from interface: FiniteDifferenceInterestRateModel
      Returns the simply compounded forward rate associated with a given forwarding curve and accrual period.

      This is the finite-difference analogue of the Monte Carlo getLibor(...) philosophy. The forwarding curve is identified explicitly because, in a multi-curve framework, it is in general distinct from the discount curve.

      Specified by:
      getForwardRate in interface FiniteDifferenceInterestRateModel
      Parameters:
      forwardCurveName - The name of the forwarding curve.
      time - The evaluation time.
      periodStart - The start of the accrual period.
      periodEnd - The end of the accrual period.
      stateVariables - The current state vector.
      Returns:
      The forward rate for the specified accrual period.
    • getCloneWithModifiedSpaceTimeDiscretization

      public FDMHullWhiteModel getCloneWithModifiedSpaceTimeDiscretization(SpaceTimeDiscretization newSpaceTimeDiscretization)
      Description copied from interface: FiniteDifferenceInterestRateModel
      Returns a clone of the model using a modified space-time discretization.
      Specified by:
      getCloneWithModifiedSpaceTimeDiscretization in interface FiniteDifferenceInterestRateModel
      Parameters:
      newSpaceTimeDiscretization - The new space-time discretization.
      Returns:
      A clone with the modified discretization.
    • getA

      public double getA(double time, double maturity)
      Returns the affine coefficient A(t,T) in the discount-bond formula P(t,T) = A(t,T) exp(-B(t,T) x(t)).
      Parameters:
      time - The time t.
      maturity - The maturity T.
      Returns:
      The value of A(t,T).
    • getB

      public double getB(double time, double maturity)
      Returns the affine coefficient

      B(t,T) = \int_{t}^{T} \exp\left(-\int_{u}^{T} a(s)\,ds\right)\,du.

      The implementation supports piecewise constant mean reversion levels, as provided by the volatility model.

      Parameters:
      time - The time t.
      maturity - The maturity T.
      Returns:
      The value of B(t,T).
    • getShortRateConditionalVariance

      public double getShortRateConditionalVariance(double time, double maturity)
      Returns the conditional variance

      Var(r(T)\,|\,r(t)) = \int_{t}^{T}\sigma^{2}(u) \exp\left(-2\int_{u}^{T} a(s)\,ds\right)\,du.

      Parameters:
      time - The conditioning time.
      maturity - The maturity.
      Returns:
      The conditional short-rate variance.
    • getIntegratedBondSquaredVolatility

      public double getIntegratedBondSquaredVolatility(double time, double maturity)
      Returns the integrated bond variance Var(log P(t,T) | F_0) contribution B(t,T)^2 Var(r(t) | r(0)).
      Parameters:
      time - The time t.
      maturity - The bond maturity T.
      Returns:
      The integrated bond squared volatility.
    • getMRTime

      public double getMRTime(double time, double maturity)
      Returns the value.
      Parameters:
      time - The value.
      maturity - The value.
      Returns:
      The value.
    • getBoundaryConditionsAtLowerBoundary

      public BoundaryCondition[] getBoundaryConditionsAtLowerBoundary(FiniteDifferenceInterestRateProduct product, double time, double... stateVariables)
      Description copied from interface: FiniteDifferenceInterestRateModel
      Returns the lower-boundary conditions for the current product and state.

      The default implementation returns StandardBoundaryCondition.none() in every spatial direction.

      Specified by:
      getBoundaryConditionsAtLowerBoundary in interface FiniteDifferenceInterestRateModel
      Parameters:
      product - The product being priced.
      time - The current time.
      stateVariables - The current boundary state.
      Returns:
      Boundary conditions at the lower boundary.
    • getBoundaryConditionsAtUpperBoundary

      public BoundaryCondition[] getBoundaryConditionsAtUpperBoundary(FiniteDifferenceInterestRateProduct product, double time, double... stateVariables)
      Description copied from interface: FiniteDifferenceInterestRateModel
      Returns the upper-boundary conditions for the current product and state.

      The default implementation returns StandardBoundaryCondition.none() in every spatial direction.

      Specified by:
      getBoundaryConditionsAtUpperBoundary in interface FiniteDifferenceInterestRateModel
      Parameters:
      product - The product being priced.
      time - The current time.
      stateVariables - The current boundary state.
      Returns:
      Boundary conditions at the upper boundary.