.. DO NOT EDIT. .. THIS FILE WAS AUTOMATICALLY GENERATED BY SPHINX-GALLERY. .. TO MAKE CHANGES, EDIT THE SOURCE PYTHON FILE: .. "api/gallery/stochastic_volatility/smile/plot_03_lee_moment_formula.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_smile_plot_03_lee_moment_formula.py: Lee's moment formula ==================== Roger Lee (2004) proved that the total implied variance can grow at most linearly in the log strike, and that the slope is fixed by how many moments the price has. If :math:`\tilde p` is the supremum of the :math:`p` with :math:`E[S_T^{1+p}] < \infty`, then .. math:: \limsup_{k \to \infty} \frac{\sigma_{BS}^2(k)\,T}{k} = 2 - 4\left(\sqrt{\tilde p^2 + \tilde p} - \tilde p\right), and the left wing obeys the same formula with the negative moments. Kou's model makes this concrete: its exponential jump tails give :math:`\tilde p = \eta_1 - 1` and :math:`\tilde q = \eta_2`. The bound is approached slowly, with corrections of order :math:`\ln|k|/|k|`. .. GENERATED FROM PYTHON SOURCE LINES 19-46 .. code-block:: Python import matplotlib.pyplot as plt import numpy as np from financialkit.stochastic_volatility import KouModel, VarianceGammaModel, lee_wing_slope S, r, T = 100.0, 0.0, 1.0 k = np.linspace(0.25, 6.0, 24) fig, (ax1, ax2) = plt.subplots(1, 2, figsize=(10, 4)) for eta1, eta2 in ((3.0, 2.0), (6.0, 4.0)): m = KouModel(0.1, 1.0, 0.5, eta1, eta2) p, q = m.critical_moments() right = m.implied_vol(S, S * np.exp(k), T, r) ** 2 * T / k left = m.implied_vol(S, S * np.exp(-k), T, r) ** 2 * T / k line = ax1.plot(k, right, label=f"right wing, eta1 = {eta1:g}")[0] ax1.axhline(lee_wing_slope(p), color=line.get_color(), ls="--", lw=1) line = ax2.plot(k, left, label=f"left wing, eta2 = {eta2:g}")[0] ax2.axhline(lee_wing_slope(q), color=line.get_color(), ls="--", lw=1) print(f"eta1 = {eta1:g}, eta2 = {eta2:g}: critical moments p = {p:g}, q = {q:g}; Lee slopes {lee_wing_slope(p):.4f}, {lee_wing_slope(q):.4f}") for ax in (ax1, ax2): ax.set_xlabel("|log-moneyness| |k|") ax.set_ylabel("w(k) / |k|") ax.set_ylim(0, 1) ax.legend() ax1.set_title("dashed: Lee's bound") fig.tight_layout() .. image-sg:: /api/gallery/stochastic_volatility/smile/images/sphx_glr_plot_03_lee_moment_formula_001.png :alt: dashed: Lee's bound :srcset: /api/gallery/stochastic_volatility/smile/images/sphx_glr_plot_03_lee_moment_formula_001.png :class: sphx-glr-single-img .. rst-class:: sphx-glr-script-out .. code-block:: none eta1 = 3, eta2 = 2: critical moments p = 2, q = 2; Lee slopes 0.2020, 0.2020 eta1 = 6, eta2 = 4: critical moments p = 5, q = 4; Lee slopes 0.0911, 0.1115 .. GENERATED FROM PYTHON SOURCE LINES 47-49 Variance gamma -------------- .. GENERATED FROM PYTHON SOURCE LINES 49-54 .. code-block:: Python p, q = VarianceGammaModel(0.2, 0.5, -0.2).critical_moments() print(f"variance gamma: p = {p:.3f}, q = {q:.3f}, wing slopes {lee_wing_slope(p):.4f} (right), {lee_wing_slope(q):.4f} (left)") plt.show() .. rst-class:: sphx-glr-script-out .. code-block:: none variance gamma: p = 15.180, q = 6.180, wing slopes 0.0319 (right), 0.0750 (left) .. rst-class:: sphx-glr-timing **Total running time of the script:** (0 minutes 0.126 seconds) .. _sphx_glr_download_api_gallery_stochastic_volatility_smile_plot_03_lee_moment_formula.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/smile/plot_03_lee_moment_formula.ipynb :alt: Launch JupyterLite :width: 150 px .. container:: sphx-glr-download sphx-glr-download-jupyter :download:`Download Jupyter notebook: plot_03_lee_moment_formula.ipynb ` .. container:: sphx-glr-download sphx-glr-download-python :download:`Download Python source code: plot_03_lee_moment_formula.py ` .. container:: sphx-glr-download sphx-glr-download-zip :download:`Download zipped: plot_03_lee_moment_formula.zip ` .. only:: html .. rst-class:: sphx-glr-signature `Gallery generated by Sphinx-Gallery `_