Class FDMHullWhiteModel
- All Implemented Interfaces:
FiniteDifferenceModel, FiniteDifferenceInterestRateModel, Model
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 Summary
ConstructorsConstructorDescriptionFDMHullWhiteModel(AnalyticModel analyticModel, DiscountCurve discountCurve, ShortRateVolatilityModel volatilityModel, SpaceTimeDiscretization spaceTimeDiscretization) Creates a one-factor Hull-White finite-difference model. -
Method Summary
Modifier and TypeMethodDescriptiondoublegetA(double time, double maturity) Returns the affine coefficientA(t,T)in the discount-bond formulaP(t,T) = A(t,T) exp(-B(t,T) x(t)).Returns the analytic multi-curve model used as the initial condition of the stochastic term-structure model.doublegetB(double time, double maturity) Returns the affine coefficientgetBoundaryConditionsAtLowerBoundary(FiniteDifferenceInterestRateProduct product, double time, double... stateVariables) Returns the lower-boundary conditions for the current product and state.getBoundaryConditionsAtUpperBoundary(FiniteDifferenceInterestRateProduct product, double time, double... stateVariables) Returns the upper-boundary conditions for the current product and state.getCloneWithModifiedSpaceTimeDiscretization(SpaceTimeDiscretization newSpaceTimeDiscretization) Returns a clone of the model using a modified space-time discretization.doublegetDeterministicShortRateShift(double time) Returns the deterministic shift alpha(t) in the representation r(t) = x(t) + alpha(t).doublegetDiscountBond(double time, double maturity, double... stateVariables) Returns the value at timetimeof the discount bond maturing atmaturity, conditional on the current model state.Returns the discount curve used for discount-bond calibration.double[]getDrift(double time, double... stateVariables) Returns the drift vector of the Markovian state process.double[][]getFactorLoading(double time, double... stateVariables) Returns the factor-loading matrix of the Markovian state process.doublegetForwardRate(String forwardCurveName, double time, double periodStart, double periodEnd, double... stateVariables) Returns the simply compounded forward rate associated with a given forwarding curve and accrual period.double[]Returns the initial value of the Markovian state variables.doublegetIntegratedBondSquaredVolatility(double time, double maturity) Returns the integrated bond varianceVar(log P(t,T) | F_0)contributionB(t,T)^2 Var(r(t) | r(0)).doublegetMRTime(double time, double maturity) Returns the value.doublegetShortRateConditionalVariance(double time, double maturity) Returns the conditional varianceReturns the space-time discretization used by this finite difference model.Returns the short-rate volatility model.Methods inherited from class Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface FiniteDifferenceInterestRateModel
getLibor
-
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
Description copied from interface:FiniteDifferenceInterestRateModelReturns the analytic multi-curve model used as the initial condition of the stochastic term-structure model.The returned
AnalyticModelis assumed to contain the bootstrapped market curves used to anchor the model to the observed initial term structure.- Specified by:
getAnalyticModelin interfaceFiniteDifferenceInterestRateModel- Returns:
- The initial analytic multi-curve model.
-
getDiscountCurve
Returns the discount curve used for discount-bond calibration.- Returns:
- The discount curve.
-
getVolatilityModel
Returns the short-rate volatility model.- Returns:
- The short-rate volatility model.
-
getSpaceTimeDiscretization
Description copied from interface:FiniteDifferenceModelReturns 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:
getSpaceTimeDiscretizationin interfaceFiniteDifferenceModel- Returns:
- The
SpaceTimeDiscretizationused by this model.
-
getInitialValue
public double[] getInitialValue()Description copied from interface:FiniteDifferenceInterestRateModelReturns the initial value of the Markovian state variables.- Specified by:
getInitialValuein interfaceFiniteDifferenceInterestRateModel- Returns:
- The initial state vector.
-
getDrift
public double[] getDrift(double time, double... stateVariables) Description copied from interface:FiniteDifferenceInterestRateModelReturns 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:
getDriftin interfaceFiniteDifferenceInterestRateModel- 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:FiniteDifferenceInterestRateModelReturns the factor-loading matrix of the Markovian state process.If
ddenotes the state dimension andmthe Brownian dimension, then the returned array has shaped x m.- Specified by:
getFactorLoadingin interfaceFiniteDifferenceInterestRateModel- 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:FiniteDifferenceInterestRateModelReturns the value at timetimeof the discount bond maturing atmaturity, conditional on the current model state.In a multi-curve setting this method refers to the discounting curve.
- Specified by:
getDiscountBondin interfaceFiniteDifferenceInterestRateModel- 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:FiniteDifferenceInterestRateModelReturns 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:
getForwardRatein interfaceFiniteDifferenceInterestRateModel- 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:FiniteDifferenceInterestRateModelReturns a clone of the model using a modified space-time discretization.- Specified by:
getCloneWithModifiedSpaceTimeDiscretizationin interfaceFiniteDifferenceInterestRateModel- 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 coefficientA(t,T)in the discount-bond formulaP(t,T) = A(t,T) exp(-B(t,T) x(t)).- Parameters:
time- The timet.maturity- The maturityT.- Returns:
- The value of
A(t,T).
-
getB
public double getB(double time, double maturity) Returns the affine coefficientB(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 timet.maturity- The maturityT.- Returns:
- The value of
B(t,T).
-
getShortRateConditionalVariance
public double getShortRateConditionalVariance(double time, double maturity) Returns the conditional varianceVar(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 varianceVar(log P(t,T) | F_0)contributionB(t,T)^2 Var(r(t) | r(0)).- Parameters:
time- The timet.maturity- The bond maturityT.- 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:FiniteDifferenceInterestRateModelReturns the lower-boundary conditions for the current product and state.The default implementation returns
StandardBoundaryCondition.none()in every spatial direction.- Specified by:
getBoundaryConditionsAtLowerBoundaryin interfaceFiniteDifferenceInterestRateModel- 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:FiniteDifferenceInterestRateModelReturns the upper-boundary conditions for the current product and state.The default implementation returns
StandardBoundaryCondition.none()in every spatial direction.- Specified by:
getBoundaryConditionsAtUpperBoundaryin interfaceFiniteDifferenceInterestRateModel- Parameters:
product- The product being priced.time- The current time.stateVariables- The current boundary state.- Returns:
- Boundary conditions at the upper boundary.
-