Class CallSpecifiedMultiProduct
A callable product: the underlying's cash flows until the strategy calls it at an exercise time, the rebate's from then on; without a rebate, a cash rebate of 0 at the exercise times.
[WorkingType]
public class CallSpecifiedMultiProduct : MarketModelMultiProduct
- Inheritance
-
CallSpecifiedMultiProduct
- Inherited Members
Remarks
A working type, unsealed: QuantLib's upper-bound engine derives its decorated hedge from it. It steps its own clones of the underlying, the strategy and the rebate.
Its end (a documented divergence): QuantLib's end, with its underlying, is kept, but on an underlying with no
possible cash-flow times (QuantLib's MultiStepNothing), which can't end it while an exercise time remains; a
finished underlying isn't stepped again; and once ended with its underlying it stays ended, with no call and no cash
flow. QuantLib's standalone Bermudan on MultiStepNothing, done at its first step, ends at once
(Divergences/CallSpecifiedEndTests.cs).
Every count is zeroed at each step's start (a documented divergence): QuantLib writes none at a step where neither
the underlying nor the rebate steps, so the engine adds the previous step's flows again
(callspecifiedmultiproduct.cpp:144-167). A rebate of more products than the underlying, which writes past the
buffers QuantLib sizes by the underlying's, is refused; a rebate of fewer pays its own products, the others nothing
(the upper-bound engine's one-product rebate of a hedge of several, upperboundengine.cpp:124-125).
Constructors
CallSpecifiedMultiProduct(CallSpecifiedMultiProduct)
Initializes a new instance of the CallSpecifiedMultiProduct class: a deep copy.
protected CallSpecifiedMultiProduct(CallSpecifiedMultiProduct other)
Parameters
otherCallSpecifiedMultiProductThe product copied, its state included.
CallSpecifiedMultiProduct(MarketModelMultiProduct, ExerciseStrategy<CurveState>, MarketModelMultiProduct?)
Initializes a new instance of the CallSpecifiedMultiProduct class.
public CallSpecifiedMultiProduct(MarketModelMultiProduct underlying, ExerciseStrategy<CurveState> strategy, MarketModelMultiProduct? rebate = null)
Parameters
underlyingMarketModelMultiProductThe underlying, cloned.
strategyExerciseStrategy<CurveState>The exercise strategy, cloned.
rebateMarketModelMultiProductThe rebate, cloned, on the underlying's rate times, of at most its products; null for a cash rebate of 0 at the exercise times.
Exceptions
- ArgumentException
The rebate's rate times aren't the underlying's, or it has more products.
Properties
Evolution
Gets the product's evolution: its rate times and the times it steps at.
public override EvolutionDescription Evolution { get; }
Property Value
Exceptions
- NanoQLException
A composite isn't finalized.
MaxNumberOfCashFlowsPerProductPerStep
Gets the larger of the underlying's and the rebate's most cash flows at a step.
public override int MaxNumberOfCashFlowsPerProductPerStep { get; }
Property Value
NumberOfProducts
Gets the underlying's number of products.
public override int NumberOfProducts { get; }
Property Value
Rebate
Gets the rebate the product steps: its own clone.
public MarketModelMultiProduct Rebate { get; }
Property Value
Strategy
Gets the strategy the product steps: its own clone, at the product's point on the path.
public ExerciseStrategy<CurveState> Strategy { get; }
Property Value
Underlying
Gets the underlying the product steps: its own clone.
public MarketModelMultiProduct Underlying { get; }
Property Value
Methods
Clone()
A deep copy of the product, its state included.
public override MarketModelMultiProduct Clone()
Returns
- MarketModelMultiProduct
A new product.
DisableCallability()
Stops the strategy from calling the product: it pays its underlying's cash flows.
public void DisableCallability()
EnableCallability()
Lets the strategy call the product, QuantLib's default.
public void EnableCallability()
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 underlying's cash-flow times, then the rebate's.
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()
The underlying's suggested numeraires.
public override ImmutableArray<int> SuggestedNumeraires()
Returns
- ImmutableArray<int>
The numeraires.