Class FdHullWhiteSwaptionEngine
- Namespace
- NanoQL.PricingEngines
- Assembly
- NanoQL.dll
The finite-difference Hull-White swaption engine: the swaption rolled back on a mesh of the model's factor, its exercise value the swap's inner value on the model's curves (FdmAffineModelSwapInnerValue<TModel>).
public static class FdHullWhiteSwaptionEngine
- Inheritance
-
FdHullWhiteSwaptionEngine
- Inherited Members
Remarks
A static class: Calculate runs QuantLib's four steps (playbook §2.1) on the model, an argument where QuantLib's
engine holds it. The mesher is the factor's Ornstein-Uhlenbeck quantiles up to the last exercise; the swap's
coupons forecast on a Hull-White with the model's parameters on the index's curve, which must share the discount
curve's day counter and reference date, as QuantLib refuses otherwise; the value is read at the factor's origin.
An American exercise reaches the inner value at times off its exercise dates, which it refuses.
Methods
Calculate(Swaption, EvaluationContext, HullWhite, int, int, int, double, FdmSchemeDesc?)
Prices a swaption on a Hull-White model by finite differences.
public static InstrumentResults Calculate(Swaption swaption, EvaluationContext context, HullWhite model, int tGrid = 100, int xGrid = 100, int dampingSteps = 0, double invEps = 1E-05, FdmSchemeDesc? schemeDesc = null)
Parameters
swaptionSwaptionThe swaption.
contextEvaluationContextThe evaluation context.
modelHullWhiteThe Hull-White model.
tGridintThe number of time steps.
xGridintThe number of points of the factor's mesher.
dampingStepsintThe number of damping steps.
invEpsdoubleThe probability of the mesher's ends' quantiles.
schemeDescFdmSchemeDesc?
Returns
- InstrumentResults
The swaption's results, the NPV alone: the expired results when it has expired.
Exceptions
- ArgumentNullException
The swaption, the context or the model is null.
- ArgumentOutOfRangeException
A grid size or the number of damping steps is negative.
- ArgumentException
The mesher has no point.
- NanoQLException
The swaption's terms are inconsistent, an exercise date is past, the index has no curve or one on another day counter or reference date, the exercise is American, or a step fails.