Class MonteCarloCatBondEngine
- Namespace
- NanoQL.Experimental
- Assembly
- NanoQL.dll
The Monte Carlo cat bond engine: each simulated path of the catastrophe risk's events writes the bond's notional path, whose cash flows, each scaled by the notional left on its date, are discounted and averaged.
[Experimental("NQL0001")]
public static class MonteCarloCatBondEngine
- Inheritance
-
MonteCarloCatBondEngine
- Inherited Members
Remarks
The path count is a parameter, 10,000 by default and refused at 0, and a simulation with no path is refused ("no
Monte Carlo paths were generated"), where 1.44 caps the count at a constant and divides 0 by 0: QuantLib's fix from
its master after the pin (#2839; Divergences/MonteCarloCatBondEngineTests.cs). The loss statistics are the
valuation date's simulation's.
Methods
Calculate(CatBond, EvaluationContext, CatRisk, YieldTermStructure, bool?, int)
Prices a cat bond.
public static CatBondResults Calculate(CatBond bond, EvaluationContext context, CatRisk catRisk, YieldTermStructure discountCurve, bool? includeSettlementDateFlows = null, int maxPaths = 10000)
Parameters
bondCatBondThe bond.
contextEvaluationContextThe evaluation context.
catRiskCatRiskThe catastrophe risk.
discountCurveYieldTermStructureThe discount curve.
includeSettlementDateFlowsbool?Whether flows on the settlement date count; the context's IncludeReferenceDateEvents when null.
maxPathsintThe paths simulated at most.
Returns
- CatBondResults
The bond's results.
Exceptions
- ArgumentNullException
An argument but
includeSettlementDateFlowsis null.- ArgumentOutOfRangeException
maxPathsisn't positive ("maxPaths must be positive").- NanoQLException
The simulation gives no path ("no Monte Carlo paths were generated"), or a curve refuses a date.