Class DigitalPathPricer
- Namespace
- NanoQL.PricingEngines
- Assembly
- NanoQL.dll
The path pricer of an American cash-or-nothing option paid at the hit or at expiry: the strike's crossing within each step is detected by the Brownian bridge's maximum (or minimum), drawn from a uniform sequence of its own.
[WorkingType]
public sealed class DigitalPathPricer : PathPricer<MonteCarloPath>
- Inheritance
-
DigitalPathPricer
- Inherited Members
Remarks
A working type, as in QuantLib: it draws a new uniform sequence for each path it prices, from a copy of the generator it is given. References: Beaglehole, Dybvig and Zhou, "Going to Extremes: Correcting Simulation Bias in Exotic Option Valuation", Financial Analysts Journal, Jan/Feb 1997; El Babsiri and Noel, "Simulating path-dependent options: A new approach", Journal of Derivatives, Winter 1998.
Two documented divergences. A step's crossing probability reads the volatility at the step's start, (t_i, S_i),
where QuantLib reads it at the step's end time, diffusion(timeGrid[i+1], S_i), whose comment calls it the
initial one (Divergences/McDigitalStepVolatilityTests.cs): the same on a volatility constant in time. And
crossings count from the exercise window's opening, a path already past the strike there paid at it, where QuantLib
counts them from the start (Divergences/McDigitalWindowTests.cs); a window open from the start is QuantLib's.
Constructors
DigitalPathPricer(CashOrNothingPayoff, AmericanExercise, YieldTermStructure, StochasticProcess1D, MersenneTwisterUniformRsg)
Initializes a new instance of the DigitalPathPricer class.
public DigitalPathPricer(CashOrNothingPayoff payoff, AmericanExercise exercise, YieldTermStructure discountTS, StochasticProcess1D diffProcess, MersenneTwisterUniformRsg sequenceGen)
Parameters
payoffCashOrNothingPayoffThe cash-or-nothing payoff.
exerciseAmericanExerciseThe American exercise.
discountTSYieldTermStructureThe discount curve, whose times are the paths'.
diffProcessStochasticProcess1DThe process, whose diffusion the bridge reads and whose times are the paths'.
sequenceGenMersenneTwisterUniformRsgThe uniform sequence generator, of the grid's steps, which the pricer copies.
Exceptions
- ArgumentNullException
An argument is null.
Methods
Evaluate(MonteCarloPath)
The discounted cash where the path crosses the strike, at the crossing step's end or at expiry; else 0.
public override double Evaluate(MonteCarloPath path)
Parameters
pathMonteCarloPathThe path, on a grid holding the exercise window's opening where it opens after the start.
Returns
- double
The value.
Exceptions
- ArgumentNullException
pathis null.- NanoQLException
The path has fewer than two points, or the window opens after the start at a time its grid doesn't hold.