Class Swaption

java.lang.Object
net.finmath.finitedifference.interestrate.products.Swaption
All Implemented Interfaces:
FiniteDifferenceProduct<FiniteDifferenceInterestRateModel>, FiniteDifferenceInterestRateProduct, Product

public class Swaption extends Object implements FiniteDifferenceInterestRateProduct
Finite-difference valuation of a swaption under an interest-rate finite-difference model.

This class is designed to cover European, Bermudan, and American swaptions through a single Exercise field.

The product is represented as an option on the value of an underlying swap. At an admissible exercise time t, the intrinsic value is

max(V_swap(t,x), 0).

The sign convention is determined by BermudanSwaptionFromSwapSchedules.SwaptionType:

  • PAYER: intrinsic value is based on float leg minus fixed leg,
  • RECEIVER: intrinsic value is based on fixed leg minus float leg.

The class supports:

  • a single underlying swap (European or American-style grid exercise),
  • one underlying swap per exercise date (Bermudan style).

Exercise handling is implemented through the interest-rate event-condition mechanism. At each admissible exercise time t,

V(t^{-},x) = max(V(t^{+},x), intrinsic(t,x)).

American exercise is approximated on the solver time grid and is currently supported only with a single master underlying swap definition.

Assumption: the swap schedules supplied for a given exercise date should represent the remaining underlying swap from that exercise date onward. In particular, this class is intended for standard European/Bermudan swaption use cases where the exercise dates and underlying remaining swaps are specified consistently.

Author:
Alessandro Gnoatto
  • Constructor Details

    • Swaption

      public Swaption(Exercise exercise, double[] explicitExerciseDates, BermudanSwaptionFromSwapSchedules.SwaptionType swaptionType, String forwardCurveName, double[] swapRates, double[] notionals, Schedule[] fixSchedules, Schedule[] floatSchedules)
      Creates a swaption.

      If explicitExerciseDates is null, then

      • European exercise uses exercise.getMaturity(),
      • Bermudan exercise derives exercise dates from the first period start of the supplied schedules if more than one underlying swap is provided,
      • American exercise uses all solver time-grid points up to exercise.getMaturity() and requires exactly one underlying swap definition.
      Parameters:
      exercise - The exercise specification.
      explicitExerciseDates - Optional explicit exercise dates.
      swaptionType - The payer/receiver indicator.
      forwardCurveName - The forwarding-curve name. May be null.
      swapRates - The fixed rates of the underlying swaps.
      notionals - The notionals of the underlying swaps. Must be positive.
      fixSchedules - The fixed-leg schedules of the underlying swaps.
      floatSchedules - The floating-leg schedules of the underlying swaps.
    • Swaption

      public Swaption(Exercise exercise, BermudanSwaptionFromSwapSchedules.SwaptionType swaptionType, String forwardCurveName, double[] swapRates, double[] notionals, Schedule[] fixSchedules, Schedule[] floatSchedules)
      Creates a swaption without explicit exercise dates.
      Parameters:
      exercise - The exercise specification.
      swaptionType - The payer/receiver indicator.
      forwardCurveName - The forwarding-curve name. May be null.
      swapRates - The fixed rates of the underlying swaps.
      notionals - The notionals of the underlying swaps. Must be positive.
      fixSchedules - The fixed-leg schedules of the underlying swaps.
      floatSchedules - The floating-leg schedules of the underlying swaps.
  • Method Details

    • getValue

      public double[] getValue(double evaluationTime, FiniteDifferenceInterestRateModel model)
      Description copied from interface: FiniteDifferenceProduct
      Returns the value.
      Specified by:
      getValue in interface FiniteDifferenceProduct<FiniteDifferenceInterestRateModel>
      Parameters:
      evaluationTime - The value.
      model - The value.
      Returns:
      The value.
    • getValues

      public double[][] getValues(FiniteDifferenceInterestRateModel model)
      Description copied from interface: FiniteDifferenceProduct
      Returns the value.
      Specified by:
      getValues in interface FiniteDifferenceProduct<FiniteDifferenceInterestRateModel>
      Parameters:
      model - The value.
      Returns:
      The value.
    • getEventTimes

      public double[] getEventTimes()
      Description copied from interface: FiniteDifferenceInterestRateProduct
      Returns the event times of the product.

      Event times are the dates where the backward induction may have to apply a jump or another event condition, for example because of coupon accrual, coupon payment, fixing, exercise, callability, or redemption.

      Products without intermediate events may return an empty array.

      Specified by:
      getEventTimes in interface FiniteDifferenceInterestRateProduct
      Returns:
      The event times of the product.
    • getExercise

      public Exercise getExercise()
      Returns the exercise specification.
      Returns:
      The exercise specification.
    • getExplicitExerciseDates

      public double[] getExplicitExerciseDates()
      Returns the explicit exercise dates, if any.
      Returns:
      The explicit exercise dates, or null.
    • getSwaptionType

      Returns the swaption type.
      Returns:
      The swaption type.
    • getForwardCurveName

      public String getForwardCurveName()
      Returns the forwarding-curve name.
      Returns:
      The forwarding-curve name, possibly null.
    • getSwapRates

      public double[] getSwapRates()
      Returns the fixed rates of the underlying swaps.
      Returns:
      The fixed rates.
    • getNotionals

      public double[] getNotionals()
      Returns the notionals of the underlying swaps.
      Returns:
      The notionals.
    • getFixSchedules

      public Schedule[] getFixSchedules()
      Returns the fixed-leg schedules.
      Returns:
      The fixed-leg schedules.
    • getFloatSchedules

      public Schedule[] getFloatSchedules()
      Returns the floating-leg schedules.
      Returns:
      The floating-leg schedules.
    • getResolvedExerciseData

      public Swaption.ResolvedExerciseData getResolvedExerciseData(FiniteDifferenceInterestRateModel model)
      Resolves the exercise data to be used numerically under the given model.

      For American exercise, the exercise times depend on the model time grid. For European and Bermudan exercise, they are determined directly from the contractual product data.

      Parameters:
      model - The finite-difference interest-rate model.
      Returns:
      The resolved exercise data.
    • getIntrinsicValue

      public double getIntrinsicValue(double time, int scheduleIndex, double stateVariable, FiniteDifferenceInterestRateModel model)
      Returns the intrinsic value at the given time and state for the schedule indexed by scheduleIndex.
      Parameters:
      time - The running time.
      scheduleIndex - The schedule index.
      stateVariable - The state variable.
      model - The finite-difference interest-rate model.
      Returns:
      The intrinsic value.
    • getUnderlyingSwapValue

      public double getUnderlyingSwapValue(double time, int scheduleIndex, double stateVariable, FiniteDifferenceInterestRateModel model)
      Returns the underlying swap value at the given time and state for the schedule indexed by scheduleIndex.
      Parameters:
      time - The running time.
      scheduleIndex - The schedule index.
      stateVariable - The state variable.
      model - The finite-difference interest-rate model.
      Returns:
      The underlying swap value.
    • toString

      public String toString()
      Overrides:
      toString in class Object