Class FiniteDifferenceGreekProvider
java.lang.Object
net.finmath.finitedifference.utilities.FiniteDifferenceGreekProvider
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 Summary
Modifier and TypeMethodDescriptionstatic double[][]deltaSurface(double[][] values, SpaceTimeDiscretization discretization) Performs the operation.static double[][]firstDerivativeSurface(double[][] values, SpaceTimeDiscretization discretization, int dimension) Performs the operation.static double[][]gammaSurface(double[][] values, SpaceTimeDiscretization discretization) Performs the operation.static double[][]greekSurface(FiniteDifferenceGreek greek, double[][] values, SpaceTimeDiscretization discretization) Performs the operation.static double[][]mixedSecondDerivativeSurface(double[][] values, SpaceTimeDiscretization discretization, int firstDimension, int secondDimension) Performs the operation.static double[][]secondDerivativeSurface(double[][] values, SpaceTimeDiscretization discretization, int dimension) Performs the operation.static double[][]thetaSurface(double[][] values, SpaceTimeDiscretization discretization) Performs the operation.
-
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
Performs the operation.- Parameters:
values- The value.discretization- The value.- Returns:
- The value.
-
gammaSurface
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
Performs the operation.- Parameters:
values- The value.discretization- The value.- Returns:
- The value.
-