Class FDMAsianADI2D
- All Implemented Interfaces:
FDMSolver
The lifted formulation augments the spot process S by the running integral
I_t = \int_0^t S_u \, du,
so that an arithmetic-average payoff can be represented as a terminal payoff in the two-dimensional state variables (S_t,I_t). The state dynamics are
dS_t = \mu_S dt + \sigma(S_t,t) dW_t,
dI_t = S_t dt.
In time-to-maturity coordinates \tau = T - t, the backward pricing PDE is written as
u_{\tau} = A_0 u + A_1 u + A_2 u,
with
A_0 u = -r u,
A_1 u = \mu_S u_S + \frac{1}{2} a_{SS} u_{SS},
A_2 u = S u_I.
Hence there is no mixed derivative and no diffusion in the integral direction. The second state direction is a pure transport direction. In \tau-time, transport is propagated toward increasing I, so the consistent upwind discretization is forward in the I direction.
Relative to the generic AbstractADI2D implementation, this class
therefore:
- uses only discounting in the explicit
A0part, - uses a forward-upwind discretization for
A2, - solves the second-direction implicit systems with the corresponding transport stencil.
- Author:
- Alessandro Gnoatto
-
Nested Class Summary
Nested classes/interfaces inherited from class AbstractADI2D
AbstractADI2D.DoubleTernaryOperator -
Constructor Summary
ConstructorsConstructorDescriptionFDMAsianADI2D(FiniteDifferenceEquityModel model, FiniteDifferenceEquityProduct product, SpaceTimeDiscretization spaceTimeDiscretization, Exercise exercise) Creates the lifted two-dimensional ADI solver for arithmetic Asian products. -
Method Summary
Modifier and TypeMethodDescriptionprotected double[]applyA0Explicit(double[] u, double time) Applies the explicit operator partA0.protected double[]applyA2Explicit(double[] u, double time) Applies the explicit transport operatorA2 u = S u_I.protected double[]solveSecondDirectionLines(double[] rhs, double time, double dt) Solves the implicit systems in the integral direction.Methods inherited from class AbstractADI2D
add, applyA1Explicit, applyContinuousObstacleIfNeeded, applyExerciseObstacleIfNeeded, applyFullExplicitOperator, applyInternalConstraints, applyOuterBoundaries, applyProductEventConditionIfNeeded, extractBoundaryValue, flatten, getExercise, getLowerBoundaryValueForFirstDirection, getLowerBoundaryValueForSecondDirection, getModel, getN, getN0, getN1, getProduct, getSpaceTimeDiscretization, getStencilBuilder, getTheta, getUpperBoundaryValueForFirstDirection, getUpperBoundaryValueForSecondDirection, getValue, getValue, getValue, getValues, getValues, getValues, getValuesWithContinuousObstacle, getValueWithContinuousObstacle, getX0Grid, getX1Grid, isInternalConstraintActive, overwriteBoundaryRow, performDouglasHalfStep, performStableDouglasStep, sanitize, scale, solveFirstDirectionLines, subtract
-
Constructor Details
-
FDMAsianADI2D
public FDMAsianADI2D(FiniteDifferenceEquityModel model, FiniteDifferenceEquityProduct product, SpaceTimeDiscretization spaceTimeDiscretization, Exercise exercise) Creates the lifted two-dimensional ADI solver for arithmetic Asian products.- Parameters:
model- The finite-difference model.product- The product to be valued.spaceTimeDiscretization- The space-time discretization.exercise- The exercise specification.
-
-
Method Details
-
applyA0Explicit
protected double[] applyA0Explicit(double[] u, double time) Applies the explicit operator partA0.For the lifted arithmetic Asian PDE,
A0contains only the discounting term -r u.- Overrides:
applyA0Explicitin classAbstractADI2D- Parameters:
u- Current solution vector.time- Current running time.- Returns:
- Explicit contribution of
A0.
-
applyA2Explicit
protected double[] applyA2Explicit(double[] u, double time) Applies the explicit transport operatorA2 u = S u_I.The derivative in the integral direction is approximated by forward upwinding:
u_I(S_i,I_j) \approx (u_{i,j+1} - u_{i,j}) / (I_{j+1} - I_j).
This is the appropriate upwind choice in time-to-maturity coordinates for the transport equation induced by dI_t = S_t dt.
- Overrides:
applyA2Explicitin classAbstractADI2D- Parameters:
u- Current solution vector.time- Current running time.- Returns:
- Explicit contribution of
A2.
-
solveSecondDirectionLines
protected double[] solveSecondDirectionLines(double[] rhs, double time, double dt) Solves the implicit systems in the integral direction.For each fixed spot index, the second-direction system corresponds to the transport discretization
(1 + \lambda_j) v_j - \lambda_j v_{j+1} = rhs_j,
where \lambda_j = \theta \Delta \tau S / (I_{j+1} - I_j).
The upper integral boundary is the inflow side and is imposed if it is Dirichlet. The lower integral boundary is overwritten only when an explicit Dirichlet condition is provided.
- Overrides:
solveSecondDirectionLinesin classAbstractADI2D- Parameters:
rhs- Right-hand side vector.time- Current running time.dt- Time-step size.- Returns:
- Updated solution vector.
-