Class FiniteDifferenceExerciseUtil

java.lang.Object
net.finmath.finitedifference.FiniteDifferenceExerciseUtil

public final class FiniteDifferenceExerciseUtil extends Object
Utility methods adapting a general Exercise specification to finite-difference solvers working in time-to-maturity coordinates.

Finite-difference solvers in this project use time-to-maturity tau = maturity - t. Exercise specifications are given in running time t. This class performs the required conversion and can refine the time discretization so that all Bermudan exercise dates are represented exactly.

Author:
Alessandro Gnoatto
  • Method Details

    • getExerciseTimesToMaturity

      public static double[] getExerciseTimesToMaturity(Exercise exercise)
      Returns the exercise times in time-to-maturity coordinates.
      Parameters:
      exercise - The exercise specification.
      Returns:
      The exercise times in tau = maturity - t.
    • refineTimeDiscretization

      public static TimeDiscretization refineTimeDiscretization(TimeDiscretization baseTimeDiscretization, Exercise exercise)
      Returns a refined time discretization that includes all Bermudan exercise dates in time-to-maturity coordinates.

      European and American exercise return the base discretization unchanged.

      Parameters:
      baseTimeDiscretization - The original time discretization in tau.
      exercise - The exercise specification.
      Returns:
      A refined time discretization in tau.
    • isExerciseAllowedAtTimeToMaturity

      public static boolean isExerciseAllowedAtTimeToMaturity(double tau, Exercise exercise)
      Returns true if exercise is allowed at the given time-to-maturity.
      Parameters:
      tau - The time-to-maturity.
      exercise - The exercise specification.
      Returns:
      True if exercise is allowed.
    • isContinuousExercise

      public static boolean isContinuousExercise(Exercise exercise)
      Returns true if the exercise policy should be treated as continuous on the FD grid.
      Parameters:
      exercise - The exercise specification.
      Returns:
      True if the policy is continuous.
    • isDiscreteExerciseTime

      public static boolean isDiscreteExerciseTime(double tau, Exercise exercise)
      Returns true if the given tau-grid time is an actual Bermudan exercise time.
      Parameters:
      tau - The time-to-maturity.
      exercise - The exercise specification.
      Returns:
      True if tau corresponds to a Bermudan exercise date.
    • getAmericanExerciseStartTimeToMaturity

      public static double getAmericanExerciseStartTimeToMaturity(Exercise exercise)
      Convenience method returning the exercise start time in tau-coordinates for American exercise.
      Parameters:
      exercise - The exercise specification.
      Returns:
      The corresponding tau value, or 0.0 if not applicable.