Class MarketModelDiscounter
The number of numeraire bonds a unit paid at a time is worth on a curve state: the discount ratio of the rate times bracketing the payment, log-linearly interpolated between them.
public sealed class MarketModelDiscounter
- Inheritance
-
MarketModelDiscounter
- Inherited Members
Remarks
Immutable: a pure function of a curve state.
The bracket (a documented divergence): the period's start is the last rate time at or before the payment,
clamped to the periods, so a payment inside a period interpolates its own period's bonds. QuantLib's
lower_bound takes the first rate time at or after the payment (discounter.cpp:31), so a payment
strictly inside a period but the last is extrapolated from the next period, against its own weight's [0, 1] form
(Divergences/MarketModelDiscounterBracketTests.cs). A payment on a rate time, before the first or after the
last gives QuantLib's bits.
Constructors
MarketModelDiscounter(double, ReadOnlySpan<double>)
Initializes a new instance of the MarketModelDiscounter class.
public MarketModelDiscounter(double paymentTime, ReadOnlySpan<double> rateTimes)
Parameters
paymentTimedoubleThe payment time.
rateTimesReadOnlySpan<double>The rate times, at least two, increasing.
Exceptions
- ArgumentException
There are fewer than two rate times, or they aren't increasing.
Methods
NumeraireBonds(CurveState, int)
The number of numeraire bonds a unit paid at the payment time is worth.
public double NumeraireBonds(CurveState curveState, int numeraire)
Parameters
curveStateCurveStateThe curve state.
numeraireintThe numeraire's index.
Returns
- double
The number of numeraire bonds.