.. DO NOT EDIT. .. THIS FILE WAS AUTOMATICALLY GENERATED BY SPHINX-GALLERY. .. TO MAKE CHANGES, EDIT THE SOURCE PYTHON FILE: .. "api/gallery/stochastic_volatility/jumps/plot_04_madan_carr_chang.py" .. LINE NUMBERS ARE GIVEN BELOW. .. only:: html .. note:: :class: sphx-glr-download-link-note :ref:`Go to the end ` to download the full example code or to run this example in your browser via JupyterLite. .. rst-class:: sphx-glr-example-title .. _sphx_glr_api_gallery_stochastic_volatility_jumps_plot_04_madan_carr_chang.py: Madan, Carr and Chang's skewed variance gamma ============================================= Madan, Carr and Chang (1998) added a drift :math:`\theta` in business time: :math:`X = \theta G_t + \sigma W_{G_t}`. A negative :math:`\theta` moves mass into the left tail, turning the symmetric Madan-Seneta smile into the equity skew with one extra parameter, and they priced options in closed form. Fang and Oosterlee (2008) later used one of their parameter sets as a benchmark; it is reproduced below. .. GENERATED FROM PYTHON SOURCE LINES 14-24 .. code-block:: Python import matplotlib.pyplot as plt import numpy as np from financialkit.stochastic_volatility import VarianceGammaModel, lewis_price from financialkit.stochastic_volatility.visualizers import plot_density, plot_smile m = VarianceGammaModel(sigma=0.12, nu=0.2, theta=-0.14) for T, ref in ((0.1, 10.993703187), (1.0, 19.099354724)): print(f"T = {T}: call {lewis_price(m, 100.0, 90.0, T, 0.1):.9f} (Fang-Oosterlee reference {ref})") .. rst-class:: sphx-glr-script-out .. code-block:: none T = 0.1: call 10.993703187 (Fang-Oosterlee reference 10.993703187) T = 1.0: call 19.099354724 (Fang-Oosterlee reference 19.099354724) .. GENERATED FROM PYTHON SOURCE LINES 25-27 The skew comes from theta ------------------------- .. GENERATED FROM PYTHON SOURCE LINES 27-40 .. code-block:: Python S, r, T = 100.0, 0.0, 0.5 x = np.linspace(-0.7, 0.5, 400) K = S * np.exp(np.linspace(-0.4, 0.3, 22)) fig, (ax1, ax2) = plt.subplots(1, 2, figsize=(10, 4)) for theta in (0.0, -0.15, -0.3): v = VarianceGammaModel(0.2, 0.3, theta) plot_density(x, v.pdf(x, T), ax=ax1, label=f"theta = {theta}", log=True) plot_smile(K, v.implied_vol(S, K, T, r), forward=S, ax=ax2, label=f"theta = {theta}") ax1.set_ylim(1e-3, 10) fig.tight_layout() plt.show() .. image-sg:: /api/gallery/stochastic_volatility/jumps/images/sphx_glr_plot_04_madan_carr_chang_001.png :alt: plot 04 madan carr chang :srcset: /api/gallery/stochastic_volatility/jumps/images/sphx_glr_plot_04_madan_carr_chang_001.png :class: sphx-glr-single-img .. rst-class:: sphx-glr-timing **Total running time of the script:** (0 minutes 0.216 seconds) .. _sphx_glr_download_api_gallery_stochastic_volatility_jumps_plot_04_madan_carr_chang.py: .. only:: html .. container:: sphx-glr-footer sphx-glr-footer-example .. container:: lite-badge .. image:: images/jupyterlite_badge_logo.svg :target: ../../../../lite/lab/index.html?path=api/gallery/stochastic_volatility/jumps/plot_04_madan_carr_chang.ipynb :alt: Launch JupyterLite :width: 150 px .. container:: sphx-glr-download sphx-glr-download-jupyter :download:`Download Jupyter notebook: plot_04_madan_carr_chang.ipynb ` .. container:: sphx-glr-download sphx-glr-download-python :download:`Download Python source code: plot_04_madan_carr_chang.py ` .. container:: sphx-glr-download sphx-glr-download-zip :download:`Download zipped: plot_04_madan_carr_chang.zip ` .. only:: html .. rst-class:: sphx-glr-signature `Gallery generated by Sphinx-Gallery `_