Table of Contents

Class AnalyticHestonEngineOptimalAlpha

Namespace
NanoQL.PricingEngines
Assembly
NanoQL.dll

The damping exponent α that minimizes the Fourier integrand's size at the origin, for the engine's control variates: Andersen and Lake's choice, QuantLib's AnalyticHestonEngine::OptimalAlpha.

public sealed class AnalyticHestonEngineOptimalAlpha
Inheritance
AnalyticHestonEngineOptimalAlpha
Inherited Members

Remarks

It searches α below −1 and above 0, each within the range where the characteristic function's moments exist (from M(double)'s explosion time), by Brent's minimization of the logarithm of the integrand at the origin, and takes the smaller minimum. Immutable: each search returns its number of evaluations with its value, where QuantLib's object counts them across its calls.

The date form reads the forward by the maturity date and the model's time from the earliest curve date, as the engine's price does; QuantLib's form takes a time and reads each curve at it, the same only where the curves share the risk-free curve's day counter and reference date (Divergences/HestonForwardByDateTests.cs, Divergences/HestonMismatchedTimesTests.cs).

Constructors

AnalyticHestonEngineOptimalAlpha(Date, AnalyticHestonEngine)

Initializes a new instance of the AnalyticHestonEngineOptimalAlpha class at a maturity date, the forward read by the date.

public AnalyticHestonEngineOptimalAlpha(Date maturity, AnalyticHestonEngine engine)

Parameters

maturity Date

The maturity.

engine AnalyticHestonEngine

The engine whose model and characteristic function the search reads.

Exceptions

ArgumentNullException

engine is null.

AnalyticHestonEngineOptimalAlpha(double, AnalyticHestonEngine)

Initializes a new instance of the AnalyticHestonEngineOptimalAlpha class at a maturity time, each curve read at it.

public AnalyticHestonEngineOptimalAlpha(double t, AnalyticHestonEngine engine)

Parameters

t double

The maturity.

engine AnalyticHestonEngine

The engine whose model and characteristic function the search reads.

Exceptions

ArgumentNullException

engine is null.

Methods

AlphaGreaterZero(double)

The search for α above 0, up to the moments' bound AlphaMax(double).

public (double Alpha, double Value, int Evaluations) AlphaGreaterZero(double strike)

Parameters

strike double

The strike.

Returns

(double Alpha, double Value, int Evaluations)

α, the integrand's logarithm there, and the search's number of evaluations.

Exceptions

NanoQLException

The bound can't be solved for, or isn't positive.

AlphaMax(double)

The largest α above 0 at which the moments exist up to the maturity.

public double AlphaMax(double strike)

Parameters

strike double

The strike, which QuantLib's bound doesn't read.

Returns

double

α.

Exceptions

NanoQLException

The bound can't be solved for, or isn't positive.

AlphaMin(double)

The smallest α below −1 at which the moments exist up to the maturity.

public double AlphaMin(double strike)

Parameters

strike double

The strike, which QuantLib's bound doesn't read.

Returns

double

α.

Exceptions

NanoQLException

The bound can't be solved for, or isn't below −1.

AlphaSmallerMinusOne(double)

The search for α below −1, down to the moments' bound AlphaMin(double).

public (double Alpha, double Value, int Evaluations) AlphaSmallerMinusOne(double strike)

Parameters

strike double

The strike.

Returns

(double Alpha, double Value, int Evaluations)

α, the integrand's logarithm there, and the search's number of evaluations.

Exceptions

NanoQLException

The bound can't be solved for, or isn't below −1.

Evaluate(double)

The optimal α for a strike: the better of the searches below −1 and above 0, or −0.5 where either fails.

public double Evaluate(double strike)

Parameters

strike double

The strike.

Returns

double

α.

EvaluateWithStatistics(double)

The optimal α for a strike, with the searches' number of evaluations.

public (double Alpha, int Evaluations) EvaluateWithStatistics(double strike)

Parameters

strike double

The strike.

Returns

(double Price, int Evaluations)

α, the better of the searches below −1 and above 0, or −0.5 where either fails; and the number of evaluations of the integrand both searches made.

K(double, int)

The moment's order at which the explosion time's argument is x, on the side sgn gives.

public double K(double x, int sgn)

Parameters

x double

The argument.

sgn int

The side, −1 or 1.

Returns

double

The order.

M(double)

The explosion time of the characteristic function's moment of order k.

public double M(double k)

Parameters

k double

The moment's order.

Returns

double

The time.