Table of Contents

Struct NoArbSabr

Namespace
NanoQL.Experimental
Assembly
NanoQL.dll

The no-arbitrage SABR interpolation factory: builds a NoArbSabrInterpolation with its parameters over given points. Global: a change to one point changes the whole fit.

[Experimental("NQL0001")]
public readonly struct NoArbSabr : IInterpolator
Implements
Inherited Members

Constructors

NoArbSabr(double, double, double?, double?, double?, double?, bool, bool, bool, bool, bool, EndCriteria?, OptimizationMethod?, double, bool, int)

Initializes a new instance of the NoArbSabr struct.

public NoArbSabr(double t, double forward, double? alpha, double? beta, double? nu, double? rho, bool alphaIsFixed, bool betaIsFixed, bool nuIsFixed, bool rhoIsFixed, bool vegaWeighted = false, EndCriteria? endCriteria = null, OptimizationMethod? optMethod = null, double errorAccept = 0.002, bool useMaxError = false, int maxGuesses = 50)

Parameters

t double

The time to expiry.

forward double

The forward.

alpha double?

α's guess, or null for the default.

beta double?

β's guess, or null for the default.

nu double?

ν's guess, or null for the default.

rho double?

ρ's guess, or null for the default.

alphaIsFixed bool

Whether α is fixed at its guess.

betaIsFixed bool

Whether β is fixed at its guess.

nuIsFixed bool

Whether ν is fixed at its guess.

rhoIsFixed bool

Whether ρ is fixed at its guess.

vegaWeighted bool

Whether the errors are weighted by the strikes' Black vegas.

endCriteria EndCriteria

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

optMethod OptimizationMethod

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

errorAccept double

The error at or below which a fit is accepted.

useMaxError bool

Whether a fit is scored by its maximum error.

maxGuesses int

The most minimizations.

Exceptions

ArgumentOutOfRangeException

maxGuesses is negative.

Methods

CheckPoints(int)

Runs the checks QuantLib's interpolation makes when it is built over a number of points, before it reads their values: the fewest points its implementation takes, and the counts its configuration needs.

public void CheckPoints(int points)

Parameters

points int

The number of points.

Remarks

The bootstraps read it on their first pass: QuantLib builds a curve's interpolation over its first nodes before their values are solved (interpolateWithoutUpdate), and takes linear interpolation where a global interpolation refuses to be built over that many points (iterativebootstrap.hpp:295-310). Interpolate(ReadOnlySpan<double>, ReadOnlySpan<double>) runs every check, these and the ones on the values alike. The default refuses none, so a factory of one's own keeps compiling; a factory overrides it with its construction checks, so that a curve on it takes the fallback where QuantLib's would.

Exceptions

ArgumentException

The interpolation can't be built over that many points.

NanoQLException

The interpolation's configuration can't be built over that many points.

InvalidOperationException

This is the zero value, which QuantLib can't construct.

Interpolate(ReadOnlySpan<double>, ReadOnlySpan<double>)

Builds and fits a NoArbSabrInterpolation over the given points.

public Interpolation Interpolate(ReadOnlySpan<double> x, ReadOnlySpan<double> y)

Parameters

x ReadOnlySpan<double>

The strikes, sorted.

y ReadOnlySpan<double>

The volatilities, one per strike.

Returns

Interpolation

The interpolation.

Exceptions

InvalidOperationException

This is the zero value, which QuantLib can't construct.

ArgumentException

The interpolation refuses the points or the parameters.

NanoQLException

The optimizer or the model fails.

Explicit Interface Implementations

Global

Gets a value indicating whether the interpolation is global: QuantLib's global, true.

static bool Global { get; }

Returns

bool

RequiredPoints

Gets the fewest points the interpolation takes.

static int RequiredPoints { get; }

Returns

int