Class FDMBatesADI2D

java.lang.Object
net.finmath.finitedifference.solvers.adi.AbstractADI2D
net.finmath.finitedifference.solvers.adi.FDMBatesADI2D
All Implemented Interfaces:
FDMSolver

public class FDMBatesADI2D extends AbstractADI2D
ADI finite difference solver for the two-dimensional Bates PIDE.

The local part of the Bates model is identical to the Heston model and is therefore treated by the same stabilized Douglas-type ADI splitting already implemented in AbstractADI2D.

The jump contribution is injected explicitly on the asset dimension only. In other words, the solver keeps the local ADI step unchanged and augments the explicit operator by the non-local term

integral [ u(S exp(y), v) - u(S, v) - S (exp(y) - 1) partial_S u(S, v) ]
nu(dy).

The current implementation assumes:

  • the jump component acts on state variable index 0,
  • state variables are (S, v),
  • the non-local term is treated explicitly,
  • interpolation in the asset direction is linear with constant extrapolation outside the asset grid.
Author:
Alessandro Gnoatto
  • Constructor Details

    • FDMBatesADI2D

      public FDMBatesADI2D(FDMBatesModel model, FiniteDifferenceEquityProduct product, SpaceTimeDiscretization spaceTimeDiscretization, Exercise exercise)
      Creates a Bates ADI solver with a default number of quadrature cells on each side of zero.
      Parameters:
      model - The Bates finite-difference model.
      product - The product to be valued.
      spaceTimeDiscretization - The space-time discretization.
      exercise - The exercise specification.
    • FDMBatesADI2D

      public FDMBatesADI2D(FDMBatesModel model, FiniteDifferenceEquityProduct product, SpaceTimeDiscretization spaceTimeDiscretization, Exercise exercise, int quadraturePointsPerSide)
      Creates a Bates ADI solver.
      Parameters:
      model - The Bates finite-difference model.
      product - The product to be valued.
      spaceTimeDiscretization - The space-time discretization.
      exercise - The exercise specification.
      quadraturePointsPerSide - Number of midpoint quadrature cells used on each side of zero for the jump integral.
  • Method Details

    • applyFullExplicitOperator

      protected double[] applyFullExplicitOperator(double[] u, double time)
      Returns the explicit operator used in the ADI predictor step.

      This overrides the local explicit operator by adding the non-local jump contribution evaluated on the current time layer.

      Overrides:
      applyFullExplicitOperator in class AbstractADI2D
      Parameters:
      u - The current flattened solution vector.
      time - The current running time.
      Returns:
      The explicit operator applied to u.
    • computeExplicitJumpContribution

      protected double[] computeExplicitJumpContribution(double[] u, double time)
      Computes the explicit jump contribution on the full two-dimensional grid.

      The computation is performed slice by slice in the variance direction. For each fixed variance index, the solution is viewed as a one-dimensional function of the asset variable and the jump integral is evaluated on that slice.

      Parameters:
      u - The current flattened solution vector.
      time - The current running time.
      Returns:
      The jump contribution on the full flattened grid.
    • integrateJumpContributionAtNode

      protected double integrateJumpContributionAtNode(double[] slice, double[] firstDerivative, double stock, double variance, double time, double lowerBound, double upperBound, int stockIndex)
      Computes the jump integral at one grid node.
      Parameters:
      slice - The solution values on the current variance slice.
      firstDerivative - The first asset derivative on the current slice.
      stock - The stock value at the node.
      variance - The variance value at the node.
      time - The current running time.
      lowerBound - The lower integration bound.
      upperBound - The upper integration bound.
      stockIndex - The index of the stock node on the current slice.
      Returns:
      The jump contribution at the given node.
    • midpointIntegrate

      protected double midpointIntegrate(double[] slice, double derivativeAtStock, double stock, double variance, double time, double a, double b, int numberOfCells, int stockIndex)
      Evaluates one subinterval of the jump integral by midpoint quadrature.
      Parameters:
      slice - The solution values on the current variance slice.
      derivativeAtStock - The first asset derivative at the current node.
      stock - The stock value at the current node.
      variance - The variance value at the current node.
      time - The current running time.
      a - The lower endpoint of the quadrature interval.
      b - The upper endpoint of the quadrature interval.
      numberOfCells - The number of midpoint cells.
      stockIndex - The stock index of the current node.
      Returns:
      The quadrature approximation on the given interval.
    • computeFirstDerivative

      protected double[] computeFirstDerivative(double[] grid, double[] values)
      Computes the first derivative of a one-dimensional slice.
      Parameters:
      grid - The grid in the asset direction.
      values - The values on the slice.
      Returns:
      The approximate first derivative.
    • interpolateLinearWithConstantExtrapolation

      protected double interpolateLinearWithConstantExtrapolation(double[] grid, double[] values, double x)
      Evaluates a slice at a shifted asset value by linear interpolation with constant extrapolation outside the grid range.
      Parameters:
      grid - The asset grid.
      values - The values on the current variance slice.
      x - The evaluation point.
      Returns:
      The interpolated value.
    • getModel

      public FDMBatesModel getModel()
      Returns the associated Bates model.
      Overrides:
      getModel in class AbstractADI2D
      Returns:
      The Bates model.