Class BarrierPathPricer
- Namespace
- NanoQL.PricingEngines
- Assembly
- NanoQL.dll
The path pricer of a barrier option with the Brownian bridge correction for the barrier's crossings between the path's points: each step's extreme is drawn from its bridge, given a uniform number of its own (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).
[WorkingType]
public sealed class BarrierPathPricer : PathPricer<MonteCarloPath>
- Inheritance
-
BarrierPathPricer
- 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, read as a view of the generator's buffer where QuantLib copies a vector per path, so a price allocates nothing. A knock-out pays its rebate at the hit's node, a knock-in at expiry.
Constructors
BarrierPathPricer(BarrierType, double, double, OptionType, double, IEnumerable<double>, StochasticProcess1D, MersenneTwisterUniformRsg)
Initializes a new instance of the BarrierPathPricer class.
public BarrierPathPricer(BarrierType barrierType, double barrier, double rebate, OptionType type, double strike, IEnumerable<double> discounts, StochasticProcess1D diffProcess, MersenneTwisterUniformRsg sequenceGen)
Parameters
barrierTypeBarrierTypeThe barrier's type.
barrierdoubleThe barrier, positive.
rebatedoubleThe rebate.
typeOptionTypeThe option type.
strikedoubleThe strike, non-negative.
discountsIEnumerable<double>The discount factors at the path's grid times.
diffProcessStochasticProcess1DThe process, whose diffusion the bridge reads at each step's start.
sequenceGenMersenneTwisterUniformRsgThe uniform sequence generator, of the grid's steps, which the pricer copies.
Exceptions
- ArgumentNullException
A reference argument is null.
- ArgumentOutOfRangeException
barrierTypeortypeisn't a member of its type.- ArgumentException
The strike is negative ("strike less than zero not allowed") or the barrier isn't positive ("barrier less/equal zero not allowed").
Methods
Evaluate(MonteCarloPath)
The discounted payoff on a path, its crossings of the barrier between points drawn from the bridge.
public override double Evaluate(MonteCarloPath path)
Parameters
pathMonteCarloPathThe path.
Returns
- double
The value.
Exceptions
- ArgumentNullException
pathis null.- NanoQLException
The path has fewer than two points.