Class FDMThetaMethod1DTwoState

java.lang.Object
net.finmath.finitedifference.solvers.FDMThetaMethod1DTwoState
All Implemented Interfaces:
FDMSolver

public class FDMThetaMethod1DTwoState extends Object implements FDMSolver
Direct two-state theta-method solver for 1D knock-in barrier-style products.

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

    Constructors
    Constructor
    Description
    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.
    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 Type
    Method
    Description
    double[]
    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.

    Methods inherited from class Object

    clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait

    Methods inherited from interface FDMSolver

    getValue, getValue, getValue, getValues, getValues
  • 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

      public 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.

      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.

      Specified by:
      getValues in interface FDMSolver
      Parameters:
      time - The maturity time of the product.
      valueAtMaturity - The terminal payoff of the activated regime as a function of the state variable.
      Returns:
      The inactive-regime solution surface indexed as values[spaceIndex][timeIndex].
    • getValues

      public double[][] getValues(double time, double[] valueAtMaturity)
      Description copied from interface: FDMSolver
      Returns 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.

      Specified by:
      getValues in interface FDMSolver
      Parameters:
      time - The maturity time.
      valueAtMaturity - The terminal values on the spatial grid.
      Returns:
      The full time-space solution.
    • getValue

      public double[] getValue(double evaluationTime, double time, DoubleUnaryOperator valueAtMaturity)
      Returns the inactive-regime value vector at the requested evaluation time.
      Specified by:
      getValue in interface FDMSolver
      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.