{ "cells": [ { "cell_type": "markdown", "id": "0d15cb6e", "metadata": {}, "source": [ "\n", "\n", "\n", "" ] }, { "cell_type": "markdown", "id": "84017746", "metadata": {}, "source": [ "# Lucas Asset Pricing Using DLE" ] }, { "cell_type": "markdown", "id": "46441d5b", "metadata": {}, "source": [ "## Contents\n", "\n", "- [Lucas Asset Pricing Using DLE](#Lucas-Asset-Pricing-Using-DLE) \n", " - [Asset Pricing Equations](#Asset-Pricing-Equations) \n", " - [Asset Pricing Simulations](#Asset-Pricing-Simulations) " ] }, { "cell_type": "markdown", "id": "b9c54c6c", "metadata": {}, "source": [ "This is one of a suite of lectures that use the quantecon DLE class to instantiate models within the\n", "[[HS13](https://python-advanced.quantecon.org/zreferences.html#id71)] class of models described in detail in [Recursive Models of Dynamic Linear Economies](https://python-advanced.quantecon.org/hs_recursive_models.html).\n", "\n", "In addition to what’s in Anaconda, this lecture uses the quantecon library" ] }, { "cell_type": "code", "execution_count": null, "id": "44283b0e", "metadata": { "hide-output": false }, "outputs": [], "source": [ "!pip install --upgrade quantecon" ] }, { "cell_type": "markdown", "id": "fd75f6d3", "metadata": {}, "source": [ "This lecture uses the DLE class to price payout\n", "streams that are linear functions of the economy’s state vector, as well\n", "as risk-free assets that pay out one unit of the first consumption good\n", "with certainty.\n", "\n", "We assume basic knowledge of the class of economic environments that fall within the domain of the\n", "DLE class.\n", "\n", "Many details about the basic environment are contained in the lecture\n", "[Growth in Dynamic Linear Economies](https://python-advanced.quantecon.org/growth_in_dles.html).\n", "\n", "We’ll also need the following imports" ] }, { "cell_type": "code", "execution_count": null, "id": "05567752", "metadata": { "hide-output": false }, "outputs": [], "source": [ "import numpy as np\n", "import matplotlib.pyplot as plt\n", "from quantecon import DLE\n", "%matplotlib inline" ] }, { "cell_type": "markdown", "id": "70dd3fa3", "metadata": {}, "source": [ "We use a linear-quadratic version of an economy that Lucas (1978) [[Luc78](https://python-advanced.quantecon.org/zreferences.html#id174)] used\n", "to develop an equilibrium theory of asset prices:\n", "\n", "**Preferences**\n", "\n", "$$\n", "-\\frac{1}{2}\\mathbb{E}\\sum_{t=0}^\\infty \\beta^t[(c_t - b_t)^2 + l_t^2]|J_0\n", "$$\n", "\n", "$$\n", "s_t = c_t\n", "$$\n", "\n", "$$\n", "b_t = U_bz_t\n", "$$\n", "\n", "**Technology**\n", "\n", "$$\n", "c_t = d_{1t}\n", "$$\n", "\n", "$$\n", "k_t = \\delta_k k_{t-1} + i_t\n", "$$\n", "\n", "$$\n", "g_t = \\phi_1 i_t \\, , \\phi_1 > 0\n", "$$\n", "\n", "$$\n", "\\left[ {\\begin{array}{c}\n", " d_{1t} \\\\ 0\n", " \\end{array} }\n", " \\right] = U_dz_t\n", "$$\n", "\n", "**Information**\n", "\n", "$$\n", "z_{t+1} =\n", "\\left[ {\\begin{array}{ccc}\n", " 1 & 0 & 0 \\\\ 0 & 0.8 & 0 \\\\ 0 & 0 & 0.5\n", " \\end{array} }\n", " \\right]\n", " z_t +\n", " \\left[ {\\begin{array}{cc}\n", " 0 & 0 \\\\ 1 & 0 \\\\ 0 & 1\n", " \\end{array} }\n", " \\right]\n", " w_{t+1}\n", "$$\n", "\n", "$$\n", "U_b =\n", " \\left[ {\\begin{array}{ccc}\n", " 30 & 0 & 0\n", " \\end{array} }\n", " \\right]\n", "$$\n", "\n", "$$\n", "U_d =\n", " \\left[ {\\begin{array}{ccc}\n", " 5 & 1 & 0 \\\\ 0 & 0 & 0\n", " \\end{array} }\n", " \\right]\n", "$$\n", "\n", "$$\n", "x_0 =\n", " \\left[ {\\begin{array}{ccccc}\n", " 5 & 150 & 1 & 0 & 0\n", " \\end{array} }\n", " \\right]'\n", "$$" ] }, { "cell_type": "markdown", "id": "59a202df", "metadata": {}, "source": [ "## Asset Pricing Equations\n", "\n", "[[HS13](https://python-advanced.quantecon.org/zreferences.html#id71)] show that the time t value of a permanent claim to a stream\n", "$ y_s = U_ax_s \\, , s \\geq t $ is:\n", "\n", "$$\n", "a_t = (x_t'\\mu_ax_t + \\sigma_a)/(\\bar e _1M_cx_t)\n", "$$\n", "\n", "with\n", "\n", "$$\n", "\\mu_a = \\sum_{\\tau = 0}^\\infty \\beta^\\tau(A^{o'})^\\tau Z_a A^{o\\tau}\n", "$$\n", "\n", "$$\n", "\\sigma_a = \\frac{\\beta}{1-\\beta} \\text{trace} (Z_a \\sum_{\\tau = 0}^\\infty \\beta^\\tau (A^{o})^\\tau C C^{'} (A^{o'})^\\tau)\n", "$$\n", "\n", "where\n", "\n", "$$\n", "Z_a = U_a^{'}M_c\n", "$$\n", "\n", "The use of $ \\bar e _1 $ indicates that the first consumption good\n", "is the numeraire." ] }, { "cell_type": "markdown", "id": "9aaed6ef", "metadata": {}, "source": [ "## Asset Pricing Simulations" ] }, { "cell_type": "code", "execution_count": null, "id": "81b386ea", "metadata": { "hide-output": false }, "outputs": [], "source": [ "gam = 0\n", "γ = np.array([[gam], [0]])\n", "ϕ_c = np.array([[1], [0]])\n", "ϕ_g = np.array([[0], [1]])\n", "ϕ_1 = 1e-4\n", "ϕ_i = np.array([[0], [-ϕ_1]])\n", "δ_k = np.array([[.95]])\n", "θ_k = np.array([[1]])\n", "β = np.array([[1 / 1.05]])\n", "ud = np.array([[5, 1, 0],\n", " [0, 0, 0]])\n", "a22 = np.array([[1, 0, 0],\n", " [0, 0.8, 0],\n", " [0, 0, 0.5]])\n", "c2 = np.array([[0, 1, 0],\n", " [0, 0, 1]]).T\n", "l_λ = np.array([[0]])\n", "π_h = np.array([[1]])\n", "δ_h = np.array([[.9]])\n", "θ_h = np.array([[1]]) - δ_h\n", "ub = np.array([[30, 0, 0]])\n", "x0 = np.array([[5, 150, 1, 0, 0]]).T\n", "\n", "info1 = (a22, c2, ub, ud)\n", "tech1 = (ϕ_c, ϕ_g, ϕ_i, γ, δ_k, θ_k)\n", "pref1 = (β, l_λ, π_h, δ_h, θ_h)" ] }, { "cell_type": "code", "execution_count": null, "id": "72748709", "metadata": { "hide-output": false }, "outputs": [], "source": [ "econ1 = DLE(info1, tech1, pref1)" ] }, { "cell_type": "markdown", "id": "d81572cd", "metadata": {}, "source": [ "After specifying a “Pay” matrix, we simulate the economy.\n", "\n", "The particular choice of “Pay” used below means that we are pricing a\n", "perpetual claim on the endowment process $ d_{1t} $" ] }, { "cell_type": "code", "execution_count": null, "id": "a6741d4e", "metadata": { "hide-output": false }, "outputs": [], "source": [ "econ1.compute_sequence(x0, ts_length=100, Pay=np.array([econ1.Sd[0, :]]))" ] }, { "cell_type": "markdown", "id": "45a7f22d", "metadata": {}, "source": [ "The graph below plots the price of this claim over time:" ] }, { "cell_type": "code", "execution_count": null, "id": "7866041e", "metadata": { "hide-output": false }, "outputs": [], "source": [ "### Fig 7.12.1 from p.147 of HS2013\n", "plt.plot(econ1.Pay_Price, label='Price of Tree')\n", "plt.legend()\n", "plt.show()" ] }, { "cell_type": "markdown", "id": "b0c19f91", "metadata": {}, "source": [ "The next plot displays the realized gross rate of return on this “Lucas\n", "tree” as well as on a risk-free one-period bond:" ] }, { "cell_type": "code", "execution_count": null, "id": "ca766cd5", "metadata": { "hide-output": false }, "outputs": [], "source": [ "### Left panel of Fig 7.12.2 from p.148 of HS2013\n", "plt.plot(econ1.Pay_Gross, label='Tree')\n", "plt.plot(econ1.R1_Gross, label='Risk-Free')\n", "plt.legend()\n", "plt.show()" ] }, { "cell_type": "code", "execution_count": null, "id": "9755f078", "metadata": { "hide-output": false }, "outputs": [], "source": [ "np.corrcoef(econ1.Pay_Gross[1:, 0], econ1.R1_Gross[1:, 0])" ] }, { "cell_type": "markdown", "id": "ba6d9ff9", "metadata": {}, "source": [ "Above we have also calculated the correlation coefficient between these\n", "two returns.\n", "\n", "To give an idea of how the term structure of interest rates moves in\n", "this economy, the next plot displays the *net* rates of return on\n", "one-period and five-period risk-free bonds:" ] }, { "cell_type": "code", "execution_count": null, "id": "dfe40dfb", "metadata": { "hide-output": false }, "outputs": [], "source": [ "### Right panel of Fig 7.12.2 from p.148 of HS2013\n", "plt.plot(econ1.R1_Net, label='One-Period')\n", "plt.plot(econ1.R5_Net, label='Five-Period')\n", "plt.legend()\n", "plt.show()" ] }, { "cell_type": "markdown", "id": "41c23910", "metadata": {}, "source": [ "From the above plot, we can see the tendency of the term structure to\n", "slope up when rates are low and to slope down when rates are high.\n", "\n", "Comparing it to the previous plot of the price of the “Lucas tree”, we\n", "can also see that net rates of return are low when the price of the tree\n", "is high, and vice versa.\n", "\n", "We now plot the realized gross rate of return on a “Lucas tree” as well\n", "as on a risk-free one-period bond when the autoregressive parameter for\n", "the endowment process is reduced to 0.4:" ] }, { "cell_type": "code", "execution_count": null, "id": "6d07a2e8", "metadata": { "hide-output": false }, "outputs": [], "source": [ "a22_2 = np.array([[1, 0, 0],\n", " [0, 0.4, 0],\n", " [0, 0, 0.5]])\n", "info2 = (a22_2, c2, ub, ud)\n", "\n", "econ2 = DLE(info2, tech1, pref1)\n", "econ2.compute_sequence(x0, ts_length=100, Pay=np.array([econ2.Sd[0, :]]))" ] }, { "cell_type": "code", "execution_count": null, "id": "2755fc92", "metadata": { "hide-output": false }, "outputs": [], "source": [ "### Left panel of Fig 7.12.3 from p.148 of HS2013\n", "plt.plot(econ2.Pay_Gross, label='Tree')\n", "plt.plot(econ2.R1_Gross, label='Risk-Free')\n", "plt.legend()\n", "plt.show()" ] }, { "cell_type": "code", "execution_count": null, "id": "b845c6df", "metadata": { "hide-output": false }, "outputs": [], "source": [ "np.corrcoef(econ2.Pay_Gross[1:, 0], econ2.R1_Gross[1:, 0])" ] }, { "cell_type": "markdown", "id": "709a2a63", "metadata": {}, "source": [ "The correlation between these two gross rates is now more negative.\n", "\n", "Next, we again plot the *net* rates of return on one-period and\n", "five-period risk-free bonds:" ] }, { "cell_type": "code", "execution_count": null, "id": "df7ac31d", "metadata": { "hide-output": false }, "outputs": [], "source": [ "### Right panel of Fig 7.12.3 from p.148 of HS2013\n", "plt.plot(econ2.R1_Net, label='One-Period')\n", "plt.plot(econ2.R5_Net, label='Five-Period')\n", "plt.legend()\n", "plt.show()" ] }, { "cell_type": "markdown", "id": "f16b9784", "metadata": {}, "source": [ "We can see the tendency of the term structure to slope up when rates are\n", "low (and down when rates are high) has been accentuated relative to the\n", "first instance of our economy." ] } ], "metadata": { "date": 1705369586.7347264, "filename": "lucas_asset_pricing_dles.md", "kernelspec": { "display_name": "Python", "language": "python3", "name": "python3" }, "title": "Lucas Asset Pricing Using DLE" }, "nbformat": 4, "nbformat_minor": 5 }