Class Swaption
- All Implemented Interfaces:
FiniteDifferenceProduct<FiniteDifferenceInterestRateModel>, FiniteDifferenceInterestRateProduct, Product
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
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionstatic final classContainer for resolved exercise information.final classInternal resolved product with model-resolved exercise times. -
Constructor Summary
ConstructorsConstructorDescriptionSwaption(Exercise exercise, double[] explicitExerciseDates, BermudanSwaptionFromSwapSchedules.SwaptionType swaptionType, String forwardCurveName, double[] swapRates, double[] notionals, Schedule[] fixSchedules, Schedule[] floatSchedules) Creates a swaption.Swaption(Exercise exercise, BermudanSwaptionFromSwapSchedules.SwaptionType swaptionType, String forwardCurveName, double[] swapRates, double[] notionals, Schedule[] fixSchedules, Schedule[] floatSchedules) Creates a swaption without explicit exercise dates. -
Method Summary
Modifier and TypeMethodDescriptiondouble[]Returns the event times of the product.Returns the exercise specification.double[]Returns the explicit exercise dates, if any.Schedule[]Returns the fixed-leg schedules.Schedule[]Returns the floating-leg schedules.Returns the forwarding-curve name.doublegetIntrinsicValue(double time, int scheduleIndex, double stateVariable, FiniteDifferenceInterestRateModel model) Returns the intrinsic value at the given time and state for the schedule indexed byscheduleIndex.double[]Returns the notionals of the underlying swaps.Resolves the exercise data to be used numerically under the given model.double[]Returns the fixed rates of the underlying swaps.Returns the swaption type.doublegetUnderlyingSwapValue(double time, int scheduleIndex, double stateVariable, FiniteDifferenceInterestRateModel model) Returns the underlying swap value at the given time and state for the schedule indexed byscheduleIndex.double[]getValue(double evaluationTime, FiniteDifferenceInterestRateModel model) Returns the value.double[][]Returns the value.toString()Methods inherited from class Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, waitMethods inherited from interface FiniteDifferenceInterestRateProduct
applyEventCondition, getModelClassMethods inherited from interface FiniteDifferenceProduct
getValue
-
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
explicitExerciseDatesisnull, 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 benull.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.
- European exercise uses
-
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 benull.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
Description copied from interface:FiniteDifferenceProductReturns the value.- Specified by:
getValuein interfaceFiniteDifferenceProduct<FiniteDifferenceInterestRateModel>- Parameters:
evaluationTime- The value.model- The value.- Returns:
- The value.
-
getValues
Description copied from interface:FiniteDifferenceProductReturns the value.- Specified by:
getValuesin interfaceFiniteDifferenceProduct<FiniteDifferenceInterestRateModel>- Parameters:
model- The value.- Returns:
- The value.
-
getEventTimes
public double[] getEventTimes()Description copied from interface:FiniteDifferenceInterestRateProductReturns 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:
getEventTimesin interfaceFiniteDifferenceInterestRateProduct- Returns:
- The event times of the product.
-
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
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
Returns the fixed-leg schedules.- Returns:
- The fixed-leg schedules.
-
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 byscheduleIndex.- 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 byscheduleIndex.- 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
-