Table of Contents

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

atmVolStructure SwaptionVolatilityStructure

The at-the-money volatility structure; a SwaptionVolatilityDiscrete for an at-the-money-calibrated or single-pass cube.

optionTenors IEnumerable<Period>

The option tenors, positive and increasing; at least 2.

swapTenors IEnumerable<Period>

The swap tenors, positive, increasing, and in months or years; at least 2.

strikeSpreads IEnumerable<double>

The strike spreads from the at-the-money strike, increasing; at least 1.

volSpreads IEnumerable<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.

swapIndexBase SwapIndex

The swap index whose family and conventions give the at-the-money strikes of the swap tenors past the short index's.

shortSwapIndexBase SwapIndex

The swap index whose family and conventions give the at-the-money strikes of the other swap tenors.

vegaWeightedSmileFit bool

Whether the fits weight their errors by the strikes' vegas.

parametersGuess IEnumerable<IEnumerable<double>>

The guesses of α, β, ν and ρ: a row per option and swap tenor pair, laid out as the volatility spreads.

isParameterFixed IEnumerable<bool>

Whether each of α, β, ν and ρ is fixed at its guess.

isAtmCalibrated bool

Whether the cube fills and fits its dense grid.

context EvaluationContext

The evaluation context, which the at-the-money strikes read.

endCriteria EndCriteria

The fits' end criteria, or null for the SABR fit's default.

maxErrorTolerance double?

The error a fit must stay below, or null for QuantLib's 0.01, 0.0015 with vega weights.

optMethod OptimizationMethod

The fits' optimizer, or null for the SABR fit's default.

errorAccept double?

The error at or below which a fit is accepted and its restarts stop, or null for a fifth of the tolerance.

useMaxError bool

Whether a fit is scored by its maximum error, not its root-mean-square error.

maxGuesses int

The most minimizations of a fit.

backwardFlat bool

Whether the parameters are interpolated backward flat in option time.

cutoffStrike double

The lowest strike plus shift a fit takes.

singlePassCalibration bool

Whether 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

maxGuesses is 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.