Class FiniteDifferenceGreekProvider

java.lang.Object
net.finmath.finitedifference.utilities.FiniteDifferenceGreekProvider

public final class FiniteDifferenceGreekProvider extends Object
Utility class for constructing Greek surfaces from finite-difference values.

The returned Greek surfaces use the same representation as product value surfaces: double[flattenedSpaceIndex][timeIndex].

Spatial derivatives are computed using local finite-difference formulas on the model grid. Interior first and second derivatives use three-point non-uniform-grid formulas. Boundary first derivatives use one-sided two-point slopes. Boundary second derivatives use the nearest three-point stencil.

The finite-difference time grid is interpreted as time-to-maturity. Therefore thetaSurface(double[][], SpaceTimeDiscretization) returns the derivative with respect to calendar evaluation time, which is the negative of the derivative with respect to time-to-maturity.

Author:
Alessandro Gnoatto
  • Method Details

    • greekSurface

      public static double[][] greekSurface(FiniteDifferenceGreek greek, double[][] values, SpaceTimeDiscretization discretization)
      Performs the operation.
      Parameters:
      greek - The value.
      values - The value.
      discretization - The value.
      Returns:
      The value.
    • deltaSurface

      public static double[][] deltaSurface(double[][] values, SpaceTimeDiscretization discretization)
      Performs the operation.
      Parameters:
      values - The value.
      discretization - The value.
      Returns:
      The value.
    • gammaSurface

      public static double[][] gammaSurface(double[][] values, SpaceTimeDiscretization discretization)
      Performs the operation.
      Parameters:
      values - The value.
      discretization - The value.
      Returns:
      The value.
    • firstDerivativeSurface

      public static double[][] firstDerivativeSurface(double[][] values, SpaceTimeDiscretization discretization, int dimension)
      Performs the operation.
      Parameters:
      values - The value.
      discretization - The value.
      dimension - The value.
      Returns:
      The value.
    • secondDerivativeSurface

      public static double[][] secondDerivativeSurface(double[][] values, SpaceTimeDiscretization discretization, int dimension)
      Performs the operation.
      Parameters:
      values - The value.
      discretization - The value.
      dimension - The value.
      Returns:
      The value.
    • mixedSecondDerivativeSurface

      public static double[][] mixedSecondDerivativeSurface(double[][] values, SpaceTimeDiscretization discretization, int firstDimension, int secondDimension)
      Performs the operation.
      Parameters:
      values - The value.
      discretization - The value.
      firstDimension - The value.
      secondDimension - The value.
      Returns:
      The value.
    • thetaSurface

      public static double[][] thetaSurface(double[][] values, SpaceTimeDiscretization discretization)
      Performs the operation.
      Parameters:
      values - The value.
      discretization - The value.
      Returns:
      The value.