Class Gaussian1dSwaptionEngine
- Namespace
- NanoQL.PricingEngines
- Assembly
- NanoQL.dll
The one-factor model swaption engine: a European or Bermudan swaption rolled back over a grid of a Gaussian1d model's state, each step integrating the next exercise's values' cubic spline against the state's Gaussian density.
public static class Gaussian1dSwaptionEngine
- Inheritance
-
Gaussian1dSwaptionEngine
- Inherited Members
Remarks
A static class (the playbook's engine row): Calculate runs QuantLib's four steps (playbook §2.1), the model
and QuantLib's settings arguments. Every fixed coupon whose start is on or after an exercise date is part of the
swap exercised into there. An overnight-indexed underlying is supported: a compounded coupon's daily compounding
telescopes to a zero bonds' ratio over its rate period, over the shifted value dates under an observation shift,
normalised by the coupon's own rate accrual, which is exact for plain compounding and a lookback with the shift; a
lookback without the shift and a lockout are priced as if they weren't there. A payment delay is handled statically.
Cash-settled swaptions and arithmetically averaged overnight coupons aren't supported.
One call shares one memo of the model's terms, built inside it. QuantLib's OpenMP branch, which warms the model's caches before a parallel loop, isn't ported: the loop runs in sequence, as QuantLib's default build does.
Two documented divergences. A discount or forwarding curve on another clock than the model's is read at the instants
QuantLib's arguments denote: the exercise's date in the numeraire's read and the Digital probabilities' discount,
the coupons' dates where QuantLib passes them; QuantLib's reads where the curves share a clock
(Divergences/Gaussian1dMismatchedTimesTests.cs). With flatPayoffExtrapolation, the right tail
integrates the payoff's last node, where QuantLib's integrates its second-last
(Divergences/FlatPayoffExtrapolationTests.cs).
Methods
Calculate(Swaption, EvaluationContext, Gaussian1dModel, int, double, bool, bool, YieldTermStructure?, Gaussian1dSwaptionEngineProbabilities)
Prices a swaption on a Gaussian1d model.
public static InstrumentResults Calculate(Swaption swaption, EvaluationContext context, Gaussian1dModel model, int integrationPoints = 64, double stddevs = 7, bool extrapolatePayoff = true, bool flatPayoffExtrapolation = false, YieldTermStructure? discountCurve = null, Gaussian1dSwaptionEngineProbabilities probabilities = Gaussian1dSwaptionEngineProbabilities.None)
Parameters
swaptionSwaptionThe swaption.
contextEvaluationContextThe evaluation context.
modelGaussian1dModelThe model.
integrationPointsintThe grid's points on each side of the state's mean; 64 by default.
stddevsdoubleThe grid's width, in standard deviations; 7 by default.
extrapolatePayoffboolWhether to integrate the payoff past the grid; true by default.
flatPayoffExtrapolationboolWhether past the grid the payoff is flat; false by default.
discountCurveYieldTermStructureThe discount curve; null, QuantLib's empty handle, for the model's.
probabilitiesGaussian1dSwaptionEngineProbabilitiesThe exercise probabilities to compute, an additional result; none by default.
Returns
- InstrumentResults
The swaption's results: the expired results when it has expired; with
probabilities, the additional resultprobabilities, one per exercise alive and the last the probability of no exercise.
Exceptions
- ArgumentNullException
The swaption, the context or the model is null.
- NanoQLException
The swaption's terms are inconsistent, it is cash settled at the par yield curve, or its swap's nominals aren't constant.