Class YoYInflationTermStructure
- Namespace
- NanoQL.TermStructures
- Assembly
- NanoQL.dll
The base class of year-on-year inflation term structures.
public abstract class YoYInflationTermStructure : InflationTermStructure
- Inheritance
-
YoYInflationTermStructure
- Derived
- Inherited Members
- Extension Methods
Remarks
An extension point. QuantLib's deprecated lagged yoyRate isn't ported; YoyRate(Date, bool)
computes what QuantLib's non-lagged form computes through it with a zero lag.
Constructors
YoYInflationTermStructure(Date, Date, double, Frequency, DayCounter, Seasonality?)
Initializes a new instance of the YoYInflationTermStructure class with a fixed reference date.
protected YoYInflationTermStructure(Date referenceDate, Date baseDate, double baseYoYRate, Frequency frequency, DayCounter dayCounter, Seasonality? seasonality = null)
Parameters
referenceDateDateThe reference date.
baseDateDateThe base date.
baseYoYRatedoubleThe year-on-year rate at the base date.
frequencyFrequencyThe frequency of the index the structure forecasts.
dayCounterDayCounterThe day counter.
seasonalitySeasonalityThe seasonality, or null for none.
Exceptions
- ArgumentNullException
dayCounteris null.- ArgumentException
baseDateisdefault(Date).- ArgumentOutOfRangeException
frequencyisn't a member of its type.- NanoQLException
The seasonality is inconsistent with the structure.
YoYInflationTermStructure(Date, int, Calendar, Date, double, Frequency, DayCounter, Seasonality?)
Initializes a new instance of the YoYInflationTermStructure class whose reference date was computed from settlement days and the evaluation date.
protected YoYInflationTermStructure(Date referenceDate, int settlementDays, Calendar calendar, Date baseDate, double baseYoYRate, Frequency frequency, DayCounter dayCounter, Seasonality? seasonality = null)
Parameters
referenceDateDateThe reference date, computed from the evaluation date.
settlementDaysintThe business days the reference date was computed with.
calendarCalendarThe calendar the business days were counted on.
baseDateDateThe base date.
baseYoYRatedoubleThe year-on-year rate at the base date.
frequencyFrequencyThe frequency of the index the structure forecasts.
dayCounterDayCounterThe day counter.
seasonalitySeasonalityThe seasonality, or null for none.
Exceptions
- ArgumentNullException
calendarordayCounteris null.- ArgumentException
baseDateisdefault(Date).- ArgumentOutOfRangeException
settlementDaysis negative, orfrequencyisn't a member of its type.- NanoQLException
The seasonality is inconsistent with the structure.
Methods
YoyRate(Date, bool)
The year-on-year inflation rate for a date, with the seasonality's correction: QuantLib's
yoyRate(d, extrapolate). It isn't the year-on-year swap rate, which the instrument gives.
public double YoyRate(Date d, bool extrapolate = false)
Parameters
dDateThe date; the rate is read at the start of its inflation period.
extrapolateboolWhether to extrapolate past the maximum date.
Returns
- double
The rate.
Exceptions
- NanoQLException
The period's start is before the base date, or past the maximum date without extrapolation.
YoyRate(double, bool)
The year-on-year inflation rate at a time, with no lag, period or seasonality applied: QuantLib's
yoyRate(t, extrapolate).
public double YoyRate(double t, bool extrapolate = false)
Parameters
Returns
- double
The rate.
Exceptions
- NanoQLException
The time is before the base date's, or past the maximum time without extrapolation.
YoyRateImpl(double)
The year-on-year inflation rate at a time, which a derived structure computes.
protected abstract double YoyRateImpl(double t)
Parameters
tdoubleThe time.
Returns
- double
The rate.