Class SabrSwaptionVolatilityCube
- Namespace
- NanoQL.TermStructures
- Assembly
- NanoQL.dll
The SABR swaption volatility cube: QuantLib's SabrSwaptionVolatilityCube, the XABR cube on the SABR model,
whose smiles are SABRInterpolation fits and whose sections are SabrSmileSections.
public sealed class SabrSwaptionVolatilityCube : XabrSwaptionVolatilityCube<SwaptionVolCubeSabrModel>
- Inheritance
-
SabrSwaptionVolatilityCube
- Inherited Members
- Extension Methods
Remarks
QuantLib's typedef of XabrSwaptionVolatilityCube<SwaptionVolCubeSabrModel>, sealed over the generic
cube, which it adds nothing to: see XabrSwaptionVolatilityCube<TModel>.
Constructors
SabrSwaptionVolatilityCube(SwaptionVolatilityStructure, IEnumerable<Period>, IEnumerable<Period>, IEnumerable<double>, IEnumerable<IEnumerable<double>>, SwapIndex, SwapIndex, bool, IEnumerable<IEnumerable<double>>, IEnumerable<bool>, bool, EvaluationContext, EndCriteria?, double?, OptimizationMethod?, double?, bool, int, bool, double, bool)
Initializes a new instance of the SabrSwaptionVolatilityCube class, and calibrates it.
public SabrSwaptionVolatilityCube(SwaptionVolatilityStructure atmVolStructure, IEnumerable<Period> optionTenors, IEnumerable<Period> swapTenors, IEnumerable<double> strikeSpreads, IEnumerable<IEnumerable<double>> volSpreads, SwapIndex swapIndexBase, SwapIndex shortSwapIndexBase, bool vegaWeightedSmileFit, IEnumerable<IEnumerable<double>> parametersGuess, IEnumerable<bool> isParameterFixed, bool isAtmCalibrated, EvaluationContext context, EndCriteria? endCriteria = null, double? maxErrorTolerance = null, OptimizationMethod? optMethod = null, double? errorAccept = null, bool useMaxError = false, int maxGuesses = 50, bool backwardFlat = false, double cutoffStrike = 0.0001, bool singlePassCalibration = false)
Parameters
atmVolStructureSwaptionVolatilityStructureThe at-the-money volatility structure; a SwaptionVolatilityDiscrete for an at-the-money-calibrated or single-pass cube.
optionTenorsIEnumerable<Period>The option tenors, positive and increasing; at least 2.
swapTenorsIEnumerable<Period>The swap tenors, positive, increasing, and in months or years; at least 2.
strikeSpreadsIEnumerable<double>The strike spreads from the at-the-money strike, increasing; at least 1.
volSpreadsIEnumerable<IEnumerable<double>>The volatility spreads: a row per option and swap tenor pair, the pair (j, k) in row j·(swap tenors) + k, with a spread per strike spread.
swapIndexBaseSwapIndexThe swap index whose family and conventions give the at-the-money strikes of the swap tenors past the short index's.
shortSwapIndexBaseSwapIndexThe swap index whose family and conventions give the at-the-money strikes of the other swap tenors.
vegaWeightedSmileFitboolWhether the fits weight their errors by the strikes' vegas.
parametersGuessIEnumerable<IEnumerable<double>>The guesses of α, β, ν and ρ: a row per option and swap tenor pair, laid out as the volatility spreads.
isParameterFixedIEnumerable<bool>Whether each of α, β, ν and ρ is fixed at its guess.
isAtmCalibratedboolWhether the cube fills and fits its dense grid.
contextEvaluationContextThe evaluation context, which the at-the-money strikes read.
endCriteriaEndCriteriaThe fits' end criteria, or null for the SABR fit's default.
maxErrorTolerancedouble?The error a fit must stay below, or null for QuantLib's 0.01, 0.0015 with vega weights.
optMethodOptimizationMethodThe fits' optimizer, or null for the SABR fit's default.
errorAcceptdouble?The error at or below which a fit is accepted and its restarts stop, or null for a fifth of the tolerance.
useMaxErrorboolWhether a fit is scored by its maximum error, not its root-mean-square error.
maxGuessesintThe most minimizations of a fit.
backwardFlatboolWhether the parameters are interpolated backward flat in option time.
cutoffStrikedoubleThe lowest strike plus shift a fit takes.
singlePassCalibrationboolWhether the cube fits its dense grid alone, from the quoted spreads.
Exceptions
- ArgumentNullException
context, the structure, a collection or an index is null.- ArgumentException
The generic cube refuses its arguments.
- ArgumentOutOfRangeException
maxGuessesis negative.- NanoQLException
A fit fails or reaches the tolerance, an at-the-money strike can't be computed, or the dense grid reaches past the cube's.