Class AmericanPathPricer
- Namespace
- NanoQL.PricingEngines
- Assembly
- NanoQL.dll
The American early-exercise path pricer: the payoff of the underlying at a time step, the state the underlying scaled by the strike, and a polynomial basis of the state with the payoff as one more function.
public sealed class AmericanPathPricer : IEarlyExercisePathPricer<MonteCarloPath, double>
- Inheritance
-
AmericanPathPricer
- Implements
- Inherited Members
Remarks
Immutable. The state is the underlying divided by the strike where the payoff is striked, for the regression's numerical stability. The Legendre and first-kind Chebyshev bases are refused, as QuantLib refuses them; the second-kind Chebyshev basis is NaN above 1, so a call's regression, on its in-the-money paths, is refused by the singular value decomposition.
Constructors
AmericanPathPricer(Payoff, int, LsmBasisSystemPolynomialType)
Initializes a new instance of the AmericanPathPricer class.
public AmericanPathPricer(Payoff payoff, int polynomialOrder, LsmBasisSystemPolynomialType polynomialType)
Parameters
payoffPayoffThe payoff.
polynomialOrderintThe basis' highest order.
polynomialTypeLsmBasisSystemPolynomialTypeThe basis' family: monomial, Laguerre, Hermite, hyperbolic or second-kind Chebyshev.
Exceptions
- ArgumentNullException
payoffis null.- ArgumentOutOfRangeException
polynomialOrderis negative.- ArgumentException
The family is Legendre or first-kind Chebyshev ("insufficient polynomial type").
- NanoQLException
The family is unknown.
Methods
BasisSystem()
The basis: the polynomials of the state, then the payoff of the state.
public ImmutableArray<Func<double, double>> BasisSystem()
Returns
- ImmutableArray<Func<double, double>>
The basis functions.
Evaluate(MonteCarloPath, int)
The payoff of the underlying at a time step.
public double Evaluate(MonteCarloPath path, int t)
Parameters
pathMonteCarloPathThe path.
tintThe time step's index.
Returns
- double
The exercise value.
Exceptions
- ArgumentOutOfRangeException
tisn't a point of the path, where QuantLib reads past its end.
State(MonteCarloPath, int)
The scaled underlying at a time step.
public double State(MonteCarloPath path, int t)
Parameters
pathMonteCarloPathThe path.
tintThe time step's index.
Returns
- double
The state.
Exceptions
- ArgumentOutOfRangeException
tisn't a point of the path, where QuantLib reads past its end.