Class TreeCallableZeroCouponBondEngine
- Namespace
- NanoQL.Experimental
- Assembly
- NanoQL.dll
The numerical lattice engine for callable zero-coupon bonds: QuantLib's subclass of the fixed-rate bonds' engine, which only adds constructors, so each overload is TreeCallableFixedRateBondEngine's.
[Experimental("NQL0001")]
public static class TreeCallableZeroCouponBondEngine
- Inheritance
-
TreeCallableZeroCouponBondEngine
- Inherited Members
Methods
Calculate(CallableBond, EvaluationContext, ShortRateModel, Lattice, YieldTermStructure?, double)
Prices a callable bond on a lattice already built from the model.
public static CallableBondResults Calculate(CallableBond bond, EvaluationContext context, ShortRateModel model, Lattice lattice, YieldTermStructure? termStructure = null, double spread = 0)
Parameters
bondCallableBondThe bond.
contextEvaluationContextThe evaluation context, which gives the bond's settlement date.
modelShortRateModelThe short-rate model the lattice was built from.
latticeLatticeThe lattice, whose grid must hold the bond's mandatory times.
termStructureYieldTermStructureThe discount curve when the model isn't term-structure consistent, or null.
spreaddoubleThe continuously compounded spread added to the lattice's short rates.
Returns
- CallableBondResults
The bond's results, as TreeCallableFixedRateBondEngine's.
Exceptions
- ArgumentNullException
A required argument is null.
- NanoQLException
The grid misses a mandatory time; the bond's arguments are inconsistent; the model needs a term structure and none is given, QuantLib's empty handle; or a spread is given for a lattice that isn't a one-factor short-rate tree.
Calculate(CallableBond, EvaluationContext, ShortRateModel, TimeGrid, YieldTermStructure?, double)
Prices a callable bond on the model's tree, on a time grid.
public static CallableBondResults Calculate(CallableBond bond, EvaluationContext context, ShortRateModel model, TimeGrid timeGrid, YieldTermStructure? termStructure = null, double spread = 0)
Parameters
bondCallableBondThe bond.
contextEvaluationContextThe evaluation context, which gives the bond's settlement date.
modelShortRateModelThe short-rate model.
timeGridTimeGridThe tree's time grid, which must hold the bond's mandatory times.
termStructureYieldTermStructureThe discount curve when the model isn't term-structure consistent, or null.
spreaddoubleThe continuously compounded spread added to the tree's short rates.
Returns
- CallableBondResults
The bond's results, as TreeCallableFixedRateBondEngine's.
Exceptions
- ArgumentNullException
A required argument is null.
- NanoQLException
The grid can't hold a tree, or misses a mandatory time; the bond's arguments are inconsistent; the model needs a term structure and none is given, QuantLib's empty handle; or the model's tree takes no spread.
Calculate(CallableBond, EvaluationContext, ShortRateModel, int, YieldTermStructure?, double)
Prices a callable bond on the model's tree, with a number of time steps.
public static CallableBondResults Calculate(CallableBond bond, EvaluationContext context, ShortRateModel model, int timeSteps, YieldTermStructure? termStructure = null, double spread = 0)
Parameters
bondCallableBondThe bond.
contextEvaluationContextThe evaluation context, which gives the bond's settlement date.
modelShortRateModelThe short-rate model.
timeStepsintThe number of time steps of the tree, on a grid through the bond's mandatory times.
termStructureYieldTermStructureThe discount curve when the model isn't term-structure consistent, or null.
spreaddoubleThe continuously compounded spread added to the tree's short rates.
Returns
- CallableBondResults
The bond's results, as TreeCallableFixedRateBondEngine's.
Exceptions
- ArgumentNullException
A required argument is null.
- ArgumentOutOfRangeException
timeStepsis negative.- ArgumentException
timeStepsis 0.- NanoQLException
The bond's arguments are inconsistent; the model needs a term structure and none is given, QuantLib's empty handle; or the model's tree takes no spread.