{ "cells": [ { "cell_type": "markdown", "metadata": {}, "source": [ "# Kesten Processes and Firm Dynamics\n", "\n", "\n", "" ] }, { "cell_type": "markdown", "metadata": {}, "source": [ "## Contents\n", "\n", "- [Kesten Processes and Firm Dynamics](#Kesten-Processes-and-Firm-Dynamics) \n", " - [Overview](#Overview) \n", " - [Kesten Processes](#Kesten-Processes) \n", " - [Heavy Tails](#Heavy-Tails) \n", " - [Application: Firm Dynamics](#Application:-Firm-Dynamics) \n", " - [Exercises](#Exercises) \n", " - [Solutions](#Solutions) " ] }, { "cell_type": "markdown", "metadata": {}, "source": [ "In addition to what’s in Anaconda, this lecture will need the following libraries:" ] }, { "cell_type": "code", "execution_count": null, "metadata": { "hide-output": false }, "outputs": [], "source": [ "!conda install -y quantecon\n", "!pip install --upgrade yfinance" ] }, { "cell_type": "markdown", "metadata": {}, "source": [ "## Overview\n", "\n", "[Previously](https://python.quantecon.org/ar1_processes.html) we learned about linear scalar-valued stochastic processes (AR(1) models).\n", "\n", "Now we generalize these linear models slightly by allowing the multiplicative coefficient to be stochastic.\n", "\n", "Such processes are known as Kesten processes after German–American mathematician Harry Kesten (1931–2019)\n", "\n", "Although simple to write down, Kesten processes are interesting for at least two reasons:\n", "\n", "1. A number of significant economic processes are or can be described as Kesten processes. \n", "1. Kesten processes generate interesting dynamics, including, in some cases, heavy-tailed cross-sectional distributions. \n", "\n", "\n", "We will discuss these issues as we go along.\n", "\n", "Let’s start with some imports:" ] }, { "cell_type": "code", "execution_count": null, "metadata": { "hide-output": false }, "outputs": [], "source": [ "%matplotlib inline\n", "import matplotlib.pyplot as plt\n", "plt.rcParams[\"figure.figsize\"] = (11, 5) #set default figure size\n", "import numpy as np\n", "import quantecon as qe" ] }, { "cell_type": "markdown", "metadata": {}, "source": [ "The following two lines are only added to avoid a FutureWarning caused by\n", "compatibility issues between pandas and matplotlib." ] }, { "cell_type": "code", "execution_count": null, "metadata": { "hide-output": false }, "outputs": [], "source": [ "from pandas.plotting import register_matplotlib_converters\n", "register_matplotlib_converters()" ] }, { "cell_type": "markdown", "metadata": {}, "source": [ "Additional technical background related to this lecture can be found in the\n", "monograph of [[BDM+16](https://python.quantecon.org/zreferences.html#id16)]." ] }, { "cell_type": "markdown", "metadata": {}, "source": [ "## Kesten Processes\n", "\n", "\n", "\n", "A **Kesten process** is a stochastic process of the form\n", "\n", "\n", "\n", "$$\n", "X_{t+1} = a_{t+1} X_t + \\eta_{t+1} \\tag{1}\n", "$$\n", "\n", "where $\\{a_t\\}_{t \\geq 1}$ and $\\{\\eta_t\\}_{t \\geq 1}$ are IID\n", "sequences.\n", "\n", "We are interested in the dynamics of $\\{X_t\\}_{t \\geq 0}$ when $X_0$ is given.\n", "\n", "We will focus on the nonnegative scalar case, where $X_t$ takes values in $\\mathbb R_+$.\n", "\n", "In particular, we will assume that\n", "\n", "- the initial condition $X_0$ is nonnegative, \n", "- $\\{a_t\\}_{t \\geq 1}$ is a nonnegative IID stochastic process and \n", "- $\\{\\eta_t\\}_{t \\geq 1}$ is another nonnegative IID stochastic process, independent of the first. " ] }, { "cell_type": "markdown", "metadata": {}, "source": [ "### Example: GARCH Volatility\n", "\n", "The GARCH model is common in financial applications, where time series such as asset returns exhibit time varying volatility.\n", "\n", "For example, consider the following plot of daily returns on the Nasdaq\n", "Composite Index for the period 1st January 2006 to 1st November 2019.\n", "\n", "\n", "" ] }, { "cell_type": "code", "execution_count": null, "metadata": { "hide-output": false }, "outputs": [], "source": [ "import yfinance as yf\n", "import pandas as pd\n", "\n", "s = yf.download('^IXIC', '2006-1-1', '2019-11-1')['Adj Close']\n", "\n", "r = s.pct_change()\n", "\n", "fig, ax = plt.subplots()\n", "\n", "ax.plot(r, alpha=0.7)\n", "\n", "ax.set_ylabel('returns', fontsize=12)\n", "ax.set_xlabel('date', fontsize=12)\n", "\n", "plt.show()" ] }, { "cell_type": "markdown", "metadata": {}, "source": [ "Notice how the series exhibits bursts of volatility (high variance) and then\n", "settles down again.\n", "\n", "GARCH models can replicate this feature.\n", "\n", "The GARCH(1, 1) volatility process takes the form\n", "\n", "\n", "\n", "$$\n", "\\sigma_{t+1}^2 = \\alpha_0 + \\sigma_t^2 (\\alpha_1 \\xi_{t+1}^2 + \\beta) \\tag{2}\n", "$$\n", "\n", "where $\\{\\xi_t\\}$ is IID with $\\mathbb E \\xi_t^2 = 1$ and all parameters are positive.\n", "\n", "Returns on a given asset are then modeled as\n", "\n", "\n", "\n", "$$\n", "r_t = \\sigma_t \\zeta_t \\tag{3}\n", "$$\n", "\n", "where $\\{\\zeta_t\\}$ is again IID and independent of $\\{\\xi_t\\}$.\n", "\n", "The volatility sequence $\\{\\sigma_t^2 \\}$, which drives the dynamics of returns, is a Kesten process." ] }, { "cell_type": "markdown", "metadata": {}, "source": [ "### Example: Wealth Dynamics\n", "\n", "Suppose that a given household saves a fixed fraction $s$ of its current wealth in every period.\n", "\n", "The household earns labor income $y_t$ at the start of time $t$.\n", "\n", "Wealth then evolves according to\n", "\n", "\n", "\n", "$$\n", "w_{t+1} = R_{t+1} s w_t + y_{t+1} \\tag{4}\n", "$$\n", "\n", "where $\\{R_t\\}$ is the gross rate of return on assets.\n", "\n", "If $\\{R_t\\}$ and $\\{y_t\\}$ are both IID, then [(16.4)](#equation-wealth-dynam)\n", "is a Kesten process." ] }, { "cell_type": "markdown", "metadata": {}, "source": [ "### Stationarity\n", "\n", "In earlier lectures, such as the one on [AR(1) processes](https://python.quantecon.org/ar1_processes.html), we introduced the notion of a stationary distribution.\n", "\n", "In the present context, we can define a stationary distribution as follows:\n", "\n", "The distribution $F^*$ on $\\mathbb R$ is called **stationary** for the\n", "Kesten process [(16.1)](#equation-kesproc) if\n", "\n", "\n", "\n", "$$\n", "X_t \\sim F^*\n", "\\quad \\implies \\quad\n", "a_{t+1} X_t + \\eta_{t+1} \\sim F^* \\tag{5}\n", "$$\n", "\n", "In other words, if the current state $X_t$ has distribution $F^*$,\n", "then so does the next period state $X_{t+1}$.\n", "\n", "We can write this alternatively as\n", "\n", "\n", "\n", "$$\n", "F^*(y) = \\int \\mathbb P\\{ a_{t+1} x + \\eta_{t+1} \\leq y\\} F^*(dx)\n", "\\quad \\text{for all } y \\geq 0. \\tag{6}\n", "$$\n", "\n", "The left hand side is the distribution of the next period state when the\n", "current state is drawn from $F^*$.\n", "\n", "The equality in [(16.6)](#equation-kp-stationary) states that this distribution is unchanged." ] }, { "cell_type": "markdown", "metadata": {}, "source": [ "### Cross-Sectional Interpretation\n", "\n", "There is an important cross-sectional interpretation of stationary distributions, discussed previously but worth repeating here.\n", "\n", "Suppose, for example, that we are interested in the wealth distribution — that is, the current distribution of wealth across households in a given country.\n", "\n", "Suppose further that\n", "\n", "- the wealth of each household evolves independently according to\n", " [(16.4)](#equation-wealth-dynam), \n", "- $F^*$ is a stationary distribution for this stochastic process and \n", "- there are many households. \n", "\n", "\n", "Then $F^*$ is a steady state for the cross-sectional wealth distribution in this country.\n", "\n", "In other words, if $F^*$ is the current wealth distribution then it will\n", "remain so in subsequent periods, *ceteris paribus*.\n", "\n", "To see this, suppose that $F^*$ is the current wealth distribution.\n", "\n", "What is the fraction of households with wealth less than $y$ next\n", "period?\n", "\n", "To obtain this, we sum the probability that wealth is less than $y$ tomorrow, given that current wealth is $w$, weighted by the fraction of households with wealth $w$.\n", "\n", "Noting that the fraction of households with wealth in interval $dw$ is $F^*(dw)$, we get\n", "\n", "$$\n", "\\int \\mathbb P\\{ R_{t+1} s w + y_{t+1} \\leq y\\} F^*(dw)\n", "$$\n", "\n", "By the definition of stationarity and the assumption that $F^*$ is stationary for the wealth process, this is just $F^*(y)$.\n", "\n", "Hence the fraction of households with wealth in $[0, y]$ is the same\n", "next period as it is this period.\n", "\n", "Since $y$ was chosen arbitrarily, the distribution is unchanged." ] }, { "cell_type": "markdown", "metadata": {}, "source": [ "### Conditions for Stationarity\n", "\n", "The Kesten process $X_{t+1} = a_{t+1} X_t + \\eta_{t+1}$ does not always\n", "have a stationary distribution.\n", "\n", "For example, if $a_t \\equiv \\eta_t \\equiv 1$ for all $t$, then\n", "$X_t = X_0 + t$, which diverges to infinity.\n", "\n", "To prevent this kind of divergence, we require that $\\{a_t\\}$ is\n", "strictly less than 1 most of the time.\n", "\n", "In particular, if\n", "\n", "\n", "\n", "$$\n", "\\mathbb E \\ln a_t < 0\n", "\\quad \\text{and} \\quad\n", "\\mathbb E \\eta_t < \\infty \\tag{7}\n", "$$\n", "\n", "then a unique stationary distribution exists on $\\mathbb R_+$.\n", "\n", "- See, for example, theorem 2.1.3 of [[BDM+16](https://python.quantecon.org/zreferences.html#id16)], which provides slightly weaker conditions. \n", "\n", "\n", "As one application of this result, we see that the wealth process\n", "[(16.4)](#equation-wealth-dynam) will have a unique stationary distribution whenever\n", "labor income has finite mean and $\\mathbb E \\ln R_t + \\ln s < 0$." ] }, { "cell_type": "markdown", "metadata": {}, "source": [ "## Heavy Tails\n", "\n", "Under certain conditions, the stationary distribution of a Kesten process has\n", "a Pareto tail.\n", "\n", "(See our [earlier lecture](https://python.quantecon.org/heavy_tails.html) on heavy-tailed distributions for background.)\n", "\n", "This fact is significant for economics because of the prevalence of Pareto-tailed distributions." ] }, { "cell_type": "markdown", "metadata": {}, "source": [ "### The Kesten–Goldie Theorem\n", "\n", "To state the conditions under which the stationary distribution of a Kesten process has a Pareto tail, we first recall that a random variable is called **nonarithmetic** if its distribution is not concentrated on $\\{\\dots, -2t, -t, 0, t, 2t, \\ldots \\}$ for any $t \\geq 0$.\n", "\n", "For example, any random variable with a density is nonarithmetic.\n", "\n", "The famous Kesten–Goldie Theorem (see, e.g., [[BDM+16](https://python.quantecon.org/zreferences.html#id16)], theorem 2.4.4) states that if\n", "\n", "1. the stationarity conditions in [(16.7)](#equation-kp-stat-cond) hold, \n", "1. the random variable $a_t$ is positive with probability one and nonarithmetic, \n", "1. $\\mathbb P\\{a_t x + \\eta_t = x\\} < 1$ for all $x \\in \\mathbb R_+$ and \n", "1. there exists a positive constant $\\alpha$ such that \n", "\n", "\n", "$$\n", "\\mathbb E a_t^\\alpha = 1,\n", " \\quad\n", "\\mathbb E \\eta_t^\\alpha < \\infty,\n", " \\quad \\text{and} \\quad\n", "\\mathbb E [a_t^{\\alpha+1} ] < \\infty\n", "$$\n", "\n", "then the stationary distribution of the Kesten process has a Pareto tail with\n", "tail index $\\alpha$.\n", "\n", "More precisely, if $F^*$ is the unique stationary distribution and $X^* \\sim F^*$, then\n", "\n", "$$\n", "\\lim_{x \\to \\infty} x^\\alpha \\mathbb P\\{X^* > x\\} = c\n", "$$\n", "\n", "for some positive constant $c$." ] }, { "cell_type": "markdown", "metadata": {}, "source": [ "### Intuition\n", "\n", "Later we will illustrate the Kesten–Goldie Theorem using rank-size plots.\n", "\n", "Prior to doing so, we can give the following intuition for the conditions.\n", "\n", "Two important conditions are that $\\mathbb E \\ln a_t < 0$, so the model\n", "is stationary, and $\\mathbb E a_t^\\alpha = 1$ for some $\\alpha >\n", "0$.\n", "\n", "The first condition implies that the distribution of $a_t$ has a large amount of probability mass below 1.\n", "\n", "The second condition implies that the distribution of $a_t$ has at least some probability mass at or above 1.\n", "\n", "The first condition gives us existence of the stationary condition.\n", "\n", "The second condition means that the current state can be expanded by $a_t$.\n", "\n", "If this occurs for several concurrent periods, the effects compound each other, since $a_t$ is multiplicative.\n", "\n", "This leads to spikes in the time series, which fill out the extreme right hand tail of the distribution.\n", "\n", "The spikes in the time series are visible in the following simulation, which generates of 10 paths when $a_t$ and $b_t$ are lognormal." ] }, { "cell_type": "code", "execution_count": null, "metadata": { "hide-output": false }, "outputs": [], "source": [ "μ = -0.5\n", "σ = 1.0\n", "\n", "def kesten_ts(ts_length=100):\n", " x = np.zeros(ts_length)\n", " for t in range(ts_length-1):\n", " a = np.exp(μ + σ * np.random.randn())\n", " b = np.exp(np.random.randn())\n", " x[t+1] = a * x[t] + b\n", " return x\n", "\n", "fig, ax = plt.subplots()\n", "\n", "num_paths = 10\n", "np.random.seed(12)\n", "\n", "for i in range(num_paths):\n", " ax.plot(kesten_ts())\n", "\n", "ax.set(xlabel='time', ylabel='$X_t$')\n", "plt.show()" ] }, { "cell_type": "markdown", "metadata": {}, "source": [ "## Application: Firm Dynamics\n", "\n", "As noted in our [lecture on heavy tails](https://python.quantecon.org/heavy_tails.html), for common measures of firm size such as revenue or employment, the US firm size distribution exhibits a Pareto tail (see, e.g., [[Axt01](https://python.quantecon.org/zreferences.html#id26)], [[Gab16](https://python.quantecon.org/zreferences.html#id25)]).\n", "\n", "Let us try to explain this rather striking fact using the Kesten–Goldie Theorem." ] }, { "cell_type": "markdown", "metadata": {}, "source": [ "### Gibrat’s Law\n", "\n", "It was postulated many years ago by Robert Gibrat [[Gib31](https://python.quantecon.org/zreferences.html#id15)] that firm size evolves according to a simple rule whereby size next period is proportional to current size.\n", "\n", "This is now known as [Gibrat’s law of proportional growth](https://en.wikipedia.org/wiki/Gibrat%27s_law).\n", "\n", "We can express this idea by stating that a suitably defined measure\n", "$s_t$ of firm size obeys\n", "\n", "\n", "\n", "$$\n", "\\frac{s_{t+1}}{s_t} = a_{t+1} \\tag{8}\n", "$$\n", "\n", "for some positive IID sequence $\\{a_t\\}$.\n", "\n", "One implication of Gibrat’s law is that the growth rate of individual firms\n", "does not depend on their size.\n", "\n", "However, over the last few decades, research contradicting Gibrat’s law has\n", "accumulated in the literature.\n", "\n", "For example, it is commonly found that, on average,\n", "\n", "1. small firms grow faster than large firms (see, e.g., [[Eva87](https://python.quantecon.org/zreferences.html#id14)] and [[Hal87](https://python.quantecon.org/zreferences.html#id13)]) and \n", "1. the growth rate of small firms is more volatile than that of large firms [[DRS89](https://python.quantecon.org/zreferences.html#id12)]. \n", "\n", "\n", "On the other hand, Gibrat’s law is generally found to be a reasonable\n", "approximation for large firms [[Eva87](https://python.quantecon.org/zreferences.html#id14)].\n", "\n", "We can accommodate these empirical findings by modifying [(16.8)](#equation-firm-dynam-gb)\n", "to\n", "\n", "\n", "\n", "$$\n", "s_{t+1} = a_{t+1} s_t + b_{t+1} \\tag{9}\n", "$$\n", "\n", "where $\\{a_t\\}$ and $\\{b_t\\}$ are both IID and independent of each\n", "other.\n", "\n", "In the exercises you are asked to show that [(16.9)](#equation-firm-dynam) is more\n", "consistent with the empirical findings presented above than Gibrat’s law in\n", "[(16.8)](#equation-firm-dynam-gb)." ] }, { "cell_type": "markdown", "metadata": {}, "source": [ "### Heavy Tails\n", "\n", "So what has this to do with Pareto tails?\n", "\n", "The answer is that [(16.9)](#equation-firm-dynam) is a Kesten process.\n", "\n", "If the conditions of the Kesten–Goldie Theorem are satisfied, then the firm\n", "size distribution is predicted to have heavy tails — which is exactly what\n", "we see in the data.\n", "\n", "In the exercises below we explore this idea further, generalizing the firm\n", "size dynamics and examining the corresponding rank-size plots.\n", "\n", "We also try to illustrate why the Pareto tail finding is significant for\n", "quantitative analysis." ] }, { "cell_type": "markdown", "metadata": {}, "source": [ "## Exercises" ] }, { "cell_type": "markdown", "metadata": {}, "source": [ "### Exercise 1\n", "\n", "Simulate and plot 15 years of daily returns (consider each year as having 250\n", "working days) using the GARCH(1, 1) process in [(16.2)](#equation-garch11v)–[(16.3)](#equation-garch11r).\n", "\n", "Take $\\xi_t$ and $\\zeta_t$ to be independent and standard normal.\n", "\n", "Set $\\alpha_0 = 0.00001, \\alpha_1 = 0.1, \\beta = 0.9$ and $\\sigma_0 = 0$.\n", "\n", "Compare visually with the Nasdaq Composite Index returns [shown above](#ndcode).\n", "\n", "While the time path differs, you should see bursts of high volatility." ] }, { "cell_type": "markdown", "metadata": {}, "source": [ "### Exercise 2\n", "\n", "In our discussion of firm dynamics, it was claimed that [(16.9)](#equation-firm-dynam) is more consistent with the empirical literature than Gibrat’s law in [(16.8)](#equation-firm-dynam-gb).\n", "\n", "(The empirical literature was reviewed immediately above [(16.9)](#equation-firm-dynam).)\n", "\n", "In what sense is this true (or false)?" ] }, { "cell_type": "markdown", "metadata": {}, "source": [ "### Exercise 3\n", "\n", "Consider an arbitrary Kesten process as given in [(16.1)](#equation-kesproc).\n", "\n", "Suppose that $\\{a_t\\}$ is lognormal with parameters $(\\mu,\n", "\\sigma)$.\n", "\n", "In other words, each $a_t$ has the same distribution as $\\exp(\\mu + \\sigma Z)$ when $Z$ is standard normal.\n", "\n", "Suppose further that $\\mathbb E \\eta_t^r < \\infty$ for every $r > 0$, as\n", "would be the case if, say, $\\eta_t$ is also lognormal.\n", "\n", "Show that the conditions of the Kesten–Goldie theorem are satisfied if and\n", "only if $\\mu < 0$.\n", "\n", "Obtain the value of $\\alpha$ that makes the Kesten–Goldie conditions\n", "hold." ] }, { "cell_type": "markdown", "metadata": {}, "source": [ "### Exercise 4\n", "\n", "One unrealistic aspect of the firm dynamics specified in [(16.9)](#equation-firm-dynam) is\n", "that it ignores entry and exit.\n", "\n", "In any given period and in any given market, we observe significant numbers of firms entering and exiting the market.\n", "\n", "Empirical discussion of this can be found in a famous paper by Hugo Hopenhayn [[Hop92](https://python.quantecon.org/zreferences.html#id131)].\n", "\n", "In the same paper, Hopenhayn builds a model of entry and exit that\n", "incorporates profit maximization by firms and market clearing quantities, wages and prices.\n", "\n", "In his model, a stationary equilibrium occurs when the number of entrants\n", "equals the number of exiting firms.\n", "\n", "In this setting, firm dynamics can be expressed as\n", "\n", "\n", "\n", "$$\n", "s_{t+1} = e_{t+1} \\mathbb{1}\\{s_t < \\bar s\\} +\n", "(a_{t+1} s_t + b_{t+1}) \\mathbb{1}\\{s_t \\geq \\bar s\\} \\tag{10}\n", "$$\n", "\n", "Here\n", "\n", "- the state variable $s_t$ represents productivity (which is a proxy\n", " for output and hence firm size), \n", "- the IID sequence $\\{ e_t \\}$ is thought of as a productivity draw for a new\n", " entrant and \n", "- the variable $\\bar s$ is a threshold value that we take as given,\n", " although it is determined endogenously in Hopenhayn’s model. \n", "\n", "\n", "The idea behind [(16.10)](#equation-firm-dynam-ee) is that firms stay in the market as long\n", "as their productivity $s_t$ remains at or above $\\bar s$.\n", "\n", "- In this case, their productivity updates according to [(16.9)](#equation-firm-dynam). \n", "\n", "\n", "Firms choose to exit when their productivity $s_t$ falls below $\\bar s$.\n", "\n", "- In this case, they are replaced by a new firm with productivity\n", " $e_{t+1}$. \n", "\n", "\n", "What can we say about dynamics?\n", "\n", "Although [(16.10)](#equation-firm-dynam-ee) is not a Kesten process, it does update in the\n", "same way as a Kesten process when $s_t$ is large.\n", "\n", "So perhaps its stationary distribution still has Pareto tails?\n", "\n", "Your task is to investigate this question via simulation and rank-size plots.\n", "\n", "The approach will be to\n", "\n", "1. generate $M$ draws of $s_T$ when $M$ and $T$ are\n", " large and \n", "1. plot the largest 1,000 of the resulting draws in a rank-size plot. \n", "\n", "\n", "(The distribution of $s_T$ will be close to the stationary distribution\n", "when $T$ is large.)\n", "\n", "In the simulation, assume that\n", "\n", "- each of $a_t, b_t$ and $e_t$ is lognormal, \n", "- the parameters are " ] }, { "cell_type": "code", "execution_count": null, "metadata": { "hide-output": false }, "outputs": [], "source": [ "μ_a = -0.5 # location parameter for a\n", "σ_a = 0.1 # scale parameter for a\n", "μ_b = 0.0 # location parameter for b\n", "σ_b = 0.5 # scale parameter for b\n", "μ_e = 0.0 # location parameter for e\n", "σ_e = 0.5 # scale parameter for e\n", "s_bar = 1.0 # threshold\n", "T = 500 # sampling date\n", "M = 1_000_000 # number of firms\n", "s_init = 1.0 # initial condition for each firm" ] }, { "cell_type": "markdown", "metadata": {}, "source": [ "## Solutions" ] }, { "cell_type": "markdown", "metadata": {}, "source": [ "### Exercise 1\n", "\n", "Here is one solution:" ] }, { "cell_type": "code", "execution_count": null, "metadata": { "hide-output": false }, "outputs": [], "source": [ "α_0 = 1e-5\n", "α_1 = 0.1\n", "β = 0.9\n", "\n", "years = 15\n", "days = years * 250\n", "\n", "def garch_ts(ts_length=days):\n", " σ2 = 0\n", " r = np.zeros(ts_length)\n", " for t in range(ts_length-1):\n", " ξ = np.random.randn()\n", " σ2 = α_0 + σ2 * (α_1 * ξ**2 + β)\n", " r[t] = np.sqrt(σ2) * np.random.randn()\n", " return r\n", "\n", "fig, ax = plt.subplots()\n", "\n", "np.random.seed(12)\n", "\n", "ax.plot(garch_ts(), alpha=0.7)\n", "\n", "ax.set(xlabel='time', ylabel='$\\\\sigma_t^2$')\n", "plt.show()" ] }, { "cell_type": "markdown", "metadata": {}, "source": [ "### Exercise 2\n", "\n", "The empirical findings are that\n", "\n", "1. small firms grow faster than large firms and \n", "1. the growth rate of small firms is more volatile than that of large firms. \n", "\n", "\n", "Also, Gibrat’s law is generally found to be a reasonable approximation for\n", "large firms than for small firms\n", "\n", "The claim is that the dynamics in [(16.9)](#equation-firm-dynam) are more consistent with\n", "points 1-2 than Gibrat’s law.\n", "\n", "To see why, we rewrite [(16.9)](#equation-firm-dynam) in terms of growth dynamics:\n", "\n", "\n", "\n", "$$\n", "\\frac{s_{t+1}}{s_t} = a_{t+1} + \\frac{b_{t+1}}{s_t} \\tag{11}\n", "$$\n", "\n", "Taking $s_t = s$ as given, the mean and variance of firm growth are\n", "\n", "$$\n", "\\mathbb E a\n", "+ \\frac{\\mathbb E b}{s}\n", "\\quad \\text{and} \\quad\n", "\\mathbb V a\n", "+ \\frac{\\mathbb V b}{s^2}\n", "$$\n", "\n", "Both of these decline with firm size $s$, consistent with the data.\n", "\n", "Moreover, the law of motion [(16.11)](#equation-firm-dynam-2) clearly approaches Gibrat’s law\n", "[(16.8)](#equation-firm-dynam-gb) as $s_t$ gets large." ] }, { "cell_type": "markdown", "metadata": {}, "source": [ "### Exercise 3\n", "\n", "Since $a_t$ has a density it is nonarithmetic.\n", "\n", "Since $a_t$ has the same density as $a = \\exp(\\mu + \\sigma Z)$ when $Z$ is standard normal, we have\n", "\n", "$$\n", "\\mathbb E \\ln a_t = \\mathbb E (\\mu + \\sigma Z) = \\mu,\n", "$$\n", "\n", "and since $\\eta_t$ has finite moments of all orders, the stationarity\n", "condition holds if and only if $\\mu < 0$.\n", "\n", "Given the properties of the lognormal distribution (which has finite moments\n", "of all orders), the only other condition in doubt is existence of a positive constant\n", "$\\alpha$ such that $\\mathbb E a_t^\\alpha = 1$.\n", "\n", "This is equivalent to the statement\n", "\n", "$$\n", "\\exp \\left( \\alpha \\mu + \\frac{\\alpha^2 \\sigma^2}{2} \\right) = 1.\n", "$$\n", "\n", "Solving for $\\alpha$ gives $\\alpha = -2\\mu / \\sigma^2$." ] }, { "cell_type": "markdown", "metadata": {}, "source": [ "### Exercise 4\n", "\n", "Here’s one solution. First we generate the observations:" ] }, { "cell_type": "code", "execution_count": null, "metadata": { "hide-output": false }, "outputs": [], "source": [ "from numba import njit, prange\n", "from numpy.random import randn\n", "\n", "\n", "@njit(parallel=True)\n", "def generate_draws(μ_a=-0.5,\n", " σ_a=0.1,\n", " μ_b=0.0,\n", " σ_b=0.5,\n", " μ_e=0.0,\n", " σ_e=0.5,\n", " s_bar=1.0,\n", " T=500,\n", " M=1_000_000,\n", " s_init=1.0):\n", "\n", " draws = np.empty(M)\n", " for m in prange(M):\n", " s = s_init\n", " for t in range(T):\n", " if s < s_bar:\n", " new_s = np.exp(μ_e + σ_e * randn())\n", " else:\n", " a = np.exp(μ_a + σ_a * randn())\n", " b = np.exp(μ_b + σ_b * randn())\n", " new_s = a * s + b\n", " s = new_s\n", " draws[m] = s\n", "\n", " return draws\n", "\n", "data = generate_draws()" ] }, { "cell_type": "markdown", "metadata": {}, "source": [ "Now we produce the rank-size plot:" ] }, { "cell_type": "code", "execution_count": null, "metadata": { "hide-output": false }, "outputs": [], "source": [ "fig, ax = plt.subplots()\n", "\n", "rank_data, size_data = qe.rank_size(data, c=0.01)\n", "ax.loglog(rank_data, size_data, 'o', markersize=3.0, alpha=0.5)\n", "ax.set_xlabel(\"log rank\")\n", "ax.set_ylabel(\"log size\")\n", "\n", "plt.show()" ] }, { "cell_type": "markdown", "metadata": {}, "source": [ "The plot produces a straight line, consistent with a Pareto tail." ] } ], "metadata": { "date": 1619590832.7123444, "filename": "kesten_processes.md", "kernelspec": { "display_name": "Python", "language": "python3", "name": "python3" }, "title": "Kesten Processes and Firm Dynamics" }, "nbformat": 4, "nbformat_minor": 4 }