Class MultiStepRatchet
A full ratchet: at each rate's reset, the coupon max(g_floor · floor + s_floor, g_fixing · f + s_fixing) times the accrual, the floor then the coupon, from the initial floor.
[WorkingType]
public sealed class MultiStepRatchet : MultiProductMultiStep
- Inheritance
-
MultiStepRatchet
- Inherited Members
Remarks
A working type. Fewer accruals or payment times than rates are refused, where QuantLib reads past them.
QuantLib's sign, kept and documented: a payer ratchet receives the coupon (its multiplier is +1), where
QuantLib's swap and inverse floater pay theirs.
Constructors
MultiStepRatchet(ReadOnlySpan<double>, ReadOnlySpan<double>, ReadOnlySpan<double>, double, double, double, double, double, bool)
Initializes a new instance of the MultiStepRatchet class.
public MultiStepRatchet(ReadOnlySpan<double> rateTimes, ReadOnlySpan<double> accruals, ReadOnlySpan<double> paymentTimes, double gearingOfFloor, double gearingOfFixing, double spreadOfFloor, double spreadOfFixing, double initialFloor, bool payer = true)
Parameters
rateTimesReadOnlySpan<double>The rate times, at least two.
accrualsReadOnlySpan<double>The accruals, one a rate at least.
paymentTimesReadOnlySpan<double>The payment times, increasing, one a rate at least.
gearingOfFloordoubleThe floor's gearing.
gearingOfFixingdoubleThe fixing's gearing.
spreadOfFloordoubleThe floor's spread.
spreadOfFixingdoubleThe fixing's spread.
initialFloordoubleThe initial floor.
payerboolQuantLib's flag: true receives the coupon.
Exceptions
- ArgumentException
The times aren't increasing, or the inputs are shorter than the rates.
Properties
MaxNumberOfCashFlowsPerProductPerStep
Gets 1.
public override int MaxNumberOfCashFlowsPerProductPerStep { get; }
Property Value
NumberOfProducts
Gets 1.
public override int NumberOfProducts { get; }
Property Value
Methods
Clone()
A deep copy of the product, its state included.
public override MarketModelMultiProduct Clone()
Returns
- MarketModelMultiProduct
A new product.
NextTimeStep(CurveState, Span<int>, MarketModelMultiProductCashFlow[][])
Moves the product a step: writes each product's number of cash flows at this step and the cash flows.
public override bool NextTimeStep(CurveState currentState, Span<int> numberCashFlowsThisStep, MarketModelMultiProductCashFlow[][] cashFlowsGenerated)
Parameters
currentStateCurveStateThe state of the curve at the step's end.
numberCashFlowsThisStepSpan<int>Each product's number of cash flows, written; one entry a product.
cashFlowsGeneratedMarketModelMultiProductCashFlow[][]Each product's cash flows, written from the first; NumberOfProducts rows of at least MaxNumberOfCashFlowsPerProductPerStep.
Returns
- bool
Whether the path is finished for the product.
PossibleCashFlowTimes()
The times the product can pay at, which its cash flows' time indices index.
public override ImmutableArray<double> PossibleCashFlowTimes()
Returns
- ImmutableArray<double>
The times.
Reset()
Puts the ratchet at a path's start, its floor the initial floor.
public override void Reset()