Class AnalyticTwoAssetCorrelationEngine
- Namespace
- NanoQL.PricingEngines
- Assembly
- NanoQL.dll
The analytic engine for a European two-asset correlation option: M. Zhang, "Exotic Options", World Scientific (1998); E. G. Haug, "The Complete Guide to Option Pricing Formulas", 2nd edition (2007).
public static class AnalyticTwoAssetCorrelationEngine
- Inheritance
-
AnalyticTwoAssetCorrelationEngine
- Inherited Members
Remarks
The value alone, as QuantLib's. The bivariate normal is QuantLib's default,
BivariateCumulativeNormalDistributionWe04DP, where QuantLib's engine reads Drezner's 1978 algorithm,
to six decimal places (Divergences/TwoAssetCorrelationBivariateTests.cs). The second asset's volatility is
read at its own strike X₂, where QuantLib reads it at X₁ (Divergences/TwoAssetCorrelationSmileTests.cs). At
X₂ < 0 the call is linear in the second asset where the first is in the money and the put worth nothing, where
QuantLib takes the log of a negative ratio (Divergences/TwoAssetCorrelationNegativeStrikeTests.cs).
Each asset's carry reads its own process's curves and the payoff is discounted on the first process's risk-free
curve, where QuantLib takes the rate from the first process alone
(Divergences/TwoAssetTwoRiskFreeCurvesTests.cs).
Every rate and volatility is read over the time to expiry on the clock across both processes
(NanoQL.Methods.FdmBlackScholesOp.ClockAcross(System.Collections.Generic.IReadOnlyList{NanoQL.Processes.GeneralizedBlackScholesProcess})), each structure at the instants that time denotes, accruing nothing
before its date, where QuantLib reads each volatility at its own process's time and everything else at the second
process's; a structure sharing the clock's times is read as QuantLib reads it
(Divergences/TwoAssetMismatchedTimesTests.cs).
Methods
Calculate(TwoAssetCorrelationOption, EvaluationContext, GeneralizedBlackScholesProcess, GeneralizedBlackScholesProcess, double)
Prices a European two-asset correlation option: QuantLib's calculate.
public static MultiAssetOptionResults Calculate(TwoAssetCorrelationOption option, EvaluationContext context, GeneralizedBlackScholesProcess p1, GeneralizedBlackScholesProcess p2, double correlation)
Parameters
optionTwoAssetCorrelationOptionThe option.
contextEvaluationContextThe evaluation context.
p1GeneralizedBlackScholesProcessThe first asset's process.
p2GeneralizedBlackScholesProcessThe second asset's process.
correlationdoubleThe correlation of the two assets, in [−1, 1].
Returns
- MultiAssetOptionResults
The option's results: the value.
Exceptions
- ArgumentNullException
An argument is null.
- ArgumentException
The correlation is outside [−1, 1].
- NanoQLException
The first strike or the first spot isn't positive.