.. DO NOT EDIT. .. THIS FILE WAS AUTOMATICALLY GENERATED BY SPHINX-GALLERY. .. TO MAKE CHANGES, EDIT THE SOURCE PYTHON FILE: .. "api/gallery/asset_pricing/valuation/plot_01_williams_ddm.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_asset_pricing_valuation_plot_01_williams_ddm.py: Williams's dividend discount model ================================== John Burr Williams (1938) defined the *investment value* of a stock as the present value of all the dividends it will ever pay, .. math:: V_0 = \sum_{t=1}^{\infty} \frac{D_t}{(1 + r)^t}. Earnings matter only through the dividends they eventually fund. In practice an analyst forecasts a few years of dividends explicitly and then assumes steady growth, so most of the value often sits in the terminal value beyond the forecast horizon. .. GENERATED FROM PYTHON SOURCE LINES 19-31 .. code-block:: Python import matplotlib.pyplot as plt import numpy as np from financialkit.asset_pricing import dividend_discount_value r = 0.09 # Five years of fast growth from a dividend of 1, then 3% forever. divs = 1.0 * 1.12 ** np.arange(1, 6) value = dividend_discount_value(divs, r, terminal_growth=0.03) explicit = dividend_discount_value(divs, r) print(f"value = {value:.2f}, of which explicit dividends {explicit:.2f} ({explicit / value:.0%})") .. rst-class:: sphx-glr-script-out .. code-block:: none value = 25.09, of which explicit dividends 5.43 (22%) .. GENERATED FROM PYTHON SOURCE LINES 32-38 Where the value comes from -------------------------- Truncating the sum after :math:`n` years shows how slowly the present value of the dividends accumulates: decades of dividends are needed to reach the full value. .. GENERATED FROM PYTHON SOURCE LINES 38-50 .. code-block:: Python years = np.arange(1, 151) path = np.concatenate([divs, divs[-1] * 1.03 ** np.arange(1, years.size - divs.size + 1)]) partial = np.array([dividend_discount_value(path[:n], r) for n in years]) fig, ax = plt.subplots(figsize=(7, 4)) ax.plot(years, partial, label="PV of the first n dividends") ax.axhline(value, color="C3", ls="--", label=f"Williams's value = {value:.2f}") ax.set_xlabel("years of dividends counted") ax.set_ylabel("present value") ax.legend() fig.tight_layout() .. image-sg:: /api/gallery/asset_pricing/valuation/images/sphx_glr_plot_01_williams_ddm_001.png :alt: plot 01 williams ddm :srcset: /api/gallery/asset_pricing/valuation/images/sphx_glr_plot_01_williams_ddm_001.png :class: sphx-glr-single-img .. GENERATED FROM PYTHON SOURCE LINES 51-53 Sensitivity to the discount rate -------------------------------- .. GENERATED FROM PYTHON SOURCE LINES 53-62 .. code-block:: Python rates = np.linspace(0.06, 0.14, 50) fig, ax = plt.subplots(figsize=(7, 3.5)) ax.plot(rates, [dividend_discount_value(divs, k, terminal_growth=0.03) for k in rates]) ax.set_xlabel("required return r") ax.set_ylabel("value") fig.tight_layout() plt.show() .. image-sg:: /api/gallery/asset_pricing/valuation/images/sphx_glr_plot_01_williams_ddm_002.png :alt: plot 01 williams ddm :srcset: /api/gallery/asset_pricing/valuation/images/sphx_glr_plot_01_williams_ddm_002.png :class: sphx-glr-single-img .. rst-class:: sphx-glr-timing **Total running time of the script:** (0 minutes 0.056 seconds) .. _sphx_glr_download_api_gallery_asset_pricing_valuation_plot_01_williams_ddm.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/asset_pricing/valuation/plot_01_williams_ddm.ipynb :alt: Launch JupyterLite :width: 150 px .. container:: sphx-glr-download sphx-glr-download-jupyter :download:`Download Jupyter notebook: plot_01_williams_ddm.ipynb ` .. container:: sphx-glr-download sphx-glr-download-python :download:`Download Python source code: plot_01_williams_ddm.py ` .. container:: sphx-glr-download sphx-glr-download-zip :download:`Download zipped: plot_01_williams_ddm.zip ` .. only:: html .. rst-class:: sphx-glr-signature `Gallery generated by Sphinx-Gallery `_