Class MCAmericanBasketEngine
- Namespace
- NanoQL.PricingEngines
- Assembly
- NanoQL.dll
The Longstaff-Schwartz Monte Carlo engine for American and Bermudan basket options on correlated processes.
public static class MCAmericanBasketEngine
- Inheritance
-
MCAmericanBasketEngine
- Inherited Members
Remarks
The method is intrinsically weak for out-of-the-money options, as QuantLib warns. The pricing and the calibration draw from the same traits; the value, its error estimate where the traits allow one, and the exercise probability among the additional results as "exerciseProbability", as QuantLib's. The calibration is one call's working state.
The paths run on the clock spanning every Black-Scholes process's structures, each process read on it, and the
payoffs are discounted on the first process's risk-free curve at that clock's times, where QuantLib evolves every
process on the first's times (Divergences/TwoAssetMismatchedTimesTests.cs); a market on one clock keeps
QuantLib's arithmetic.
Methods
Calculate<TRng, TStats>(BasketOption, EvaluationContext, StochasticProcessArray, int?, int?, bool, bool, int?, double?, int?, long, int?, int, LsmBasisSystemPolynomialType, long?)
Prices an American or Bermudan basket option by Longstaff-Schwartz.
public static MultiAssetOptionResults Calculate<TRng, TStats>(BasketOption option, EvaluationContext context, StochasticProcessArray processes, int? timeSteps, int? timeStepsPerYear, bool brownianBridge, bool antitheticVariate, int? requiredSamples, double? requiredTolerance, int? maxSamples, long seed, int? nCalibrationSamples = null, int polynomialOrder = 2, LsmBasisSystemPolynomialType polynomialType = LsmBasisSystemPolynomialType.Monomial, long? seedCalibration = null) where TRng : IRngTraits where TStats : IStatistics, new()
Parameters
optionBasketOptionThe basket option, of an early exercise.
contextEvaluationContextThe evaluation context.
processesStochasticProcessArrayThe assets' correlated processes, the first a Black-Scholes process.
timeStepsint?The number of time steps, or null for steps per year.
timeStepsPerYearint?The number of time steps per year, or null.
brownianBridgeboolWhether the draws are ordered by a Brownian bridge.
antitheticVariateboolWhether antithetic variates are used.
requiredSamplesint?The number of samples, or null.
requiredTolerancedouble?The absolute tolerance, or null.
maxSamplesint?The most samples for a tolerance, or null.
seedlongThe seed, in [1, 4294967295].
nCalibrationSamplesint?The calibration samples, or null for 2,048.
polynomialOrderintThe regression basis' highest order.
polynomialTypeLsmBasisSystemPolynomialTypeThe regression basis' family.
seedCalibrationlong?The calibration seed, in [1, 4294967295], or null for the Longstaff-Schwartz base's default; QuantLib's engine takes none, and its base's default is always 4294967295, the narrowed null, which passing that seed reproduces.
Returns
- MultiAssetOptionResults
The option's results: the value, its error estimate, and the exercise probability.
Type Parameters
TRngThe random number traits of both simulations.
TStatsThe statistics accumulator.
Exceptions
- ArgumentNullException
An argument is null.
- ArgumentException
The steps are given neither or both ways or aren't positive, or the basis family is another.
- ArgumentOutOfRangeException
A number of samples is negative, or the seed is outside its range.
- NanoQLException
The first process isn't a Black-Scholes process, the exercise isn't early or pays at expiry, or the samples can't reach the tolerance.