Class InflationTermStructureExtensions
- Namespace
- NanoQL.TermStructures
- Assembly
- NanoQL.dll
QuantLib's InflationTermStructure::setSeasonality, which changes a built structure, as a copy of the
receiver's own type.
public static class InflationTermStructureExtensions
- Inheritance
-
InflationTermStructureExtensions
- Inherited Members
Methods
SetSeasonality<T>(T, Seasonality?, EvaluationContext)
A copy of an inflation term structure with another seasonality.
public static T SetSeasonality<T>(this T curve, Seasonality? seasonality, EvaluationContext context) where T : InflationTermStructure
Parameters
curveTThe structure; it is unchanged.
seasonalitySeasonalityThe seasonality, or null for none, as QuantLib's setter always replaces it.
contextEvaluationContextThe evaluation context, under which a bootstrapped curve's copy is bootstrapped again, from a cold start.
Returns
- T
The copy.
Type Parameters
TThe structure's type, which the copy keeps.
Remarks
QuantLib's setter changes its curve, and assigns before it checks, so a refused seasonality stays on the curve; here the receiver is unchanged whether the seasonality is accepted or refused, a documented divergence. QuantLib re-bootstraps a piecewise curve warm, from its own nodes, which differs from a fresh build by up to 7.9e-15 at QuantLib's default accuracy; here the copy is always built afresh, a documented divergence.
Exceptions
- ArgumentNullException
curveorcontextis null.- NanoQLException
The seasonality is inconsistent with the structure: the seasonality's own refusal, as a multi-year MultiplicativePriceSeasonality's, or QuantLib's "Seasonality inconsistent with inflation term structure" when its IsConsistent(InflationTermStructure) returns false.