Class TenorSwaptionVTS
- Namespace
- NanoQL.Experimental
- Assembly
- NanoQL.dll
A normal swaption volatility on a target floating tenor and fixed frequency transformed from one on a base
floating tenor and fixed frequency: QuantLib's TenorSwaptionVTS.
[Experimental("NQL0001")]
public sealed class TenorSwaptionVTS : SwaptionVolatilityStructure
- Inheritance
-
TenorSwaptionVTS
- Inherited Members
- Extension Methods
Remarks
A target swaption's smile is the base smile at a strike mapped through the tenor basis spread, under an affine terminal swap rate model fitted to the base swaption's deterministic flows, scaled by the target swap's annuity against the final swap's. A smile section is built per query, as QuantLib's, from the swaps' fair rates on the discount curve; the swaps are built in the context the structure was built with, which it keeps. The target floating schedule is on the base index's calendar, as QuantLib's.
The swaps run the swap length rounded to whole months (Divergences/TenorSwaptionLengthTests.cs): QuantLib
casts the length to whole years before it multiplies by twelve, so an 18-month tenor builds 12-month swaps; on
whole years both are QuantLib's. A swap with no coupon on or after the discount curve's reference date leaves its
flows empty, which QuantLib then reads the last of, undefined; here it is refused.
Constructors
TenorSwaptionVTS(SwaptionVolatilityStructure, YieldTermStructure, IborIndex, IborIndex, Period, Period, DayCounter, DayCounter, EvaluationContext)
Initializes a new instance of the TenorSwaptionVTS class.
public TenorSwaptionVTS(SwaptionVolatilityStructure baseVTS, YieldTermStructure discountCurve, IborIndex baseIndex, IborIndex targIndex, Period baseFixedFreq, Period targFixedFreq, DayCounter baseFixedDC, DayCounter targFixedDC, EvaluationContext context)
Parameters
baseVTSSwaptionVolatilityStructureThe base swaption volatility.
discountCurveYieldTermStructureThe discount curve.
baseIndexIborIndexThe base floating index.
targIndexIborIndexThe target floating index.
baseFixedFreqPeriodThe base swaps' fixed-leg tenor.
targFixedFreqPeriodThe target swaps' fixed-leg tenor.
baseFixedDCDayCounterThe base swaps' fixed-leg day counter.
targFixedDCDayCounterThe target swaps' fixed-leg day counter.
contextEvaluationContextThe evaluation context the swaps are built and priced in.
Exceptions
- ArgumentNullException
An argument is null.
Properties
BaseFixedDC
Gets the base swaps' fixed-leg day counter.
public DayCounter BaseFixedDC { get; }
Property Value
BaseFixedFreq
Gets the base swaps' fixed-leg tenor.
public Period BaseFixedFreq { get; }
Property Value
BaseIndex
Gets the base floating index.
public IborIndex BaseIndex { get; }
Property Value
BaseVTS
Gets the base swaption volatility.
public SwaptionVolatilityStructure BaseVTS { get; }
Property Value
Context
Gets the evaluation context the swaps are built and priced in.
public EvaluationContext Context { get; }
Property Value
DiscountCurve
Gets the discount curve.
public YieldTermStructure DiscountCurve { get; }
Property Value
MaxDate
Gets the latest date for which the curve can return values.
public override Date MaxDate { get; }
Property Value
Remarks
The base structure's.
MaxSwapTenor
Gets the largest swap tenor for which the structure returns volatilities.
public override Period MaxSwapTenor { get; }
Property Value
Remarks
The base structure's.
TargFixedDC
Gets the target swaps' fixed-leg day counter.
public DayCounter TargFixedDC { get; }
Property Value
TargFixedFreq
Gets the target swaps' fixed-leg tenor.
public Period TargFixedFreq { get; }
Property Value
TargIndex
Gets the target floating index.
public IborIndex TargIndex { get; }
Property Value
VolatilityType
Gets the type of the volatilities the structure returns; by default shifted lognormal.
public override VolatilityType VolatilityType { get; }
Property Value
Remarks
Normal.
Methods
MaxStrike()
The maximum strike for which the structure returns values.
public override double MaxStrike()
Returns
- double
The strike.
Remarks
The base structure's.
MinStrike()
The minimum strike for which the structure returns values.
public override double MinStrike()
Returns
- double
The strike.
Remarks
The base structure's.
SmileSectionImpl(double, double)
The smile section for an option time and a swap length, without range checks.
protected override SmileSection SmileSectionImpl(double optionTime, double swapLength)
Parameters
Returns
- SmileSection
The smile section.
VolatilityImpl(double, double, double)
The volatility for an option time, a swap length and a strike, without range checks.
protected override double VolatilityImpl(double optionTime, double swapLength, double strike)
Parameters
optionTimedoubleThe option time.
swapLengthdoubleThe swap length, in years.
strikedoubleThe strike.
Returns
- double
The volatility.