Class NoArbSabrSmileSection
- Namespace
- NanoQL.Experimental
- Assembly
- NanoQL.dll
A smile section on Doust's no-arbitrage SABR model: its prices, digitals and density are the model's, its volatilities those prices' implied Black volatilities, the SABR expansion's where none is found.
[Experimental("NQL0001")]
public sealed class NoArbSabrSmileSection : SmileSection
- Inheritance
-
NoArbSabrSmileSection
- Inherited Members
Remarks
Immutable, the model built at construction. QuantLib's section dated by a date floats with the evaluation date; here the date's constructor takes the reference date, and Create(Date, double, ReadOnlySpan<double>, EvaluationContext, DayCounter?, double, VolatilityType) the context.
Constructors
NoArbSabrSmileSection(Date, double, ReadOnlySpan<double>, Date, DayCounter?, double, VolatilityType)
Initializes a new instance of the NoArbSabrSmileSection class at an exercise date.
public NoArbSabrSmileSection(Date d, double forward, ReadOnlySpan<double> sabrParameters, Date referenceDate, DayCounter? dc = null, double shift = 0, VolatilityType volatilityType = VolatilityType.ShiftedLognormal)
Parameters
dDateThe exercise date.
forwarddoubleThe forward, positive.
sabrParametersReadOnlySpan<double>α, β, ν and ρ.
referenceDateDateThe reference date.
dcDayCounterThe day counter, or null for QuantLib's default, Actual/365 (Fixed).
shiftdoubleThe shift, which must be 0.
volatilityTypeVolatilityTypeThe volatility type.
Exceptions
- ArgumentException
There are fewer than four parameters, the forward isn't positive, the shift isn't 0, a date is
default(Date), or the model refuses the parameters.- ArgumentOutOfRangeException
volatilityTypeisn't a member of its type.- NanoQLException
The model's integration fails.
NoArbSabrSmileSection(double, double, ReadOnlySpan<double>, double, VolatilityType)
Initializes a new instance of the NoArbSabrSmileSection class at a time to expiry.
public NoArbSabrSmileSection(double timeToExpiry, double forward, ReadOnlySpan<double> sabrParameters, double shift = 0, VolatilityType volatilityType = VolatilityType.ShiftedLognormal)
Parameters
timeToExpirydoubleThe time to expiry.
forwarddoubleThe forward, positive.
sabrParametersReadOnlySpan<double>α, β, ν and ρ.
shiftdoubleThe shift, which must be 0.
volatilityTypeVolatilityTypeThe volatility type.
Exceptions
- ArgumentException
There are fewer than four parameters, the forward isn't positive, the shift isn't 0, or the model refuses the parameters.
- ArgumentOutOfRangeException
volatilityTypeisn't a member of its type.- NanoQLException
The model's integration fails.
Properties
Model
Gets the no-arbitrage SABR model.
public NoArbSabrModel Model { get; }
Property Value
Methods
AtmLevel()
The at-the-money level, the forward the options are priced on.
public override double? AtmLevel()
Returns
Create(Date, double, ReadOnlySpan<double>, EvaluationContext, DayCounter?, double, VolatilityType)
Creates the section at an exercise date, its reference date the context's evaluation date.
public static NoArbSabrSmileSection Create(Date d, double forward, ReadOnlySpan<double> sabrParameters, EvaluationContext context, DayCounter? dc = null, double shift = 0, VolatilityType volatilityType = VolatilityType.ShiftedLognormal)
Parameters
dDateThe exercise date.
forwarddoubleThe forward, positive.
sabrParametersReadOnlySpan<double>α, β, ν and ρ.
contextEvaluationContextThe evaluation context.
dcDayCounterThe day counter, or null for QuantLib's default, Actual/365 (Fixed).
shiftdoubleThe shift, which must be 0.
volatilityTypeVolatilityTypeThe volatility type.
Returns
- NoArbSabrSmileSection
The section.
Exceptions
- ArgumentNullException
contextis null.- ArgumentException
There are fewer than four parameters, the forward isn't positive, the shift isn't 0, a date is
default(Date), or the model refuses the parameters.- NanoQLException
The model's integration fails.
Density(double, double, double)
The model's density at a strike; the gap isn't read.
public override double Density(double strike, double discount = 1, double gap = 0.0001)
Parameters
strikedoubleThe strike.
discountdoubleThe discount factor.
gapdoubleThe gap, which the model's exact density doesn't read.
Returns
- double
The density.
DigitalOptionPrice(double, OptionType, double, double)
The model's digital price at a strike, a put as its complement; the gap isn't read.
public override double DigitalOptionPrice(double strike, OptionType type = OptionType.Call, double discount = 1, double gap = 1E-05)
Parameters
strikedoubleThe strike.
typeOptionTypeThe option type.
discountdoubleThe discount factor.
gapdoubleThe gap, which the model's exact digital doesn't read.
Returns
- double
The price.
MaxStrike()
The maximum strike for which the section returns volatilities.
public override double MaxStrike()
Returns
- double
The strike.
MinStrike()
The minimum strike for which the section returns volatilities.
public override double MinStrike()
Returns
- double
The strike.
OptionPrice(double, OptionType, double)
The model's price at a strike, a put by parity.
public override double OptionPrice(double strike, OptionType type = OptionType.Call, double discount = 1)
Parameters
strikedoubleThe strike.
typeOptionTypeThe option type.
discountdoubleThe discount factor.
Returns
- double
The price.
VolatilityImpl(double)
The volatility at a strike.
protected override double VolatilityImpl(double strike)
Parameters
strikedoubleThe strike.
Returns
- double
The volatility.