Table of Contents

Class MCDiscreteArithmeticAPHestonEngine

Namespace
NanoQL.PricingEngines
Assembly
NanoQL.dll

The Monte Carlo engine for discrete arithmetic average-price Asian options on a Heston process, with the geometric average as an optional control variate priced by AnalyticDiscreteGeometricAveragePriceAsianHestonEngine.

public static class MCDiscreteArithmeticAPHestonEngine
Inheritance
MCDiscreteArithmeticAPHestonEngine
Inherited Members

Remarks

The value and, where the generator allows one, its error estimate, with the grid as the additional result "TimeGrid", as QuantLib's: a static class over a private simulation deriving MCDiscreteAveragingAsianEngineBase<TMc, TPath, TStats> on multi-variate paths, the grid the fixing times with the steps or steps per year given, the seed explicit. The process is HestonProcess or a process deriving it, QuantLib's template parameter P. The control is the unseasoned geometric average on the fixings to come, its analytic value the engine's on the same contract, as QuantLib's.

Documented divergences. The paths and the discount run on the engine's clock, Clock(HestonProcess, FdmQuantoHelper?, LocalVolTermStructure?), from the earliest reference date of the structures, where QuantLib's run on the risk-free curve's (Divergences/AsianMismatchedTimesTests.cs); a fixing date given twice counts twice in both averages (Divergences/AsianDuplicateFixingsTests.cs); the control's analytic value is the corrected engine's.

Methods

Calculate<TRng, TStats>(DiscreteAveragingAsianOption, EvaluationContext, HestonProcess, bool, int?, double?, int?, long, int?, int?, bool)

Prices a discrete arithmetic average-price Asian option by Monte Carlo on a Heston process.

public static OneAssetOptionResults Calculate<TRng, TStats>(DiscreteAveragingAsianOption option, EvaluationContext context, HestonProcess process, bool antitheticVariate, int? requiredSamples, double? requiredTolerance, int? maxSamples, long seed, int? timeSteps = null, int? timeStepsPerYear = null, bool controlVariate = false) where TRng : IRngTraits where TStats : IStatistics, new()

Parameters

option DiscreteAveragingAsianOption

The option.

context EvaluationContext

The evaluation context.

process HestonProcess

The Heston process.

antitheticVariate bool

Whether antithetic variates are used.

requiredSamples int?

The number of samples, or null.

requiredTolerance double?

The absolute tolerance, or null; it takes precedence.

maxSamples int?

The most samples for a tolerance, or null for no limit.

seed long

The seed, in [1, 4294967295].

timeSteps int?

The number of time steps, or null.

timeStepsPerYear int?

The number of time steps per year, or null.

controlVariate bool

Whether the geometric average is a control variate.

Returns

OneAssetOptionResults

The option's results, the NPV, the error estimate and the grid; the expired results when it has expired.

Type Parameters

TRng

The random-number traits.

TStats

The statistics accumulator.

Exceptions

ArgumentNullException

The option, the context or the process is null.

ArgumentException

Both the time steps and the time steps per year are given.

ArgumentOutOfRangeException

A number of samples or steps is negative, or the seed is outside its range.

NanoQLException

The option's past fixings fail its checks, the payoff isn't plain vanilla, the exercise isn't European, every fixing is in the past, or the samples can't reach the tolerance.