Table of Contents

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

d Date

The exercise date.

forward double

The forward, positive.

sabrParameters ReadOnlySpan<double>

α, β, ν and ρ.

referenceDate Date

The reference date.

dc DayCounter

The day counter, or null for QuantLib's default, Actual/365 (Fixed).

shift double

The shift, which must be 0.

volatilityType VolatilityType

The 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

volatilityType isn'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

timeToExpiry double

The time to expiry.

forward double

The forward, positive.

sabrParameters ReadOnlySpan<double>

α, β, ν and ρ.

shift double

The shift, which must be 0.

volatilityType VolatilityType

The 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

volatilityType isn'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

NoArbSabrModel

Methods

AtmLevel()

The at-the-money level, the forward the options are priced on.

public override double? AtmLevel()

Returns

double?

The level; null, QuantLib's Null<Real>(), where the section has none.

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

d Date

The exercise date.

forward double

The forward, positive.

sabrParameters ReadOnlySpan<double>

α, β, ν and ρ.

context EvaluationContext

The evaluation context.

dc DayCounter

The day counter, or null for QuantLib's default, Actual/365 (Fixed).

shift double

The shift, which must be 0.

volatilityType VolatilityType

The volatility type.

Returns

NoArbSabrSmileSection

The section.

Exceptions

ArgumentNullException

context is 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

strike double

The strike.

discount double

The discount factor.

gap double

The 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

strike double

The strike.

type OptionType

The option type.

discount double

The discount factor.

gap double

The 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

strike double

The strike.

type OptionType

The option type.

discount double

The discount factor.

Returns

double

The price.

VolatilityImpl(double)

The volatility at a strike.

protected override double VolatilityImpl(double strike)

Parameters

strike double

The strike.

Returns

double

The volatility.