Class PearsonSpreadEngine
- Namespace
- NanoQL.PricingEngines
- Assembly
- NanoQL.dll
Pearson's engine for a European spread option on two futures: the Black price conditional on the second asset, integrated over its driving normal by Gauss-Lobatto quadrature; N. D. Pearson, "An Efficient Approach for Pricing Spread Options", Journal of Derivatives 3 (1995), 76-91.
public sealed class PearsonSpreadEngine : SpreadBlackScholesVanillaEngine
- Inheritance
-
PearsonSpreadEngine
- Inherited Members
Remarks
Immutable. Where the conditional strike is zero or less a put's conditional value is 0, where QuantLib takes the
call's intrinsic value whatever the type (Divergences/PearsonNegativeStrikePutTests.cs).
Constructors
PearsonSpreadEngine(GeneralizedBlackScholesProcess, GeneralizedBlackScholesProcess, double, double, int, double)
Initializes a new instance of the PearsonSpreadEngine class.
public PearsonSpreadEngine(GeneralizedBlackScholesProcess process1, GeneralizedBlackScholesProcess process2, double correlation, double integrationTolerance = 1E-10, int maxIntegrationIterations = 10000, double nStd = 8)
Parameters
process1GeneralizedBlackScholesProcessThe first asset's process.
process2GeneralizedBlackScholesProcessThe second asset's process.
correlationdoubleThe correlation of the two assets.
integrationTolerancedoubleThe quadrature's absolute accuracy.
maxIntegrationIterationsintThe quadrature's iteration limit.
nStddoubleThe standard deviations either side of zero the integral spans.
Exceptions
- ArgumentNullException
A process is null.
Methods
Calculate(BasketOption, EvaluationContext, GeneralizedBlackScholesProcess, GeneralizedBlackScholesProcess, double, double, int, double)
Prices a European spread option by Pearson's integral.
public static MultiAssetOptionResults Calculate(BasketOption option, EvaluationContext context, GeneralizedBlackScholesProcess process1, GeneralizedBlackScholesProcess process2, double correlation, double integrationTolerance = 1E-10, int maxIntegrationIterations = 10000, double nStd = 8)
Parameters
optionBasketOptionThe option, on a SpreadBasketPayoff over a plain vanilla payoff.
contextEvaluationContextThe evaluation context.
process1GeneralizedBlackScholesProcessThe first asset's process.
process2GeneralizedBlackScholesProcessThe second asset's process.
correlationdoubleThe correlation of the two assets.
integrationTolerancedoubleThe quadrature's absolute accuracy.
maxIntegrationIterationsintThe quadrature's iteration limit.
nStddoubleThe standard deviations either side of zero the integral spans.
Returns
- MultiAssetOptionResults
The option's results: the value; the expired results when it has expired.
Exceptions
- ArgumentNullException
An argument is null.
- NanoQLException
The exercise isn't European, the payoff isn't a spread payoff over a plain vanilla payoff, or the quadrature doesn't converge.
Calculate(double, double, double, OptionType, double, double, double)
The value of a spread option on two forwards.
protected override double Calculate(double f1, double f2, double strike, OptionType optionType, double variance1, double variance2, double df)
Parameters
f1doubleThe first forward.
f2doubleThe second forward.
strikedoubleThe strike.
optionTypeOptionTypeThe option's type.
variance1doubleThe first forward's Black variance to expiry.
variance2doubleThe second forward's Black variance to expiry.
dfdoubleThe discount factor to expiry.
Returns
- double
The value.