Class MarketModelPathwiseCashRebate
The receipt of a fixed cash amount, once, for the pathwise engines: each step pays each product its amount for that step, its derivatives 0, and finishes the path.
[WorkingType]
public sealed class MarketModelPathwiseCashRebate : MarketModelPathwiseMultiProduct
- Inheritance
-
MarketModelPathwiseCashRebate
- Inherited Members
Remarks
A working type; the amounts are copied at construction. A rebate stepped more often than its payment times is refused, where QuantLib reads past its amounts.
Constructors
MarketModelPathwiseCashRebate(EvolutionDescription, ReadOnlySpan<double>, Matrix, int)
Initializes a new instance of the MarketModelPathwiseCashRebate class.
public MarketModelPathwiseCashRebate(EvolutionDescription evolution, ReadOnlySpan<double> paymentTimes, Matrix amounts, int numberOfProducts)
Parameters
evolutionEvolutionDescriptionThe evolution, one evolution time per payment time.
paymentTimesReadOnlySpan<double>The payment times, increasing.
amountsMatrixThe amounts, a row per product and a column per payment time.
numberOfProductsintThe number of products.
Exceptions
- ArgumentException
The payment times aren't increasing, or the amounts or the evolution don't fit them and the products.
- ArgumentOutOfRangeException
numberOfProductsis negative.
Properties
AlreadyDeflated
Gets false.
public override bool AlreadyDeflated { get; }
Property Value
Evolution
Gets the product's evolution: its rate times and the times it steps at.
public override EvolutionDescription Evolution { get; }
Property Value
MaxNumberOfCashFlowsPerProductPerStep
Gets 1.
public override int MaxNumberOfCashFlowsPerProductPerStep { get; }
Property Value
NumberOfProducts
Gets the number of products.
public override int NumberOfProducts { get; }
Property Value
Methods
Clone()
A deep copy of the product, its state included.
public override MarketModelPathwiseMultiProduct Clone()
Returns
- MarketModelPathwiseMultiProduct
A new product.
NextTimeStep(CurveState, Span<int>, MarketModelPathwiseMultiProductCashFlow[][])
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, MarketModelPathwiseMultiProductCashFlow[][] 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.
cashFlowsGeneratedMarketModelPathwiseMultiProductCashFlow[][]Each product's cash flows, written from the first; NumberOfProducts rows of at least MaxNumberOfCashFlowsPerProductPerStep, each of 1 + the number of rates amounts.
Returns
- bool
Whether the path is finished for the product.
Exceptions
- NanoQLException
The rebate is stepped past its payment times.
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 product at the start of a path.
public override void Reset()
SuggestedNumeraires()
Refused, as QuantLib's: a rebate suggests no numeraire.
public override ImmutableArray<int> SuggestedNumeraires()
Returns
- ImmutableArray<int>
Never returns.
Exceptions
- NanoQLException
Always.