|
From: Luigi B. <lui...@gm...> - 2021-12-28 15:39:40
|
Hi,
I'm not very familiar with those engines, but from the interface I'd
say that the variance gamma process can be only used
with AnalyticVarianceGammaEngine and FFTVarianceGammaEngine
(FFTVanillaEngine uses Black/Scholes, and FFTEngine is the base class of
the other two FFT engines). From what I can see, the analytic engine
performs a numerical integration to calculate the expected option value
(the "integral approach" mentioned in the docs) while the FFT engines
implement the quoted paper. Not sure about the pros and cons.
Hope this helps,
Luigi
On Wed, Dec 1, 2021 at 3:36 AM Peng Yu <pen...@gm...> wrote:
>
> https://github.com/lballabio/QuantLib/tree/f47242c966d191e1b542162b1f2d726615bdba89/ql/experimental/variancegamma
>
> Are you talking about the above?
>
> I see there are 4 engines.
>
> - analyticvariancegammaengine
> - fftengine
> - fftvanillaengine
> - fftvariancegammaengine
>
> I see the following doc.
>
> analyticvariancegammaengine:
> //! Variance Gamma Pricing engine for European vanilla options
> using integral approach
>
> What is integral approach? Is there a doc explaining what it is?
>
> fftengine:
>
> The FFT engine calculates the values of all options with the
> same expiry at the same time.
> For that reason it is very inefficient to price options
> individually. When using this engine
> you should collect all the options you wish to price in a list and
> call
> the engine's precalculate method before calling the NPV method
> of the option.
> References:
> Carr, P. and D. B. Madan (1998),
> "Option Valuation using the fast Fourier transform,"
> Journal of Computational Finance, 2, 61-73.
>
> fftvanillaengine
> //! FFT Pricing engine vanilla options under a Black Scholes process
> /*! \ingroup vanillaengines
> \test the correctness of the returned values is tested by
> comparison with Black Scholes pricing.
>
> fftvariancegammaengine
> //! FFT engine for vanilla options under a Variance Gamma process
> /*! \ingroup vanillaengines
> \test the correctness of the returned values is tested by
> comparison with known good values and the analytic approach
>
> But it is confusing to me about whether all four can be used with
> ql.VarianceGammaProcess, or only analyticvariancegammaengine and
> fftvariancegammaengine can be used with ql.VarianceGammaProcess.
>
> I don't see these engines documented in python. Is the doc incomplete?
> Could you explain the difference between them, what is the pros and
> cons of each engine, and when to use which engine?
>
>
> https://quantlib-python-docs.readthedocs.io/en/latest/search.html?q=fftengine&check_keywords=yes&area=default#
>
> Could you show an example of how to use ql.VarianceGammaProcess in python?
>
> On 11/30/21, Luigi Ballabio <lui...@gm...> wrote:
> > Hi,
> > there's a couple of engines supporting the VarianceGammaProcess (you
> > can find them in ql/experimenta/variancegamma) but they only support
> > European options. The two papers you quoted are not implemented.
> >
> > Luigi
> >
> >
> > On Tue, Nov 30, 2021 at 4:03 PM Peng Yu <pen...@gm...> wrote:
> >
> >> I see the following two methods in this direction.
> >>
> >> Pricing American Options Under Variance Gamma
> >> https://www.math.columbia.edu/~smirnov/Alihirsa.pdf
> >>
> >> A fast method for pricing American options under the variance gamma
> model
> >> http://arxiv-export-lb.library.cornell.edu/abs/1903.07519v1
> >>
> >> I also notice there is VarianceGammaProcess in quantlib. Does
> >> VarianceGammaProcess implement any of these two methods? Or it is
> >> something totally different?
> >>
> >> I want to model American options. I tried the following code (full
> >> code attached).
> >>
> >> american_option.setPricingEngine(
> >> ql.BinomialVanillaEngine(
> >> process = ql.VarianceGammaProcess(
> >> ql.QuoteHandle(
> >> ql.SimpleQuote(spot_price)
> >> )
> >> , ql.YieldTermStructureHandle(
> >> ql.FlatForward(calculation_date, dividend_rate, day_count)
> >> )
> >> , ql.YieldTermStructureHandle(
> >> ql.FlatForward(calculation_date, risk_free_rate, day_count)
> >> )
> >> , sigma = 0.2
> >> , nu = 1
> >> , theta = 1
> >> )
> >> , type = 'crr'
> >> , steps = 200)
> >> )
> >>
> >> But I got the following error. I am not sure what the meaning of the
> >> error is. Does it mean BinomialVanillaEngine is not compatible with
> >> VarianceGammaProcess? Could anybody show me the correct way to price
> >> American options using variance Gamma processes?
> >>
> >> Traceback (most recent call last):
> >> File "./main.py", line 26, in <module>
> >> ql.BinomialVanillaEngine(
> >> File
> >>
> "/Library/Frameworks/Python.framework/Versions/3.8/lib/python3.8/site-packages/QuantLib/QuantLib.py",
> >> line 12456, in BinomialVanillaEngine
> >> return cls(process, steps)
> >> File
> >>
> "/Library/Frameworks/Python.framework/Versions/3.8/lib/python3.8/site-packages/QuantLib/QuantLib.py",
> >> line 12365, in __init__
> >> _QuantLib.BinomialCRRVanillaEngine_swiginit(self,
> >> _QuantLib.new_BinomialCRRVanillaEngine(arg2, steps))
> >> TypeError: in method 'new_BinomialCRRVanillaEngine', argument 1 of
> >> type 'ext::shared_ptr< GeneralizedBlackScholesProcess > const &'
> >>
> >> > I see a gamma pricing model is mentioned below. But I don't see any
> >> > formula in the page. Does anybody where I can find a more detailed
> >> > description of the gamma pricing model?
> >> >
> >> > Does quantlib have an implementation of a gamma pricing model? (I
> >> > don't find it. But I may miss it.)
> >> >
> >> > https://www.investopedia.com/terms/g/gamma-pricing-model.asp
> >>
> >> --
> >> Regards,
> >> Peng
> >> _______________________________________________
> >> QuantLib-users mailing list
> >> Qua...@li...
> >> https://lists.sourceforge.net/lists/listinfo/quantlib-users
> >>
> >
>
>
> --
> Regards,
> Peng
>
|