Class FDMThetaMethod1D
- All Implemented Interfaces:
FDMSolver
The solver supports:
- pointwise terminal payoff initialization,
- direct terminal-vector initialization,
- direct terminal-vector initialization with separate pointwise exercise payoff,
- direct terminal-vector initialization with a continuous time-dependent obstacle,
- vector-level event conditions applied on the value vector at prescribed event times.
The third case is useful for Bermudan and American digitals, where the maturity layer should be cell-averaged, while early-exercise projection should remain pointwise.
The fourth case is useful for shout-style problems, where the solution is
constrained
by a time- and state-dependent continuation floor V >= V*(t,x) at
every time step.
If the product is a FiniteDifferenceInterestRateProduct or a
FiniteDifferenceEquityEventProduct, then at every event time
t
the solver applies the vector-level jump condition
V(t^{-},x) = J_t(V(t^{+},x),x).
Event times are required to be part of the solver time discretization.
- Author:
- Alessandro Gnoatto, Ralph Rudd, Christian Fries, Jorg Kienitz
-
Constructor Summary
ConstructorsConstructorDescriptionFDMThetaMethod1D(net.finmath.finitedifference.assetderivativevaluation.models.FiniteDifferenceEquityModel model, net.finmath.finitedifference.assetderivativevaluation.products.FiniteDifferenceEquityProduct product, net.finmath.finitedifference.grids.SpaceTimeDiscretization spaceTimeDiscretization, Exercise exercise) Creates a theta-method finite-difference solver for a one-dimensional backward PDE.FDMThetaMethod1D(net.finmath.finitedifference.FiniteDifferenceModel model, net.finmath.finitedifference.FiniteDifferenceProduct<? extends net.finmath.finitedifference.FiniteDifferenceModel> product, net.finmath.finitedifference.grids.SpaceTimeDiscretization spaceTimeDiscretization, Exercise exercise) Creates a theta-method finite-difference solver for a one-dimensional backward PDE.FDMThetaMethod1D(net.finmath.finitedifference.interestrate.models.FiniteDifferenceInterestRateModel model, net.finmath.finitedifference.interestrate.products.FiniteDifferenceInterestRateProduct product, net.finmath.finitedifference.grids.SpaceTimeDiscretization spaceTimeDiscretization, Exercise exercise) Creates a theta-method finite-difference solver for a one-dimensional backward PDE. -
Method Summary
Modifier and TypeMethodDescriptiondouble[]getValue(double evaluationTime, double time, double[] terminalValues) Returns the solution at a given evaluation time using a precomputed terminal value vector on the spatial grid.double[]getValue(double evaluationTime, double time, double[] terminalValues, DoubleBinaryOperator continuousObstacleValue) Returns the value.double[]getValue(double evaluationTime, double time, double[] terminalValues, DoubleUnaryOperator exerciseValue) Default binary-payoff version with early exercise For solvers that are effectively 1D, the second state variable is ignored.double[]getValue(double evaluationTime, double time, DoubleUnaryOperator valueAtMaturity) Returns the solution at a given evaluation time.double[][]getValues(double time, double[] terminalValues) Returns the full time history of the solution using a precomputed terminal value vector on the spatial grid.double[][]getValues(double time, double[] terminalValues, DoubleBinaryOperator continuousObstacleValue) Returns the value.double[][]getValues(double time, double[] terminalValues, DoubleUnaryOperator exerciseValue) Default binary-payoff version with early exercise For solvers that are effectively 1D, the second state variable is ignored.double[][]getValues(double time, DoubleUnaryOperator valueAtMaturity) Returns the full time history of the solution on the space-time grid.
-
Constructor Details
-
FDMThetaMethod1D
public FDMThetaMethod1D(net.finmath.finitedifference.assetderivativevaluation.models.FiniteDifferenceEquityModel model, net.finmath.finitedifference.assetderivativevaluation.products.FiniteDifferenceEquityProduct product, net.finmath.finitedifference.grids.SpaceTimeDiscretization spaceTimeDiscretization, Exercise exercise) Creates a theta-method finite-difference solver for a one-dimensional backward PDE.- Parameters:
model- The finite-difference equity model providing PDE coefficients and boundary conditions.product- The equity product to be valued.spaceTimeDiscretization- The joint space-time discretization.exercise- The exercise specification.
-
FDMThetaMethod1D
public FDMThetaMethod1D(net.finmath.finitedifference.interestrate.models.FiniteDifferenceInterestRateModel model, net.finmath.finitedifference.interestrate.products.FiniteDifferenceInterestRateProduct product, net.finmath.finitedifference.grids.SpaceTimeDiscretization spaceTimeDiscretization, Exercise exercise) Creates a theta-method finite-difference solver for a one-dimensional backward PDE.- Parameters:
model- The finite-difference interest-rate model providing PDE coefficients and boundary conditions.product- The interest-rate product to be valued.spaceTimeDiscretization- The joint space-time discretization.exercise- The exercise specification.
-
FDMThetaMethod1D
public FDMThetaMethod1D(net.finmath.finitedifference.FiniteDifferenceModel model, net.finmath.finitedifference.FiniteDifferenceProduct<? extends net.finmath.finitedifference.FiniteDifferenceModel> product, net.finmath.finitedifference.grids.SpaceTimeDiscretization spaceTimeDiscretization, Exercise exercise) Creates a theta-method finite-difference solver for a one-dimensional backward PDE.- Parameters:
model- The finite-difference model providing PDE coefficients and boundary conditions.product- The product to be valued.spaceTimeDiscretization- The joint space-time discretization.exercise- The exercise specification.
-
-
Method Details
-
getValues
Description copied from interface:FDMSolverReturns the full time history of the solution on the space-time grid.Typical shapes are:
- 1D:
[nT][nS] - 2D:
[nT][nS * nV]
- 1D:
-
getValue
Description copied from interface:FDMSolverReturns the solution at a given evaluation time.This is a legacy return type. Typical shapes are:
- 1D:
[nS]representing values at the evaluation time. - 2D:
[nS * nV]representing values at the evaluation time.
- 1D:
-
getValues
public double[][] getValues(double time, double[] terminalValues) Description copied from interface:FDMSolverReturns the full time history of the solution using a precomputed terminal value vector on the spatial grid.This overload is useful for products that require a non-pointwise terminal initialization, for example cell-averaged digitals.
-
getValue
public double[] getValue(double evaluationTime, double time, double[] terminalValues) Description copied from interface:FDMSolverReturns the solution at a given evaluation time using a precomputed terminal value vector on the spatial grid.This overload is useful for products that require a non-pointwise terminal initialization, for example cell-averaged digitals.
The supplied array is interpreted as the maturity layer ordered consistently with the solver's spatial grid.
-
getValues
public double[][] getValues(double time, double[] terminalValues, DoubleUnaryOperator exerciseValue) Description copied from interface:FDMSolverDefault binary-payoff version with early exercise For solvers that are effectively 1D, the second state variable is ignored. -
getValue
public double[] getValue(double evaluationTime, double time, double[] terminalValues, DoubleUnaryOperator exerciseValue) Description copied from interface:FDMSolverDefault binary-payoff version with early exercise For solvers that are effectively 1D, the second state variable is ignored. -
getValues
public double[][] getValues(double time, double[] terminalValues, DoubleBinaryOperator continuousObstacleValue) Returns the value.- Parameters:
time- The value.terminalValues- The value.continuousObstacleValue- The value.- Returns:
- The value.
-
getValue
public double[] getValue(double evaluationTime, double time, double[] terminalValues, DoubleBinaryOperator continuousObstacleValue) Returns the value.- Parameters:
evaluationTime- The value.time- The value.terminalValues- The value.continuousObstacleValue- The value.- Returns:
- The value.
-