Class FDMThetaMethod1D

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

public class FDMThetaMethod1D extends Object implements FDMSolver
Theta-method solver for a one-dimensional PDE in state-variable form.

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

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

    Methods inherited from class Object

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

    Methods inherited from interface FDMSolver

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

      public double[][] getValues(double time, DoubleUnaryOperator valueAtMaturity)
      Description copied from interface: FDMSolver
      Returns the full time history of the solution on the space-time grid.

      Typical shapes are:

      • 1D: [nT][nS]
      • 2D: [nT][nS * nV]
      Specified by:
      getValues in interface FDMSolver
      Parameters:
      time - The maturity (time to maturity).
      valueAtMaturity - The payoff function applied at maturity.
      Returns:
      The full time-space solution.
    • getValue

      public double[] getValue(double evaluationTime, double time, DoubleUnaryOperator valueAtMaturity)
      Description copied from interface: FDMSolver
      Returns 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.
      Specified by:
      getValue in interface FDMSolver
      Parameters:
      evaluationTime - The evaluation time.
      time - The maturity (time to maturity).
      valueAtMaturity - The payoff function applied at maturity.
      Returns:
      The solution at the specified evaluation time.
    • getValues

      public double[][] getValues(double time, double[] terminalValues)
      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.
      terminalValues - The terminal values on the spatial grid.
      Returns:
      The full time-space solution.
    • getValue

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

      Specified by:
      getValue in interface FDMSolver
      Parameters:
      evaluationTime - The evaluation time.
      time - The maturity time.
      terminalValues - The terminal values on the spatial grid.
      Returns:
      The value vector at the requested evaluation time.
    • getValues

      public double[][] getValues(double time, double[] terminalValues, DoubleUnaryOperator exerciseValue)
      Description copied from interface: FDMSolver
      Default binary-payoff version with early exercise For solvers that are effectively 1D, the second state variable is ignored.
      Specified by:
      getValues in interface FDMSolver
      Parameters:
      time - The value.
      terminalValues - The value.
      exerciseValue - The value.
      Returns:
      The value.
    • getValue

      public double[] getValue(double evaluationTime, double time, double[] terminalValues, DoubleUnaryOperator exerciseValue)
      Description copied from interface: FDMSolver
      Default binary-payoff version with early exercise For solvers that are effectively 1D, the second state variable is ignored.
      Specified by:
      getValue in interface FDMSolver
      Parameters:
      evaluationTime - The value.
      time - The value.
      terminalValues - The value.
      exerciseValue - The value.
      Returns:
      The value.
    • 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.