Class FDMSolverFactory
The purpose of this class is to map a model class to the solver implementation capable of handling the corresponding PDE or PIDE. In abstract terms, if the model leads to a pricing equation of the form
\frac{\partial V}{\partial t} + \mathcal{L}V = 0
with generator \mathcal{L}, then this factory selects the
discretization engine
used to approximate the operator \mathcal{L} on the supplied
SpaceTimeDiscretization. For one-dimensional diffusion models this is
typically
a theta-method solver, while for two-dimensional stochastic-volatility or
multi-asset
diffusion models this is typically an ADI-based solver.
The current selection logic is:
- one-dimensional jump models →
FDMThetaMethod1DJump, - Black-Scholes, CEV, and Bachelier models →
FDMThetaMethod1D, - multi-asset Black-Scholes models:
1D →
FDMThetaMethod1D, 2D →FDMMultiAssetBlackScholesADI2D, - Bates models →
FDMBatesADI2D, - Heston models →
FDMHestonADI2DorFDMBarrierHestonADI2D, - SABR models →
FDMSabrADI2DorFDMBarrierSabrADI2D.
For barrier-aware two-dimensional Heston and SABR problems, the factory may
select a
specialized pre-hit / barrier solver depending on the supplied
BarrierPDEMode and BarrierPreHitSpecification. If no barrier
mode is
provided, the corresponding vanilla solver is returned.
The class is a pure utility holder and cannot be instantiated.
- Author:
- Alessandro Gnoatto
-
Method Summary
Modifier and TypeMethodDescriptionstatic FDMSolvercreateSolver(FiniteDifferenceEquityModel model, FiniteDifferenceEquityProduct product, SpaceTimeDiscretization spaceTimeDiscretization, Exercise exercise) Performs the operation.static FDMSolvercreateSolver(FiniteDifferenceEquityModel model, FiniteDifferenceEquityProduct product, SpaceTimeDiscretization spaceTimeDiscretization, Exercise exercise, BarrierPDEMode barrierMode, BarrierPreHitSpecification preHitSpecification) Performs the operation.static FDMSolvercreateSolver(FiniteDifferenceEquityModel model, FiniteDifferenceEquityProduct product, Exercise exercise) Performs the operation.static FDMSolvercreateSolver(FiniteDifferenceEquityModel model, FiniteDifferenceEquityProduct product, Exercise exercise, BarrierPDEMode barrierMode, BarrierPreHitSpecification preHitSpecification) Performs the operation.
-
Method Details
-
createSolver
public static FDMSolver createSolver(FiniteDifferenceEquityModel model, FiniteDifferenceEquityProduct product, SpaceTimeDiscretization spaceTimeDiscretization, Exercise exercise) Performs the operation.- Parameters:
model- The value.product- The value.spaceTimeDiscretization- The value.exercise- The value.- Returns:
- The value.
-
createSolver
public static FDMSolver createSolver(FiniteDifferenceEquityModel model, FiniteDifferenceEquityProduct product, SpaceTimeDiscretization spaceTimeDiscretization, Exercise exercise, BarrierPDEMode barrierMode, BarrierPreHitSpecification preHitSpecification) Performs the operation.- Parameters:
model- The value.product- The value.spaceTimeDiscretization- The value.exercise- The value.barrierMode- The value.preHitSpecification- The value.- Returns:
- The value.
-
createSolver
public static FDMSolver createSolver(FiniteDifferenceEquityModel model, FiniteDifferenceEquityProduct product, Exercise exercise) Performs the operation.- Parameters:
model- The value.product- The value.exercise- The value.- Returns:
- The value.
-
createSolver
public static FDMSolver createSolver(FiniteDifferenceEquityModel model, FiniteDifferenceEquityProduct product, Exercise exercise, BarrierPDEMode barrierMode, BarrierPreHitSpecification preHitSpecification) Performs the operation.- Parameters:
model- The value.product- The value.exercise- The value.barrierMode- The value.preHitSpecification- The value.- Returns:
- The value.
-