Class QdFpAmericanEngine
- Namespace
- NanoQL.PricingEngines
- Assembly
- NanoQL.dll
The high-performance, high-precision American engine based on a fixed-point iteration for the exercise boundary (L. Andersen, M. Lake and D. Offengenden, "High Performance American Option Pricing", 2015; L. Andersen and M. Lake, "Fast American Option Pricing: The Double-Boundary Case", 2021), seeded by QD+'s boundary.
public class QdFpAmericanEngine : QdPutCallParityEngine
- Inheritance
-
QdFpAmericanEngine
- Inherited Members
Remarks
The engine reports the value. Immutable: the three schemes QuantLib keeps as function statics are static
singletons; each price builds its boundary, and the fixed-point steps' new values give a new interpolation on the
same nodes (WithY(ReadOnlySpan<double>)), which the boundary function reads, where QuantLib updates
its interpolation in place. The static Calculate builds an engine and prices through it. An extension point,
as in QuantLib.
Constructors
QdFpAmericanEngine(GeneralizedBlackScholesProcess, QdFpIterationScheme?, QdFpAmericanEngineFixedPointEquation)
Initializes a new instance of the QdFpAmericanEngine class.
public QdFpAmericanEngine(GeneralizedBlackScholesProcess bsProcess, QdFpIterationScheme? iterationScheme = null, QdFpAmericanEngineFixedPointEquation fpEquation = QdFpAmericanEngineFixedPointEquation.Auto)
Parameters
bsProcessGeneralizedBlackScholesProcessThe Black-Scholes process.
iterationSchemeQdFpIterationSchemeThe iteration scheme, or null for AccurateScheme().
fpEquationQdFpAmericanEngineFixedPointEquationThe fixed-point equation.
Exceptions
- ArgumentNullException
bsProcessis null.- ArgumentOutOfRangeException
The equation isn't a member of its type.
Methods
AccurateScheme()
The accurate scheme, the default: Legendre-tanh-sinh (25, 5, 13)-1e-8.
public static QdFpIterationScheme AccurateScheme()
Returns
- QdFpIterationScheme
The scheme, one instance.
Calculate(VanillaOption, EvaluationContext, GeneralizedBlackScholesProcess, QdFpIterationScheme?, QdFpAmericanEngineFixedPointEquation)
Prices an American vanilla option by the fixed-point iteration.
public static OneAssetOptionResults Calculate(VanillaOption option, EvaluationContext context, GeneralizedBlackScholesProcess bsProcess, QdFpIterationScheme? iterationScheme = null, QdFpAmericanEngineFixedPointEquation fpEquation = QdFpAmericanEngineFixedPointEquation.Auto)
Parameters
optionVanillaOptionThe option.
contextEvaluationContextThe evaluation context.
bsProcessGeneralizedBlackScholesProcessThe Black-Scholes process.
iterationSchemeQdFpIterationSchemeThe iteration scheme, or null for AccurateScheme().
fpEquationQdFpAmericanEngineFixedPointEquationThe fixed-point equation.
Returns
- OneAssetOptionResults
The option's results: the value.
Exceptions
- ArgumentNullException
An argument is null.
- NanoQLException
The engine refuses the option.
CalculatePut(double, double, double, double, double, double)
The value of an American put.
protected override double CalculatePut(double s, double k, double r, double q, double vol, double t)
Parameters
sdoubleThe spot.
kdoubleThe strike.
rdoubleThe risk-free rate.
qdoubleThe dividend yield.
voldoubleThe volatility.
tdoubleThe time to expiry.
Returns
- double
The value.
FastScheme()
The fast scheme: Gauss-Legendre (7, 2, 7)-27.
public static QdFpIterationScheme FastScheme()
Returns
- QdFpIterationScheme
The scheme, one instance.
HighPrecisionScheme()
The high-precision scheme: tanh-sinh (10, 30)-1e-10.
public static QdFpIterationScheme HighPrecisionScheme()
Returns
- QdFpIterationScheme
The scheme, one instance.