Class ZeroYieldStructure
- Namespace
- NanoQL.TermStructures
- Assembly
- NanoQL.dll
A zero-yield term structure: an adapter to YieldTermStructure that lets a derived class implement only ZeroYieldImpl(double); discount factors and forward rates are calculated from the zero yields, which are continuously compounded with an annual time unit.
public abstract class ZeroYieldStructure : YieldTermStructure
- Inheritance
-
ZeroYieldStructure
- Derived
- Inherited Members
- Extension Methods
Remarks
An extension point, as in QuantLib: the interpolated zero and forward curves derive from it. QuantLib's constructor
taking settlement days is YieldTermStructure's reference-date constructor with the settlement days
given, the reference date computed by the derived class's Create(…, context) factory.
Constructors
ZeroYieldStructure(Date, Calendar?, DayCounter, int?, IEnumerable<double>?, IEnumerable<Date>?)
Initializes a new instance of the ZeroYieldStructure class with a fixed reference date.
protected ZeroYieldStructure(Date referenceDate, Calendar? calendar, DayCounter dc, int? settlementDays = null, IEnumerable<double>? jumps = null, IEnumerable<Date>? jumpDates = null)
Parameters
referenceDateDateThe reference date.
calendarCalendarThe calendar, or null, QuantLib's empty calendar.
dcDayCounterThe day counter used for date/time conversion.
settlementDaysint?The settlement days the reference date was calculated with, if any.
jumpsIEnumerable<double>The discount-factor jumps, or null for none.
jumpDatesIEnumerable<Date>The jumps' dates, or null for 31 December of successive years.
Exceptions
- ArgumentException
Jump dates are given and their number differs from the jumps', or one of them is
default(Date).
Methods
DiscountImpl(double)
The discount factor at a time, calculated from the zero yield: exp(−z·t), and 1 at time 0.
protected override double DiscountImpl(double t)
Parameters
tdoubleThe time.
Returns
- double
The discount factor.
ZeroYieldImpl(double)
The zero yield at a time, continuously compounded. Range checks have already been performed, so it must assume that extrapolation is required.
protected abstract double ZeroYieldImpl(double t)
Parameters
tdoubleThe time.
Returns
- double
The zero yield.