Class AnalyticGJRGARCHEngine
- Namespace
- NanoQL.PricingEngines
- Assembly
- NanoQL.dll
The analytic GJR-GARCH(1,1) engine for European options: Duan, Gauthier, Simonato and Sasseville's Edgeworth approximation, from the first four moments of the log return over the option's days.
public sealed class AnalyticGJRGARCHEngine
- Inheritance
-
AnalyticGJRGARCHEngine
- Inherited Members
Remarks
An immutable object over its GJRGARCHModel. It keeps the moments of each maturity it prices in a memo keyed by the day count and the rate they read, each entry QuantLib's arithmetic on the engine's model, whose parameters and curves are fixed with it, so a price is a fresh engine's bit for bit whatever the engine priced before and on whichever thread; QuantLib's engine keeps one maturity's moments and its key leaves out the rate, so a model relinked to another curve can price on the old rate.
QuantLib's prices are corrected where they're wrong: the model's time runs from the earliest curve date, as GJRGARCHProcess's; a maturity of no day prices the forward's discounted intrinsic value, where QuantLib's moments are 0/0; with a dividend yield the call is D_q times QuantLib's approximation and the put D_q·C + K·D_r − S·D_q, where QuantLib returns the price over D_q; and a payoff that isn't a plain vanilla is refused, where QuantLib returns the call's or put's value by its option type.
Two of QuantLib's defects are kept, its prices returned. Its fourth moment is wrong in the variance's own terms: where the variance is deterministic (α = γ = 0) the log return is normal, but the engine's kurtosis is about 3 − Σh, Σh the total variance, so at a daily variance of 2e-4 a year's calls at 0.9, 1 and 1.1 of the spot price 0.12%, 0.23% and 0.29% above Black-Scholes at the same variance. And its Edgeworth expansion is a density only for moderate skewness and kurtosis: against a Monte Carlo of the discrete model it approximates, the day's shock moving the log return and then the next day's variance (QuantLib's gjrgarchmodel test model from its stationary variance, spot 50, a flat 4% curve, calls at 45, 50 and 55, 180 days and a year; 2,560,000 paths on QuantLib's Mersenne twister), it errs from −3.2% to +0.3% at λ 0, down to −8.8% at λ 0.1 and from −8.3% to −32% at λ 0.2 and 180 days, and at λ 0.2 and a year its calls are negative, −0.63 to −6.60 where the model's are 10.67 to 5.55 (QuantLib's own Monte Carlo engine, daily steps of its continuous-time process, gives the model's prices within 1.3%). Where the variance's second or third moment grows without bound its prices run off: −41,067 at two years on that model at λ 0.2 (m₂ 1.0022, m₃ 1.0257), and −3.4e19 at two years at 252 days a year with α 0.05, β 0.85, γ 0.1 and λ 0.3 (m₂ 1.0135, m₃ 1.1208).
Where two of the variance's growth factors m₁, m₂ and m₃, or one of them and 1, are equal (α = β = γ = 0; an integrated GARCH), QuantLib's divided differences of their powers are 0/0 and its price NaN; here each is taken at its limit, the same polynomial in the factors, the limit of QuantLib's prices as the factors meet. QuantLib's own prices, kept bit for bit off the meeting point, lose their accuracy within about 1e-7 of all three factors meeting at 1 (α = γ = 0, β near 1), where its nested difference quotients cancel: a year's call there moves by as much as 12%.
Reference: Jin-Chuan Duan, Genevieve Gauthier, Jean-Guy Simonato, Caroline Sasseville, 2006. Approximating the GJR-GARCH and EGARCH option pricing models analytically. Journal of Computational Finance, Volume 9, Number 3, Spring 2006.
Constructors
AnalyticGJRGARCHEngine(GJRGARCHModel)
Initializes a new instance of the AnalyticGJRGARCHEngine class.
public AnalyticGJRGARCHEngine(GJRGARCHModel model)
Parameters
modelGJRGARCHModelThe model.
Exceptions
- ArgumentNullException
modelis null.
Properties
Model
Gets the model.
public GJRGARCHModel Model { get; }
Property Value
Methods
Calculate(VanillaOption, EvaluationContext)
Prices a European plain-vanilla option.
public OneAssetOptionResults Calculate(VanillaOption option, EvaluationContext context)
Parameters
optionVanillaOptionThe option.
contextEvaluationContextThe evaluation context.
Returns
- OneAssetOptionResults
The option's results: its value.
Exceptions
- ArgumentNullException
An argument is null.
- ArgumentException
The payoff isn't plain vanilla ("non-plain payoff given").
- NanoQLException
The exercise isn't European, or the underlying isn't positive.
Calculate(VanillaOption, EvaluationContext, GJRGARCHModel)
Prices a European plain-vanilla option.
public static OneAssetOptionResults Calculate(VanillaOption option, EvaluationContext context, GJRGARCHModel model)
Parameters
optionVanillaOptionThe option.
contextEvaluationContextThe evaluation context.
modelGJRGARCHModelThe model.
Returns
- OneAssetOptionResults
The option's results: its value.
Exceptions
- ArgumentNullException
An argument is null.
- ArgumentException
The payoff isn't plain vanilla ("non-plain payoff given").
- NanoQLException
The exercise isn't European, or the underlying isn't positive.