Table of Contents

Class CTSMMCapletMaxHomogeneityCalibration

Namespace
NanoQL.Models
Assembly
NanoQL.dll

The maximally homogeneous coterminal swap market model caplet calibration: each caplet fitted by moving the next swap rate's volatilities to the point closest to its given ones on the sphere of its swaption variance and the cylinder of the caplet's, the caplet or the swaption favoured where they don't meet.

public sealed class CTSMMCapletMaxHomogeneityCalibration : CTSMMCapletCalibration
Inheritance
CTSMMCapletMaxHomogeneityCalibration
Inherited Members

Remarks

Immutable. CapletMaxHomogeneityCalibration(EvolutionDescription, PiecewiseConstantCorrelation, ReadOnlySpan<PiecewiseConstantVariance>, ReadOnlySpan<double>, CurveState, double, double, int, int, double) returns its pass's pseudo-roots, failures, deformation size and swaption error in place of QuantLib's out-parameters.

One departure from QuantLib (Divergences/CTSMMCapletMaxHomogeneityDeformationTests.cs): the deformation size sums each moved volatility's squared change, where QuantLib's loop adds the step index's own change once per volatility (capletcoterminalmaxhomogeneity.cpp:370-371).

Constructors

CTSMMCapletMaxHomogeneityCalibration(EvolutionDescription, PiecewiseConstantCorrelation, ReadOnlySpan<PiecewiseConstantVariance>, ReadOnlySpan<double>, CurveState, double, double)

Initializes a new instance of the CTSMMCapletMaxHomogeneityCalibration class.

public CTSMMCapletMaxHomogeneityCalibration(EvolutionDescription evolution, PiecewiseConstantCorrelation corr, ReadOnlySpan<PiecewiseConstantVariance> displacedSwapVariances, ReadOnlySpan<double> mktCapletVols, CurveState cs, double displacement, double caplet0Swaption1Priority = 1)

Parameters

evolution EvolutionDescription

The evolution: its times the correlation's and the rate times but the last.

corr PiecewiseConstantCorrelation

The swap rates' correlation.

displacedSwapVariances ReadOnlySpan<PiecewiseConstantVariance>

Each swap rate's displaced variance, one per rate.

mktCapletVols ReadOnlySpan<double>

The market's caplet volatilities, the last the last swaption's.

cs CurveState

The curve state; copied.

displacement double

The rates' displacement.

caplet0Swaption1Priority double

Where the sphere and cylinder don't meet, the weight on the swaption: 0 fits the caplet, 1 the swaption.

Exceptions

ArgumentException

The inputs don't fit, or the priority isn't in [0, 1].

Methods

CalibrationImpl(int, int, double, ReadOnlySpan<double>)

One pass's fit of the swap rates' pseudo-roots to the caplet volatilities in use.

protected override CTSMMCapletCalibrationStep CalibrationImpl(int numberOfFactors, int innerMaxIterations, double innerTolerance, ReadOnlySpan<double> usedCapletVols)

Parameters

numberOfFactors int

The factors.

innerMaxIterations int

The fit's iterations.

innerTolerance double

The fit's tolerance.

usedCapletVols ReadOnlySpan<double>

The caplet volatilities in use.

Returns

CTSMMCapletCalibrationStep

The pass's pseudo-roots and failures, and what the calibration computes besides.

CapletMaxHomogeneityCalibration(EvolutionDescription, PiecewiseConstantCorrelation, ReadOnlySpan<PiecewiseConstantVariance>, ReadOnlySpan<double>, CurveState, double, double, int, int, double)

One pass of the maximally homogeneous calibration.

public static CTSMMCapletCalibrationStep CapletMaxHomogeneityCalibration(EvolutionDescription evolution, PiecewiseConstantCorrelation corr, ReadOnlySpan<PiecewiseConstantVariance> displacedSwapVariances, ReadOnlySpan<double> capletVols, CurveState cs, double displacement, double caplet0Swaption1Priority, int numberOfFactors, int maxIterations, double tolerance)

Parameters

evolution EvolutionDescription

The evolution.

corr PiecewiseConstantCorrelation

The swap rates' correlation.

displacedSwapVariances ReadOnlySpan<PiecewiseConstantVariance>

Each swap rate's displaced variance.

capletVols ReadOnlySpan<double>

The caplet volatilities to fit.

cs CurveState

The curve state.

displacement double

The rates' displacement.

caplet0Swaption1Priority double

Where the sphere and cylinder don't meet, the weight on the swaption.

numberOfFactors int

The factors, from 1 to the rates.

maxIterations int

Each closest-point search's iterations; 0 projects instead.

tolerance double

Each closest-point search's tolerance.

Returns

CTSMMCapletCalibrationStep

The swap rates' pseudo-roots, the failures (the caplets where the sphere and cylinder don't meet), the deformation size and the sum of the squared swaption errors.

Exceptions

ArgumentException

The inputs don't fit, or the factors aren't from 1 to the rates.

ArgumentOutOfRangeException

maxIterations is negative.