Class BatesEngine
- Namespace
- NanoQL.PricingEngines
- Assembly
- NanoQL.dll
The analytic Bates engine: European plain-vanilla options under the Heston model with log-normal jumps, by the Fourier transform of the characteristic function, the jumps' term added to the Heston exponent.
public class BatesEngine : AnalyticHestonEngine
- Inheritance
-
BatesEngine
- Derived
- Inherited Members
Remarks
An AnalyticHestonEngine on Gatheral's formulation, as QuantLib's derives from it: an immutable object
over its BatesModel; the static Calculate overloads build one and price through it. An
extension point: BatesDetJumpEngine derives from it. The model's time, its curves and an option at
model time 0 are the analytic engine's.
References: D. Bates, Jumps and stochastic volatility: exchange rate processes implicit in Deutsche mark options, Review of Financial Studies 9, 69-107; A. Sepp, Pricing European-Style Options under Jump Diffusion Processes with Stochastic Volatility: Applications of Fourier Transform.
Constructors
BatesEngine(BatesModel, double, int)
Initializes a new instance of the BatesEngine class: adaptive Gauss-Lobatto integration.
public BatesEngine(BatesModel model, double relTolerance, int maxEvaluations)
Parameters
modelBatesModelThe Bates model.
relTolerancedoubleThe integration's relative tolerance.
maxEvaluationsintThe integration's maximum number of evaluations.
Exceptions
- ArgumentNullException
modelis null.- ArgumentOutOfRangeException
maxEvaluationsis negative.
BatesEngine(BatesModel, int)
Initializes a new instance of the BatesEngine class: Gauss-Laguerre integration.
public BatesEngine(BatesModel model, int integrationOrder = 144)
Parameters
modelBatesModelThe Bates model.
integrationOrderintThe quadrature's order, positive, at most 192.
Exceptions
- ArgumentNullException
modelis null.- ArgumentException
The order is zero or above 192.
- ArgumentOutOfRangeException
The order is negative.
Methods
AddOnTerm(double, double, int)
The log-normal jumps' term: tλ(e^{νg + δ²g²/2} − 1 − g(e^{ν + δ²/2} − 1)), g = (j == 1, φ).
protected override Complex AddOnTerm(double phi, double t, int j)
Parameters
Returns
- Complex
The term.
Calculate(VanillaOption, EvaluationContext, BatesModel, double, int)
Prices a European plain-vanilla option with adaptive Gauss-Lobatto integration.
public static OneAssetOptionResults Calculate(VanillaOption option, EvaluationContext context, BatesModel model, double relTolerance, int maxEvaluations)
Parameters
optionVanillaOptionThe option.
contextEvaluationContextThe evaluation context.
modelBatesModelThe Bates model.
relTolerancedoubleThe integration's relative tolerance.
maxEvaluationsintThe integration's maximum number of evaluations.
Returns
- OneAssetOptionResults
The option's results: its value, and the additional result "numberOfEvaluations".
Exceptions
- ArgumentNullException
An argument is null.
- ArgumentOutOfRangeException
maxEvaluationsis negative.- NanoQLException
The exercise isn't European, the payoff isn't plain vanilla, the underlying isn't positive, or the integration fails.
Calculate(VanillaOption, EvaluationContext, BatesModel, int)
Prices a European plain-vanilla option with Gauss-Laguerre integration.
public static OneAssetOptionResults Calculate(VanillaOption option, EvaluationContext context, BatesModel model, int integrationOrder = 144)
Parameters
optionVanillaOptionThe option.
contextEvaluationContextThe evaluation context.
modelBatesModelThe Bates model.
integrationOrderintThe quadrature's order, positive, at most 192.
Returns
- OneAssetOptionResults
The option's results: its value, and the additional result "numberOfEvaluations".
Exceptions
- ArgumentNullException
An argument is null.
- ArgumentException
The order is zero or above 192.
- ArgumentOutOfRangeException
The order is negative.
- NanoQLException
The exercise isn't European, the payoff isn't plain vanilla, the underlying isn't positive, or the integration fails.