Class FDMThetaMethod1DTwoState
- All Implemented Interfaces:
FDMSolver
Regime 0 = not yet activated (barrier not yet hit). Regime 1 = already activated (barrier has been hit).
This implementation is matrix-free:
- The active regime is solved on the full grid using a tridiagonal theta step.
- The inactive regime is solved only on the continuation-side subgrid.
- On the already-hit region and at the barrier interface, the coupling
between inactive
and active regimes is governed by a
TwoStateActivationPolicy.
Supports European, Bermudan, and American exercise in the active regime.
- Author:
- Alessandro Gnoatto
-
Constructor Summary
ConstructorsConstructorDescriptionFDMThetaMethod1DTwoState(net.finmath.finitedifference.assetderivativevaluation.models.FiniteDifferenceEquityModel model, net.finmath.finitedifference.assetderivativevaluation.products.FiniteDifferenceOneDimensionalKnockInProduct product, net.finmath.finitedifference.grids.SpaceTimeDiscretization spaceTimeDiscretization, Exercise exercise, TwoStateActiveBoundaryProvider activeBoundaryProvider) Creates a direct two-state theta-method solver for one-dimensional knock- in products.FDMThetaMethod1DTwoState(net.finmath.finitedifference.assetderivativevaluation.models.FiniteDifferenceEquityModel model, net.finmath.finitedifference.assetderivativevaluation.products.FiniteDifferenceOneDimensionalKnockInProduct product, net.finmath.finitedifference.grids.SpaceTimeDiscretization spaceTimeDiscretization, Exercise exercise, TwoStateActiveBoundaryProvider activeBoundaryProvider, TwoStateActivationPolicy activationPolicy) Creates a direct two-state theta-method solver with an explicit activation policy. -
Method Summary
Modifier and TypeMethodDescriptiondouble[]getValue(double evaluationTime, double time, DoubleUnaryOperator valueAtMaturity) Returns the inactive-regime value vector at the requested evaluation time.double[][]getValues(double time, double[] valueAtMaturity) Returns the full time history of the solution using a precomputed terminal value vector on the spatial grid.double[][]getValues(double time, DoubleUnaryOperator valueAtMaturity) Solves the two-state backward PDE on the full space-time grid and returns the inactive-regime value surface.
-
Constructor Details
-
FDMThetaMethod1DTwoState
public FDMThetaMethod1DTwoState(net.finmath.finitedifference.assetderivativevaluation.models.FiniteDifferenceEquityModel model, net.finmath.finitedifference.assetderivativevaluation.products.FiniteDifferenceOneDimensionalKnockInProduct product, net.finmath.finitedifference.grids.SpaceTimeDiscretization spaceTimeDiscretization, Exercise exercise, TwoStateActiveBoundaryProvider activeBoundaryProvider) Creates a direct two-state theta-method solver for one-dimensional knock- in products.The solver evolves two coupled value functions:
- the inactive regime, representing the contract value before the barrier has been hit,
- the active regime, representing the value after activation, which behaves like the corresponding activated claim.
The active regime is solved on the full spatial grid, while the inactive regime is solved only on the portion of the grid where the barrier has not yet been triggered. The already-hit region and the continuation-side interface are coupled through the default continuation- style activation policy.
- Parameters:
model- The finite-difference equity model providing local PDE coefficients and discounting.product- The knock-in product to be valued.spaceTimeDiscretization- The spatial and temporal discretization, including the theta parameter.exercise- The exercise specification. Bermudan and American exercise are applied only to the active regime.activeBoundaryProvider- Provider for the boundary values of the already-activated regime.
-
FDMThetaMethod1DTwoState
public FDMThetaMethod1DTwoState(net.finmath.finitedifference.assetderivativevaluation.models.FiniteDifferenceEquityModel model, net.finmath.finitedifference.assetderivativevaluation.products.FiniteDifferenceOneDimensionalKnockInProduct product, net.finmath.finitedifference.grids.SpaceTimeDiscretization spaceTimeDiscretization, Exercise exercise, TwoStateActiveBoundaryProvider activeBoundaryProvider, TwoStateActivationPolicy activationPolicy) Creates a direct two-state theta-method solver with an explicit activation policy.The activation policy controls:
- the inactive value on the already-hit region at maturity,
- the inactive value on the already-hit region during backward stepping,
- the interface value seen by the continuation-side inactive PDE at the barrier.
- Parameters:
model- The finite-difference equity model providing local PDE coefficients and discounting.product- The knock-in product to be valued.spaceTimeDiscretization- The spatial and temporal discretization, including the theta parameter.exercise- The exercise specification. Bermudan and American exercise are applied only to the active regime.activeBoundaryProvider- Provider for the boundary values of the already-activated regime.activationPolicy- Policy governing activation coupling between inactive and active regimes.
-
-
Method Details
-
getValues
Solves the two-state backward PDE on the full space-time grid and returns the inactive-regime value surface.At maturity, the active regime equals the supplied activated payoff, while the inactive regime equals either the activation-policy value on the already-hit region or the product's inactive terminal value on the not-yet-hit region. The method then steps backward in time:
- solving the activated regime on the full grid,
- solving the non-activated regime on the continuation-side subgrid,
- applying the activation policy on the already-hit region and at the barrier interface.
The returned surface stores the inactive-regime values only, since these represent the contract value prior to barrier activation.
-
getValues
public double[][] getValues(double time, double[] valueAtMaturity) 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
Returns the inactive-regime value vector at the requested evaluation time.- Specified by:
getValuein interfaceFDMSolver- Parameters:
evaluationTime- The time at which the value vector is requested.time- The maturity time of the claim.valueAtMaturity- The terminal payoff as a function of the state variable.- Returns:
- The inactive-regime value vector across the spatial grid at the specified evaluation time.
-