Class StrippedOptionlet
- Namespace
- NanoQL.TermStructures
- Assembly
- NanoQL.dll
A matrix of optionlet (caplet and floorlet) volatilities, also called forward-forward volatilities, calculated elsewhere, as a StrippedOptionletBase.
public sealed class StrippedOptionlet : StrippedOptionletBase
- Inheritance
-
StrippedOptionlet
- Inherited Members
Remarks
QuantLib's quotes are their values: a new volatility is a new object. The fixing times run from the reference date, the settlement days after the context's evaluation date, computed at construction as QuantLib computes them; a later evaluation date is a new object.
The at-the-money rates are the index's fixings on the fixing dates, read from the context at each call, today's forecast, as QuantLib reads them at each call.
Constructors
StrippedOptionlet(int, Calendar, BusinessDayConvention, IborIndex, IEnumerable<Date>, IEnumerable<IEnumerable<double>>, IEnumerable<IEnumerable<double>>, DayCounter, EvaluationContext, VolatilityType, double)
Initializes a new instance of the StrippedOptionlet class with strikes per fixing date.
public StrippedOptionlet(int settlementDays, Calendar calendar, BusinessDayConvention bdc, IborIndex iborIndex, IEnumerable<Date> optionletDates, IEnumerable<IEnumerable<double>> strikes, IEnumerable<IEnumerable<double>> v, DayCounter dc, EvaluationContext context, VolatilityType type = VolatilityType.ShiftedLognormal, double displacement = 0)
Parameters
settlementDaysintThe business days from the evaluation date to the reference date.
calendarCalendarThe calendar.
bdcBusinessDayConventionThe business-day convention.
iborIndexIborIndexThe index whose fixings are the at-the-money rates.
optionletDatesIEnumerable<Date>The fixing dates, increasing, the first after the evaluation date.
strikesIEnumerable<IEnumerable<double>>The strikes: a row per fixing date, each increasing.
vIEnumerable<IEnumerable<double>>The volatilities: a row per fixing date, a volatility per strike of the row.
dcDayCounterThe day counter of the fixing times.
contextEvaluationContextThe evaluation context: its evaluation date sets the reference date.
typeVolatilityTypeThe volatilities' type.
displacementdoubleThe displacement of shifted lognormal volatilities.
Exceptions
- ArgumentNullException
A reference argument, or a row of
strikesorv, is null.- ArgumentOutOfRangeException
settlementDaysis negative, orbdcortypeisn't a member of its type.- ArgumentException
The dates, strikes and volatilities are inconsistent (QuantLib's checks).
StrippedOptionlet(int, Calendar, BusinessDayConvention, IborIndex, IEnumerable<Date>, IEnumerable<double>, IEnumerable<IEnumerable<double>>, DayCounter, EvaluationContext, VolatilityType, double)
Initializes a new instance of the StrippedOptionlet class with the same strikes at every fixing date.
public StrippedOptionlet(int settlementDays, Calendar calendar, BusinessDayConvention bdc, IborIndex iborIndex, IEnumerable<Date> optionletDates, IEnumerable<double> strikes, IEnumerable<IEnumerable<double>> v, DayCounter dc, EvaluationContext context, VolatilityType type = VolatilityType.ShiftedLognormal, double displacement = 0)
Parameters
settlementDaysintThe business days from the evaluation date to the reference date.
calendarCalendarThe calendar.
bdcBusinessDayConventionThe business-day convention.
iborIndexIborIndexThe index whose fixings are the at-the-money rates.
optionletDatesIEnumerable<Date>The fixing dates, increasing, the first after the evaluation date.
strikesIEnumerable<double>The strikes, increasing.
vIEnumerable<IEnumerable<double>>The volatilities: a row per fixing date, a volatility per strike.
dcDayCounterThe day counter of the fixing times.
contextEvaluationContextThe evaluation context: its evaluation date sets the reference date.
typeVolatilityTypeThe volatilities' type.
displacementdoubleThe displacement of shifted lognormal volatilities.
Exceptions
- ArgumentNullException
A reference argument, or a row of
v, is null.- ArgumentOutOfRangeException
settlementDaysis negative, orbdcortypeisn't a member of its type.- ArgumentException
The dates, strikes and volatilities are inconsistent (QuantLib's checks).
Properties
BusinessDayConvention
Gets the business-day convention.
public override BusinessDayConvention BusinessDayConvention { get; }
Property Value
Calendar
Gets the calendar, or null, QuantLib's empty calendar.
public override Calendar? Calendar { get; }
Property Value
DayCounter
Gets the day counter of the fixing times.
public override DayCounter DayCounter { get; }
Property Value
Displacement
Gets the displacement of shifted lognormal volatilities.
public override double Displacement { get; }
Property Value
OptionletFixingDates
Gets the optionlets' fixing dates.
public override ImmutableArray<Date> OptionletFixingDates { get; }
Property Value
OptionletFixingTimes
Gets the optionlets' fixing times.
public override ImmutableArray<double> OptionletFixingTimes { get; }
Property Value
OptionletMaturities
Gets the number of optionlet fixing dates.
public override int OptionletMaturities { get; }
Property Value
SettlementDays
Gets the settlement days; null where they weren't provided, where QuantLib throws "settlement days not provided for this instance".
public override int? SettlementDays { get; }
Property Value
- int?
VolatilityType
Gets the volatilities' type.
public override VolatilityType VolatilityType { get; }
Property Value
Methods
AtmOptionletRates(EvaluationContext)
The index's fixings on the fixing dates, with today's forecast.
public override ImmutableArray<double> AtmOptionletRates(EvaluationContext context)
Parameters
contextEvaluationContextThe evaluation context, whose fixings and forecasts the rates read.
Returns
- ImmutableArray<double>
The rates, a new array at each call.
Exceptions
- ArgumentNullException
contextis null.- NanoQLException
A fixing is missing, or the index can't forecast one.
OptionletStrikes(int)
The strikes at the i-th fixing date.
public override ImmutableArray<double> OptionletStrikes(int i)
Parameters
iintThe fixing date's index.
Returns
- ImmutableArray<double>
The strikes.
Exceptions
- ArgumentOutOfRangeException
iis negative or not less than the number of fixing dates.
OptionletVolatilities(int)
The volatilities at the i-th fixing date, one per strike.
public override ImmutableArray<double> OptionletVolatilities(int i)
Parameters
iintThe fixing date's index.
Returns
- ImmutableArray<double>
The volatilities.
Exceptions
- ArgumentOutOfRangeException
iis negative or not less than the number of fixing dates.