Table of Contents

Class SquareRootCLVModel

Namespace
NanoQL.Experimental
Assembly
NanoQL.dll

The collocating local volatility (CLV) model with a square-root kernel process, its distribution non-central χ², collocated to a Black-Scholes process's distribution at given maturities: QuantLib's SquareRootCLVModel.

[Experimental("NQL0001")]
public sealed class SquareRootCLVModel
Inheritance
SquareRootCLVModel
Inherited Members

Remarks

Immutable, its mapping function computed once, on the first call of G(), as QuantLib's lazy object computes it. The collocation points are the Gauss nodes of the kernel's non-central χ² distribution (GaussNonCentralChiSquaredPolynomial, exact), their range clamped by the pMin and pMax quantiles and rescaled by QuantLib's map a·x + (xMin − x.front()), a = (xMax − xMin)/(x.back() − x.front()); where only the top bound clamps, as at every date of QuantLib's two cases, the points scale toward zero by a and the top one stops short of the pMax quantile, QuantLib's design, kept. Where that map's lowest point falls below the pMin quantile, breaking the lower bound the method states, it is raised by the shortfall: QuantLib's map with its bits wherever its lowest point meets the bound, the affine map onto [xMin, xMax] where the low bound clamps (Divergences/SquareRootCLVRescaleTests.cs).

The non-centrality 4κe^(−κt)x₀/(σ²(1 − e^(−κt))) takes 1 − e^(−κt) as −expm1(−κt) below κt 1e-2, where QuantLib's cancels, and QuantLib's form from it (Divergences/SquareRootCLVNonCentralityTests.cs). The mapping interpolates linearly in time between the maturities; past the last one QuantLib's reads its map's end before its check, and here refuses with QuantLib's text (Conventions/CLVModelTests.cs).

Constructors

SquareRootCLVModel(GeneralizedBlackScholesProcess, SquareRootProcess, IEnumerable<Date>, int, double?, double?)

Initializes a new instance of the SquareRootCLVModel class.

public SquareRootCLVModel(GeneralizedBlackScholesProcess bsProcess, SquareRootProcess sqrtProcess, IEnumerable<Date> maturityDates, int lagrangeOrder, double? pMax = null, double? pMin = null)

Parameters

bsProcess GeneralizedBlackScholesProcess

The Black-Scholes process whose distribution the model collocates.

sqrtProcess SquareRootProcess

The kernel process.

maturityDates IEnumerable<Date>

The collocation maturities.

lagrangeOrder int

The number of collocation points, at least 2 and at most 14.

pMax double?

The probability bounding the collocation points above, or null.

pMin double?

The probability bounding them below, or null.

Exceptions

ArgumentNullException

A process or the dates are null.

Methods

Cdf(Date, double)

The Black-Scholes process's cumulative distribution function at a date.

public double Cdf(Date d, double k)

Parameters

d Date

The date.

k double

The value.

Returns

double

The probability of a value at or below k.

CollocationPointsX(Date)

The kernel process's collocation points at a date, sorted and rescaled into the quantile bounds.

public Vector CollocationPointsX(Date d)

Parameters

d Date

The date.

Returns

Vector

The points.

CollocationPointsY(Date)

The underlying's collocation points at a date.

public Vector CollocationPointsY(Date d)

Parameters

d Date

The date.

Returns

Vector

The points.

G()

The CLV mapping function: the underlying's value at a time for the kernel's value then.

public Func<double, double, double> G()

Returns

Func<double, double, double>

The function of the time, from the first maturity to the last, and the kernel's value.

Exceptions

NanoQLException

A polynomial or quantile can't be computed.

InvCDF(Date, double)

The Black-Scholes process's inverse cumulative distribution function at a date.

public double InvCDF(Date d, double q)

Parameters

d Date

The date.

q double

The probability.

Returns

double

The value.