Class CTSMMCapletMaxHomogeneityCalibration
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
evolutionEvolutionDescriptionThe evolution: its times the correlation's and the rate times but the last.
corrPiecewiseConstantCorrelationThe swap rates' correlation.
displacedSwapVariancesReadOnlySpan<PiecewiseConstantVariance>Each swap rate's displaced variance, one per rate.
mktCapletVolsReadOnlySpan<double>The market's caplet volatilities, the last the last swaption's.
csCurveStateThe curve state; copied.
displacementdoubleThe rates' displacement.
caplet0Swaption1PrioritydoubleWhere 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
numberOfFactorsintThe factors.
innerMaxIterationsintThe fit's iterations.
innerTolerancedoubleThe fit's tolerance.
usedCapletVolsReadOnlySpan<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
evolutionEvolutionDescriptionThe evolution.
corrPiecewiseConstantCorrelationThe swap rates' correlation.
displacedSwapVariancesReadOnlySpan<PiecewiseConstantVariance>Each swap rate's displaced variance.
capletVolsReadOnlySpan<double>The caplet volatilities to fit.
csCurveStateThe curve state.
displacementdoubleThe rates' displacement.
caplet0Swaption1PrioritydoubleWhere the sphere and cylinder don't meet, the weight on the swaption.
numberOfFactorsintThe factors, from 1 to the rates.
maxIterationsintEach closest-point search's iterations; 0 projects instead.
tolerancedoubleEach 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
maxIterationsis negative.