Class MCForwardEuropeanHestonEngine
- Namespace
- NanoQL.PricingEngines
- Assembly
- NanoQL.dll
The forward-start European option pricing engine by Monte Carlo simulation on a Heston process.
public static class MCForwardEuropeanHestonEngine
- Inheritance
-
MCForwardEuropeanHestonEngine
- Inherited Members
Remarks
A static class over MCForwardVanillaEngine<TMc, TPath, TStats>, pinned to HestonProcess, QuantLib's default template argument. The paths run on the process's clock, as the Monte Carlo Heston engine runs them, the reset read at its index on the grid and the payoff discounted at expiry there; on structures dated alike, QuantLib's bits. The control variate is the vanilla struck at the moneyness times the spot, priced by AnalyticHestonEngine and simulated with its reset at the start, QuantLib's. The payoff must be plain vanilla; the seed is explicit.
Methods
Calculate<TRng, TStats>(ForwardVanillaOption, EvaluationContext, HestonProcess, int?, int?, bool, int?, double?, int?, long, bool)
Prices a forward-start European option by Monte Carlo under a Heston process.
public static OneAssetOptionResults Calculate<TRng, TStats>(ForwardVanillaOption option, EvaluationContext context, HestonProcess process, int? timeSteps, int? timeStepsPerYear, bool antitheticVariate, int? requiredSamples, double? requiredTolerance, int? maxSamples, long seed, bool controlVariate = false) where TRng : IRngTraits where TStats : IStatistics, new()
Parameters
optionForwardVanillaOptionThe option.
contextEvaluationContextThe evaluation context.
processHestonProcessThe Heston process.
timeStepsint?The number of time steps, or null for steps per year.
timeStepsPerYearint?The number of time steps per year, or null.
antitheticVariateboolWhether antithetic variates are used.
requiredSamplesint?The number of samples, or null.
requiredTolerancedouble?The absolute tolerance, or null; it takes precedence.
maxSamplesint?The most samples for a tolerance, or null for no limit.
seedlongThe seed, in [1, 4294967295].
controlVariateboolWhether the analytic vanilla is used as a control variate.
Returns
- OneAssetOptionResults
The option's results, the NPV and the error estimate; the expired results when it has expired.
Type Parameters
TRngThe random-number traits.
TStatsThe statistics accumulator.
Exceptions
- ArgumentNullException
The option, the context or the process is null.
- ArgumentException
The time steps are given neither or both ways, or aren't positive.
- ArgumentOutOfRangeException
A number of samples is negative, or the seed is outside its range.
- NanoQLException
The option's terms are invalid, its payoff isn't plain vanilla or its exercise European, neither a tolerance nor a number of samples is given, the samples can't reach the tolerance, or a step refuses.