{ "cells": [ { "cell_type": "markdown", "metadata": {}, "source": [ "\n", "\n", "
\n", " \n", " \"QuantEcon\"\n", " \n", "
" ] }, { "cell_type": "markdown", "metadata": {}, "source": [ "# Knowing the Forecasts of Others" ] }, { "cell_type": "markdown", "metadata": {}, "source": [ "## Contents\n", "\n", "- [Knowing the Forecasts of Others](#Knowing-the-Forecasts-of-Others) \n", " - [Introduction](#Introduction) \n", " - [The Setting](#The-Setting) \n", " - [Tactics](#Tactics) \n", " - [Equilibrium conditions](#Equilibrium-conditions) \n", " - [Equilibrium with $ \\theta_t $ stochastic but observed at $ t $](#Equilibrium-with-$-\\theta_t-$-stochastic-but-observed-at-$-t-$) \n", " - [Guess-and-verify tactic](#Guess-and-verify-tactic) \n", " - [Equilibrium with one signal on $ \\theta_t $](#Equilibrium-with-one-signal-on-$-\\theta_t-$) \n", " - [Equilibrium with two noisy signals on $ \\theta_t $](#Equilibrium-with-two-noisy-signals-on-$-\\theta_t-$) \n", " - [Comparison of the two signal structures](#Comparison-of-the-two-signal-structures) \n", " - [Notes on History of the Problem](#Notes-on-History-of-the-Problem) " ] }, { "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": true }, "outputs": [], "source": [ "!pip install --upgrade quantecon\n", "!conda install -y -c plotly plotly plotly-orca" ] }, { "cell_type": "markdown", "metadata": {}, "source": [ "## Introduction\n", "\n", "Robert E. Lucas, Jr. [[REL75]](https://python-programming.quantecon.org/zreferences.html#lucas75), Kenneth Kasa [[Kas00]](https://python-programming.quantecon.org/zreferences.html#kasa), and Robert Townsend\n", "[[Tow83]](https://python-programming.quantecon.org/zreferences.html#townsend) showed that giving decision makers incentives to infer persistent hidden state\n", "variables from equilibrium prices and quantities can\n", "elongate and amplify impulse responses to aggregate\n", "shocks in business cycle models.\n", "\n", "Townsend [[Tow83]](https://python-programming.quantecon.org/zreferences.html#townsend)\n", "noted that such incentives can naturally\n", "induce decision makers to want to forecast the forecast of others.\n", "\n", "This theme has been pursued and extended in analyses in which\n", "decision makers’ imperfect information forces them into pursuing an\n", "infinite recursion of forming beliefs about the beliefs of other\n", "(e.g., [[AMS02]](https://python-programming.quantecon.org/zreferences.html#ams)).\n", "\n", "Lucas [[REL75]](https://python-programming.quantecon.org/zreferences.html#lucas75) side stepped having decision makers forecast the\n", "forecasts of other decision makers by assuming that they simply pool their\n", "information before forecasting.\n", "\n", "A **pooling equilibrium** like Lucas’s plays a prominent role in this lecture.\n", "\n", "Because he didn’t assume such pooling, [[Tow83]](https://python-programming.quantecon.org/zreferences.html#townsend)\n", "confronted the forecasting the forecasts of others problem.\n", "\n", "To formulate the problem recursively required that Townsend define decision maker’s **state** vector.\n", "\n", "Townsend concluded that his original model required an intractable infinite dimensional state space.\n", "\n", "Therefore, he constructed a more manageable approximating model in which the hidden Markov component of\n", "the demand shock is\n", "revealed to all firms after a fixed and finite number of periods.\n", "\n", "In this lecture, as yet another instance of the theme that **finding the state is an art**,\n", "we show how to formulate Townsend’s original model in terms of a low-dimensional state space.\n", "\n", "By doing so, we show that Townsend’s model shares equilibrium prices and quantities with those that\n", "prevail in a pooling equilibrium.\n", "\n", "That finding emerged from a line of research about Townsend’s model that culminated in\n", "[[PS05]](https://python-programming.quantecon.org/zreferences.html#pearlman-sargent2005) that built on [[PCL86]](https://python-programming.quantecon.org/zreferences.html#pcl).\n", "\n", "However, rather than deploying the [[PCL86]](https://python-programming.quantecon.org/zreferences.html#pcl) machinery here, we shall rely instead on a sneaky\n", "**guess-and-verify** tactic.\n", "\n", "- We compute a pooling equilibrium and represent it as an instance of a linear state-space system provided by\n", " the Python class `quantecon.LinearStateSpace`. \n", "- Leaving the state-transition equation for the pooling equilibrium unaltered, we alter the observation vector\n", " for a firm to what it in in Townsend’s original model. So rather than directly observing the signal received by\n", " firms in the other industry, a firm sees the equilibrium price\n", " of the good produced by the other industry. \n", "- We compute a population linear least squares regression of the noisy signal that firms in the other\n", " industry receive in a pooling equilibrium on time $ t $ information that a firm receives in Townsend’s\n", " original model. The $ R^2 $ in this regression equals $ 1 $. That verifies that a firm’s information\n", " set in Townsend’s original model equals its information set in a pooling equilibrium. Therefore, equilibrium\n", " prices and quantities in Townsend’s original model equal those in a pooling equilibrium. " ] }, { "cell_type": "markdown", "metadata": {}, "source": [ "### A Sequence of Models\n", "\n", "We proceed by describing a sequence of models of two industries that are linked in a\n", "single way: shocks to the demand curves for their products have a common\n", "component.\n", "\n", "The models are simplified versions of Townsend’s [[Tow83]](https://python-programming.quantecon.org/zreferences.html#townsend).\n", "\n", "Townsend’s is a model of a rational expectations equilibrium in which firms confront\n", "the problem **forecasting the forecasts of others**.\n", "\n", "In Townsend’s model, firms condition their forecasts on observed endogenous variables whose equilibrium laws of motion\n", "are determined by their own forecasting functions.\n", "\n", "We start with model components that we shall progressively assemble in ways that can help us to appreciate the structure of a\n", "**pooling equilibrium** that ultimately concerns us.\n", "\n", "While keeping other aspects of the model the same, we shall study\n", "consequences of alternative assumptions about what decision makers\n", "observe.\n", "\n", "Technically, this lecture deploys concepts and tools that appear\n", "in [First Look at Kalman Filter](https://python-intro.quantecon.org/kalman.html) and\n", "[Rational Expectations Equilibrium](https://python-intro.quantecon.org/rational_expectations.html)." ] }, { "cell_type": "markdown", "metadata": {}, "source": [ "## The Setting\n", "\n", "We cast all variables in terms of deviations from means.\n", "\n", "Therefore, we omit constants from inverse demand curves\n", "and other functions.\n", "\n", "Firms in each of two industries $ i=1,2 $ use a single factor of\n", "production, capital $ k_t^i $, to produce output of a single good,\n", "$ y_t^i $.\n", "\n", "Firms bear quadratic costs of adjusting their capital stocks.\n", "\n", "A representative firm in industry $ i $ has production function\n", "$ y_t^i = f k_t^i $, $ f >0 $, acts as a price taker with\n", "respect to output price $ P_t^i $, and maximizes\n", "\n", "\n", "\n", "$$\n", "\\begin{aligned}\n", " E_0^i \\sum_{t=0}^\\infty \\beta^t \\left\\{ P_t^i f k_t^i - .5\n", " h (k_{t+1}^i - k_t^i)^2 \\right\\} ,\n", " \\quad h >0 .\\end{aligned} \\tag{1}\n", "$$\n", "\n", "Demand in industry $ i $ is described by the inverse demand curve\n", "\n", "\n", "\n", "$$\n", "\\begin{aligned}\n", " P_t^i = - b Y_t^i + \\theta_t + \\epsilon_t^i , \\quad b >0,\n", " \\end{aligned} \\tag{2}\n", "$$\n", "\n", "where $ P_t^i $ is the price of good $ i $ at $ t $,\n", "$ Y_t^i = f K_t^i $ is output in market $ i $, $ \\theta_t $\n", "is a persistent component of a demand shock that is common across the\n", "two industries, and $ \\epsilon_t^i $ is an industry specific\n", "component of the demand shock that is i.i.d. and whose time $ t $\n", "marginal distributon is $ {\\mathcal N}(0, \\sigma_{\\epsilon}^2) $.\n", "\n", "We assume that $ \\theta_t $ is governed by\n", "\n", "\n", "\n", "$$\n", "\\begin{aligned}\n", " \\theta_{t+1} = \\rho \\theta_t + v_{t}\n", " \\end{aligned} \\tag{3}\n", "$$\n", "\n", "where $ \\{v_{t}\\} $ is an i.i.d. sequence of Gaussian shocks each\n", "with mean zero and variance $ \\sigma_v^2 $.\n", "\n", "To simplify notation, we’ll study a special case of the model by setting\n", "$ h=f=1 $.\n", "\n", "The presence of costs of adjusting their capital stocks imparts to firms an incentives to forecast the price of the\n", "good that they sell.\n", "\n", "Throughout, we use the **rational expectations** equilibrium concept presented\n", "in this lecture [Rational Expectations Equilibrium](https://python-intro.quantecon.org/rational_expectations.html).\n", "\n", "We let capital letters denote market wide objects and lower case letters\n", "denote objects chosen by a representative firm.\n", "\n", "In each industry, a competitive equilibrium prevails.\n", "\n", "To rationalize the big $ K $, little $ k $ connection, we can\n", "think of there being a continua of each type of firm, each indexed by\n", "$ \\omega \\in [0,1] $ with\n", "$ K^i = \\int_0^1 k^i(\\omega) d \\omega $.\n", "\n", "In equilibrium, $ k_t^i = K_t^i $, but as usual we must distinguish\n", "between $ k_t^i $ and $ K_t^i $ when we pose the firm’s\n", "optimization problem." ] }, { "cell_type": "markdown", "metadata": {}, "source": [ "## Tactics\n", "\n", "We shall compute\n", "equilibrium laws of motion for capital in industry $ i $ under a\n", "sequence of assumptions about what a representative firm observes.\n", "\n", "Successive members of this sequence make a representative firm’s\n", "information more and more obscure.\n", "\n", "We begin with the most information, then gradually withdraw information\n", "in a way that approaches and eventually reaches the information\n", "structure that that we are ultimately interested in.\n", "\n", "Thus, we shall compute equilibria under the following alternative\n", "information structures:\n", "\n", "- **Perfect foresight:** future values of\n", " $ \\theta_t, \\epsilon_{t}^i $ are observed in industry $ i $. \n", "- **Observed but stochastic** $ \\theta_t $:\n", " $ \\{\\theta_t, \\epsilon_{t}^i\\} $ are realizations from a\n", " stochastic process; current and past values of each are observed at\n", " time $ t $ but future values are not. \n", "- **One noise-ridden observation on** $ \\theta_t $: Values of\n", " $ \\{\\theta_t, \\epsilon_{t}^i\\} $ separately are never observed. However, at\n", " time $ t $, a history $ w^t $ of a scalar noise-ridden\n", " observations on $ \\theta_t $ is observed at time $ t $. \n", "- **Two noise-ridden observations on** $ \\theta_t $: Values of\n", " $ \\{\\theta_t, \\epsilon_{t}^i\\} $ separately are never observed. However, at\n", " time $ t $, a history $ w^t $ of *two* noise-ridden\n", " observations on $ \\theta_t $ is observed at time $ t $. \n", "\n", "\n", "Successive computations build one on another.\n", "\n", "We proceed by first finding an equilibrium under perfect foresight.\n", "\n", "To compute an equilibrium with $ \\theta_t $ observed, we use a\n", "*certainty equivalence principle* to justify modifying the perfect\n", "foresight equilibrium by replacing future values of\n", "$ \\theta_s, \\epsilon_{s}^i, s \\geq t $ with mathematical\n", "expectations conditioned on $ \\theta_t $.\n", "\n", "This provides the equilibrium when $ \\theta_t $ is observed at\n", "$ t $ but future $ \\theta_{t+j} $ and\n", "$ \\epsilon_{t+j}^i $ are not observed.\n", "\n", "To find an equilibrium when only a history $ w_t $ of a single noise\n", "ridden observations on $ \\theta_t $ is observed, we again apply a\n", "certainty equivalence principle and replace future values of the random\n", "variables $ \\theta_s, \\epsilon_{s}^i, s \\geq t $ with their\n", "mathematical expectations conditioned on $ w^t $.\n", "\n", "To find an equilibrium when only a history $ w_t $ of a *two* noisy\n", "signal on $ \\theta_t $ is observed, we replace future values of the\n", "random variables $ \\theta_s, \\epsilon_{s}^i, s \\geq t $ with their\n", "mathematical expectations conditioned on history $ w^t $.\n", "\n", "We call the equilibrium with two noise-ridden observations on $ \\theta_t $ a **pooling equilibrium**.\n", "\n", "- It corresponds to an arrangement in which at the beginning of each\n", " period firms in industries $ 1 $ and $ 2 $ somehow get\n", " together and share information about current values of their noisy\n", " signals on $ \\theta $. \n", "\n", "\n", "We want ultimately to compare outcomes in a pooling equilibrium\n", "with an equilibrium under the following alternative information structure for a firm\n", "in industry $ i $ that interested [[Tow83]](https://python-programming.quantecon.org/zreferences.html#townsend):\n", "\n", "- **Firm** $ i $’s **noise-ridden signal on** $ \\theta_t $ **and the\n", " price in industry** $ -i $, a firm in industry\n", " $ i $ observes a history $ w^t $ of *one* noise-ridden signal\n", " on $ \\theta_t $ and a history of industry $ -i $’s price is\n", " observed. \n", "\n", "\n", "With this information structure, the representative firm $ i $ sees the price as well as the\n", "aggregate state variable $ Y_t^i $ in its own industry.\n", "\n", "That allows it to infer\n", "the total demand shock $ \\theta_t + \\epsilon_{t}^i $.\n", "\n", "However, at time $ t $, the firm sees only $ P_t^{-i} $ and does\n", "not see $ Y_t^{-i} $, so that firm $ i $ does not directly\n", "observe $ \\theta_t + \\epsilon_t^{-i} $.\n", "\n", "Nevertheless, it will turn out that equilibrium prices and quantities in this equilibrium equal\n", "their counterparts in a pooling equilibrium because\n", "firms in industry $ i $ are able to infer the noisy signal about the demand shock\n", "received by firms in industry $ -i $.\n", "\n", "We shall eventually verify this assertion by using a guess and verify tactic. [1]" ] }, { "cell_type": "markdown", "metadata": {}, "source": [ "## Equilibrium conditions\n", "\n", "It is convenient to solve the firm’s problem without\n", "uncertainty by forming the Lagrangian:\n", "\n", "$$\n", "\\begin{aligned}\n", "J=\\sum_{t=0}^\\infty \\beta^t \\left\\{\n", "P_t^i k_t^i - .5 (\\mu_t^i)^2 + \\phi_t^i \\left[\n", " k_t^i + \\mu_t^i - k_{t+1}^i \\right] \\right\\} \\end{aligned}\n", "$$\n", "\n", "where $ \\{\\phi_t^i\\} $ is a sequence of Lagrange multipliers on the\n", "transition law for $ k_{t+1}^i $. First order conditions for the\n", "nonstochastic problem are\n", "\n", "\n", "\n", "$$\n", "\\begin{aligned}\n", " \\phi_t^i & = \\beta \\phi_{t+1}^i + \\beta P_{t+1}^i \\\\\n", " \\mu_t^i & = \\phi_t^i . \\end{aligned} \\tag{4}\n", "$$\n", "\n", "Substituting the demand function [(2)](#equation-town2) for\n", "$ P_t^i $, imposing the condition that the representative firm is\n", "representative ( $ k_t^i = K_t^i $), and using the definition below\n", "of $ g_t^i $, the Euler equation [(4)](#equation-town4), lagged\n", "by one period, can be expressed as\n", "$ - b k_t^i + \\theta_t + \\epsilon_t^i + (k_{t+1}^i - k_t^i) - g_t^i =0 $\n", "or\n", "\n", "\n", "\n", "$$\n", "\\begin{aligned}\n", " k_{t+1}^i = (b+1) k_t^i - \\theta_t - \\epsilon_t^i + g_t^i\n", " \\end{aligned} \\tag{5}\n", "$$\n", "\n", "where we define $ g_t^i $ by\n", "\n", "\n", "\n", "$$\n", "g_t^i = \\beta^{-1} (k_t^i - k_{t-1}^i) \\tag{6}\n", "$$\n", "\n", "We can write Euler equation [(4)](#equation-town4) as:\n", "\n", "\n", "\n", "$$\n", "\\begin{aligned}\n", " g_t^i = P_t^i + \\beta g_{t+1}^i\n", " \\end{aligned} \\tag{7}\n", "$$\n", "\n", "In addition, we have the law of motion for $ \\theta_t $,\n", "[(3)](#equation-town2a), and the demand equation\n", "[(2)](#equation-town2).\n", "\n", "In summary, with perfect foresight, equilibrium conditions for industry\n", "$ i $ include the following system of difference equations:\n", "\n", "\n", "\n", "$$\n", "\\begin{aligned}\n", " k_{t+1}^i & = (1+b)k_t^i - \\epsilon_t^i -\\theta_t + g_t^i \\\\\n", " \\theta_{t+1} & = \\rho \\theta_t + v_t \\\\\n", " g_{t+1}^i & = \\beta^{-1} (g_t^i - P_t^i) \\\\\n", " P_t^i & = -b k_t^i + \\epsilon_t^i + \\theta_t \\end{aligned} \\tag{8}\n", "$$\n", "\n", "Without perfect foresight, the same system prevails except that the\n", "following equation replaces the third equation of [(8)](#equation-sol1):\n", "\n", "$$\n", "\\begin{aligned}\n", "g_{t+1,t}^i = \\beta^{-1} (g_t^i - P_t^i) \\end{aligned}\n", "$$\n", "\n", "where\n", "$ x_{t+1,t} $ denotes the mathematical expectation of\n", "$ x_{t+1} $ conditional on information at time $ t $." ] }, { "cell_type": "markdown", "metadata": {}, "source": [ "### Equilibrium under perfect foresight\n", "\n", "Our first step is to compute the equilibrium law of motion for\n", "$ k_t^i $ under perfect foresight.\n", "\n", "Let $ L $ be the lag\n", "operator. [4]\n", "\n", "Equations [(7)](#equation-pcl10) and [(5)](#equation-pcl11)\n", "imply the second order difference equation in\n", "$ k_t^i $: [5]\n", "\n", "\n", "\n", "$$\n", "\\begin{aligned}\n", " \\left[ (L^{-1} - (1+b))(1-\\beta L^{-1}) + b\\right] k_t^i\n", " = \\beta L^{-1} \\epsilon_t^i + \\beta L^{-1} \\theta_t .\n", " \\end{aligned} \\tag{9}\n", "$$\n", "\n", "Factor the polynomial in $ L $ on the left side as:\n", "\n", "$$\n", "\\begin{aligned}\n", "-\\beta [L^{-2} -(\\beta^{-1} + (1+b))L^{-1} + \\beta^{-1}]\n", "= \\tilde \\lambda^{-1}(L^{-1} - \\tilde \\lambda)(1-\\tilde \\lambda \\beta L^{-1})\n", "\\end{aligned}\n", "$$\n", "\n", "where $ |\\tilde \\lambda | < 1 $ is the smaller root and\n", "$ \\lambda $ is the larger root of\n", "$ (\\lambda-1)(\\lambda-1/\\beta)=b\\lambda $.\n", "\n", "Therefore, [(9)](#equation-euler1) can be expressed as\n", "\n", "$$\n", "\\begin{aligned}\n", "\\tilde \\lambda^{-1}(L^{-1} - \\tilde \\lambda) (1-\\tilde \\lambda \\beta L^{-1})\n", "k_t^i = \\beta L^{-1} \\epsilon_t^i + \\beta L^{-1} \\theta_t .\n", "\\end{aligned}\n", "$$\n", "\n", "Solving the stable root backwards and the unstable root forwards gives\n", "\n", "$$\n", "\\begin{aligned}\n", "k_{t+1}^i = \\tilde \\lambda k_t^i + {\\tilde \\lambda \\beta \\over 1 -\\tilde\n", "\\lambda \\beta L^{-1}}\n", "(\\epsilon_{t+1}^i + \\theta_{t+1} ) .\n", "\\end{aligned}\n", "$$\n", "\n", "Recall that we have already set $ k^i = K^i $ at the appropriate point in the argument (i.e., _after_ having derived the first-order necessary\n", "conditions for a representative firm in industry $ i $.\n", "\n", "Thus, under perfect foresight the equilibrium capital stock in industry $ i $ satisfies\n", "\n", "\n", "\n", "$$\n", "\\begin{aligned}\n", " k_{t+1}^i = \\tilde \\lambda k_t^i + \\sum_{j=1}^\\infty (\\tilde \\lambda \\beta)^j\n", " (\\epsilon_{t+j}^i + \\theta_{t+j}) .\n", " \\end{aligned} \\tag{10}\n", "$$\n", "\n", "Next, we shall investigate consequences of replacing future values of\n", "$ (\\epsilon_{t+j}^i + \\theta_{t+j}) $ in equation [(10)](#equation-town5) with alternative forecasting schemes.\n", "\n", "In particular, we shall compute equilibrium laws of motion for capital\n", "under alternative assumptions about the information available to\n", "decision makers in market $ i $." ] }, { "cell_type": "markdown", "metadata": {}, "source": [ "## Equilibrium with $ \\theta_t $ stochastic but observed at $ t $\n", "\n", "If future $ \\theta $’s are unknown at $ t $, it is appropriate\n", "to replace all random variables on the right side of\n", "[(10)](#equation-town5) with their conditional expectations based on\n", "the information available to decision makers in market $ i $.\n", "\n", "For now, we assume that this information set\n", "$ I_t^p = \\begin{bmatrix} \\theta^t & \\epsilon^{it} \\end{bmatrix} $,\n", "where $ z^t $ represents the infinite history of variable\n", "$ z_s $ up to time $ t $.\n", "\n", "Later we shall give firms less information.\n", "\n", "To obtain an appropriate counterpart to [(10)](#equation-town5) under our\n", "current assumption about information, we apply a certainty equivalence\n", "principle.\n", "\n", "In particular, it is appropriate to take [(10)](#equation-town5) and\n", "replace each term $ ( \\epsilon_{t+j}^i+ \\theta_{t+j} ) $ on the\n", "right side with\n", "$ E[ (\\epsilon_{t+j}^i+ \\theta_{t+j}) \\vert \\theta^t ] $.\n", "\n", "After using [(3)](#equation-town2a) and the i.i.d. assumption about\n", "$ \\{\\epsilon_t^i\\} $, this gives\n", "\n", "$$\n", "\\begin{aligned}\n", "k_{t+1}^i = \\tilde \\lambda k_t^i + {\\tilde \\lambda \\beta \\rho \\over 1 -\n", "\\tilde \\lambda \\beta \\rho }\n", "\\theta_t\n", "\\end{aligned}\n", "$$\n", "\n", "or\n", "\n", "\n", "\n", "$$\n", "\\begin{aligned}\n", " k_{t+1}^i = \\tilde \\lambda k_t^i + {\\rho \\over \\lambda - \\rho} \\theta_t\n", " \\end{aligned} \\tag{11}\n", "$$\n", "\n", "where $ \\lambda \\equiv (\\beta \\tilde \\lambda)^{-1} $.\n", "\n", "For future purposes, it is useful to represent the equilibrium\n", "$ \\{k_t^i\\}_t $ process recursively as\n", "\n", "\n", "\n", "$$\n", "\\begin{aligned}\n", " k_{t+1}^i & = \\tilde \\lambda k_t^i + {1 \\over \\lambda - \\rho}\n", " \\hat \\theta_{t+1} \\\\\n", " \\hat \\theta_{t+1} & = \\rho \\theta_t \\\\\n", " \\theta_{t+1} & = \\rho \\theta_t + v_t. \\end{aligned} \\tag{12}\n", "$$" ] }, { "cell_type": "markdown", "metadata": {}, "source": [ "### Filtering" ] }, { "cell_type": "markdown", "metadata": {}, "source": [ "#### One noisy signal\n", "\n", "We get closer to a model that we ultimately want to study by now\n", "assuming that firms in market $ i $ do not observe $ \\theta_t $,\n", "but instead observe a history $ w^t $ of noisy signals at time $ t $.\n", "\n", "In particular, assume that\n", "\n", "\n", "\n", "$$\n", "\\begin{aligned}\n", " w_t & = \\theta_t + e_t \\label{kf1} \\\\\n", " \\theta_{t+1} & = \\rho \\theta_t + v_t\n", " \\end{aligned} \\tag{13}\n", "$$\n", "\n", "where $ e_t $ and $ v_t $ are mutually independent\n", "i.i.d. Gaussian shock processes with means of zero and variances\n", "$ \\sigma_e^2 $ and $ \\sigma_v^2 $, respectively.\n", "\n", "Define\n", "\n", "$$\n", "\\begin{aligned}\n", "\\hat \\theta_{t+1} = E(\\theta_{t+1} | w^t)\n", "\\end{aligned}\n", "$$\n", "\n", "where $ w^t = [w_t, w_{t-1}, \\ldots, w_0] $ denotes the history of the $ w_s $ process up to\n", "and including $ t $.\n", "\n", "Associated with the state-space representation\n", "[(13)](#equation-kf1-2) is the *innovations\n", "representation*\n", "\n", "\n", "\n", "$$\n", "\\begin{aligned}\n", " \\hat \\theta_{t+1} & = \\rho \\hat \\theta_t + k a_t \\\\\n", " w_t & = \\hat \\theta_t + a_t\n", " \\end{aligned} \\tag{14}\n", "$$\n", "\n", "where $ a_t \\equiv w_t - E(w_t | w^{t-1}) $ is the *innovations*\n", "process in $ w_t $ and the Kalman gain $ k $ is\n", "\n", "\n", "\n", "$$\n", "\\begin{aligned}\n", " k = {\\rho p \\over p + \\sigma_e^2} \\end{aligned} \\tag{15}\n", "$$\n", "\n", "and where $ p $ satisfies the Riccati equation\n", "\n", "\n", "\n", "$$\n", "\\begin{aligned}\n", " p = \\sigma_v^2 + { p \\rho^2 \\sigma_e^2 \\over \\sigma_e^2 + p}.\n", " \\end{aligned} \\tag{16}\n", "$$" ] }, { "cell_type": "markdown", "metadata": {}, "source": [ "#### $ \\theta $-reconstruction error:\n", "\n", "Define the state *reconstruction error* $ \\tilde \\theta_t $ by\n", "\n", "$$\n", "\\begin{aligned}\n", "\\tilde \\theta_t = \\theta_t - \\hat \\theta_t .\n", "\\end{aligned}\n", "$$\n", "\n", "Then $ p = E \\tilde \\theta_t^2 $.\n", "\n", "Equations [(13)](#equation-kf1-2) and [(14)](#equation-kf3-4) imply\n", "\n", "\n", "\n", "$$\n", "\\begin{aligned}\n", " \\tilde \\theta_{t+1} = (\\rho - k) \\tilde \\theta_t + v_t - k e_t .\n", " \\end{aligned} \\tag{17}\n", "$$\n", "\n", "Now notice that we can express $ \\hat \\theta_{t+1} $ as\n", "\n", "\n", "\n", "$$\n", "\\hat \\theta_{t+1} = [\\rho \\theta_t + v_t] + [ ke_t - (\\rho -k) \\tilde \\theta_t - v_t] , \\tag{18}\n", "$$\n", "\n", "where the first term in braces equals\n", "$ \\theta_{t+1} $ and the second term in braces equals\n", "$ -\\tilde \\theta_{t+1} $.\n", "\n", "We can express [(11)](#equation-solution1) as\n", "\n", "\n", "\n", "$$\n", "\\begin{aligned}\n", " k_{t+1}^i = \\tilde \\lambda k_t^i + {1 \\over \\lambda - \\rho}\n", " E \\theta_{t+1} | \\theta^t .\n", " \\end{aligned} \\tag{19}\n", "$$\n", "\n", "An application of a certainty equivalence principle asserts that when\n", "only $ w^t $ is observed, the appropriate solution is found by\n", "replacing the information set $ \\theta^t $ with $ w^t $ in\n", "[(19)](#equation-solution2).\n", "\n", "Making this substitution and using [(18)](#equation-kf8) leads to\n", "\n", "\n", "\n", "$$\n", "\\begin{aligned}\n", " k_{t+1}^i = \\tilde \\lambda k_t^i + {\\rho \\over \\lambda - \\rho} \\theta_t + {k \\over \\lambda - \\rho} e_t - {\\rho - k \\over \\lambda - \\rho} \\tilde \\theta_t .\n", " \\end{aligned} \\tag{20}\n", "$$\n", "\n", "Simplifying equation [(18)](#equation-kf8), we also have\n", "\n", "\n", "\n", "$$\n", "\\begin{aligned}\n", " \\hat \\theta_{t+1} = \\rho \\theta_t + ke_t - (\\rho -k) \\tilde \\theta_t .\n", " \\end{aligned} \\tag{21}\n", "$$\n", "\n", "Equations [(20)](#equation-kf9), [(21)](#equation-kf8a) describe\n", "the equilibrium when $ w^t $ is observed.\n", "\n", "Relative to [(11)](#equation-solution1), the equilibrium acquires a new\n", "state variable, namely, the $ \\theta $–reconstruction error,\n", "$ \\tilde \\theta_t $.\n", "\n", "For future purposes, by using [(15)](#equation-kal1), it is useful to\n", "write [(20)](#equation-kf9) as\n", "\n", "\n", "\n", "$$\n", "\\begin{aligned}\n", " k_{t+1}^i = \\tilde \\lambda k_t^i + {\\rho \\over \\lambda - \\rho } \\theta_t + {1 \\over \\lambda - \\rho} {p \\rho \\over p + \\sigma_e^2} e_t - {1 \\over \\lambda - \\rho} {\\rho \\sigma_e^2 \\over p + \\sigma_e^2}\n", " \\tilde \\theta_t\n", " \\end{aligned} \\tag{22}\n", "$$\n", "\n", "In summary, when decision makers in market $ i $ observe a noisy\n", "signal $ w_t $ on $ \\theta_t $ at $ t $, we can represent an\n", "equilibrium law of motion for $ k_t^i $ as\n", "\n", "\n", "\n", "$$\n", "\\begin{aligned}\n", "k_{t+1}^i & = \\tilde \\lambda k_t^i + {1 \\over \\lambda - \\rho} \\hat \\theta_{t+1} \\\\\n", "\\hat \\theta_{t+1} & = \\rho \\theta_t + {\\rho p \\over p + \\sigma_e^2} e_t - {\\rho \\sigma_e^2 \\over p + \\sigma_e^2} \\tilde \\theta_t \\\\\n", "\\tilde \\theta_{t+1} & = { \\rho \\sigma_e^2 \\over p + \\sigma_e^2} \\tilde\n", " \\theta_t - {p \\rho \\over p + \\sigma_e^2} e_t + v_t \\\\\n", "\\theta_{t+1} & = \\rho \\theta_t + v_t . \\end{aligned} \\tag{23}\n", "$$" ] }, { "cell_type": "markdown", "metadata": {}, "source": [ "### Two noisy signals\n", "\n", "We now construct a **pooling equilibrium** by assuming that a firm in\n", "industry $ i $ receives a vector $ w_t $ of *two* noisy signals\n", "on $ \\theta_t $:\n", "\n", "$$\n", "\\begin{eqnarray*}\n", "\\theta_{t+1} & = & \\rho\\theta_{t}+v_{t} \\label{kf20} \\\\\n", "w_{t} & = & \\begin{bmatrix}1\\\\\n", "1\n", "\\end{bmatrix}\\theta_{t}+\\begin{bmatrix}e_{1t} \\\\\n", "e_{2t}\n", "\\end{bmatrix} \\label{kf21}\n", "\\end{eqnarray*}\n", "$$\n", "\n", "To justify that we are constructing is a **pooling equilibrium** we can\n", "assume that\n", "\n", "$$\n", "\\begin{aligned}\n", "\\begin{bmatrix} e_{1t} \\\\ e_{2t} \\end{bmatrix} =\n", "\\begin{bmatrix} \\epsilon_{t}^1 \\\\ \\epsilon_{t}^2 \\end{bmatrix}\n", "\\end{aligned}\n", "$$\n", "\n", "so that a firm in industry $ i $ observes the noisy signals on that\n", "$ \\theta_t $ presented to firms in both industries $ i $ and\n", "$ -i $.\n", "\n", "The appropriate innovations representation becomes\n", "\n", "\n", "\n", "$$\n", "\\begin{aligned}\n", " \\hat \\theta_{t+1} & = \\rho\n", " \\hat \\theta_t + k a_t \\\\\n", " w_t & = \\begin{bmatrix} 1 \\\\ 1 \\end{bmatrix} \\hat \\theta_t + a_t\n", " \\end{aligned} \\tag{24}\n", "$$\n", "\n", "where $ a_t \\equiv w_t - E [w_t | w^{t-1}] $ is a\n", "$ (2 \\times 1) $ vector of innovations in $ w_t $ and $ k $\n", "is now a $ (1 \\times 2) $ vector of Kalman gains.\n", "\n", "Formulas for the Kalman filter imply that\n", "\n", "\n", "\n", "$$\n", "\\begin{aligned}\n", " k ={ \\rho p \\over 2 p + \\sigma_e^2}\n", " \\begin{bmatrix}1 & 1 \\end{bmatrix}\n", " \\end{aligned} \\tag{25}\n", "$$\n", "\n", "where $ p = E \\tilde \\theta_t \\tilde \\theta_t^T $ now satisfies the\n", "Riccati equation\n", "\n", "\n", "\n", "$$\n", "\\begin{aligned}\n", " p = \\sigma_v^2 + {p \\rho^2 \\sigma_e^2 \\over 2 p + \\sigma_e^2}.\n", " \\end{aligned} \\tag{26}\n", "$$\n", "\n", "Thus, when a representative firm in industry $ i $ observes *two*\n", "noisy signals on $ \\theta_t $, we can express the equilibrium law of\n", "motion for capital recursively as\n", "\n", "\n", "\n", "$$\n", "\\begin{aligned}\n", "k_{t+1}^i & = \\tilde \\lambda k_t^i + {1 \\over \\lambda - \\rho}\\hat \\theta_{t+1} \\\\\n", "\\hat \\theta_{t+1} & = \\rho \\theta_t + {\\rho p \\over 2 p + \\sigma_e^2} (e_{1t}+e_{2t}) - {\\rho \\sigma_e^2 \\over 2 p + \\sigma_e^2} \\tilde \\theta_t \\\\\n", "\\tilde \\theta_{t+1} & = { \\rho \\sigma_e^2 \\over 2 p + \\sigma_e^2} \\tilde \\theta_t - {p \\rho \\over 2 p + \\sigma_e^2}(e_{1t}+e_{2t}) +v_t \\\\\n", "\\theta_{t+1} & = \\rho \\theta_t + v_t .\n", " \\end{aligned} \\tag{27}\n", "$$\n", "\n", "Below, by using a guess-and-verify tactic, we shall show that outcomes in this **pooling equilibrium** equal those in an equilibrium under the alternative\n", "information structure that interested [[Tow83]](https://python-programming.quantecon.org/zreferences.html#townsend). [6]" ] }, { "cell_type": "markdown", "metadata": {}, "source": [ "## Guess-and-verify tactic\n", "\n", "As a preliminary step we shall take our recursive representation [(23)](#equation-sol0a)\n", "of an equilibrium in industry $ i $ with one noisy signal\n", "on $ \\theta_t $ and perform the following steps:\n", "\n", "- Compute $ \\lambda $ and $ \\tilde{\\lambda} $ by posing a\n", " root-finding problem and then solving it using `numpy.roots` \n", "- Compute $ p $ by forming the appropriate discrete Riccati equation and then solving it\n", " using `quantecon.solve_discrete_riccati` \n", "- Add a *measurement equation* for\n", " $ P_t^i = b k_t^i + \\theta_t + e_t $, $ \\theta_t + e_t $,\n", " and $ e_t $ to system [(23)](#equation-sol0a). Write the resulting system\n", " in state-space form and encode it using `quantecon.LinearStateSpace` \n", "- Use methods of the `quantecon.LinearStateSpace` to compute impulse response\n", " functions of $ k_t^i $ with respect to shocks $ v_t, e_t $. \n", "\n", "\n", "After analyzing the one-noisy-signal structure in this way, by making appropriate modifications\n", "we shall analyze the two-noisy-signal\n", "structure.\n", "\n", "We proceed to analyze first the one-noisy-signal structure and then the two-noisy-signal structure." ] }, { "cell_type": "markdown", "metadata": {}, "source": [ "## Equilibrium with one signal on $ \\theta_t $" ] }, { "cell_type": "markdown", "metadata": {}, "source": [ "### Step 1: Solve for $ \\tilde{\\lambda} $ and $ \\lambda $\n", "\n", "1. Cast\n", " $ \\left(\\lambda-1\\right)\\left(\\lambda-\\frac{1}{\\beta}\\right)=b\\lambda $\n", " as $ p\\left(\\lambda\\right)=0 $ where $ p $ is a polynomial\n", " function of $ \\lambda $. \n", "1. Use `numpy.roots` to solve for the roots of $ p $ \n", "1. Verify $ \\lambda \\approx \\frac{1}{\\beta\\tilde{\\lambda}} $ \n", "\n", "\n", "Note that\n", "$ p\\left(\\lambda\\right)=\\lambda^{2}-\\left(1+b+\\frac{1}{\\beta}\\right)\\lambda+\\frac{1}{\\beta} $." ] }, { "cell_type": "markdown", "metadata": {}, "source": [ "### Step 2: Solve for $ p $\n", "\n", "1. Cast\n", " $ p=\\sigma_{v}^{2}+\\frac{p\\rho^{2}\\sigma_{e}^{2}}{2p+\\sigma_{e}^{2}} $\n", " as a discrete matrix Riccati equation. \n", "1. Use `quantecon.solve_discrete_riccati` to solve for $ p $ \n", "1. Verify\n", " $ p \\approx\\sigma_{v}^{2}+\\frac{p\\rho^{2}\\sigma_{e}^{2}}{2p+\\sigma_{e}^{2}} $ \n", "\n", "\n", "Note that:\n", "\n", "$$\n", "\\begin{aligned}\n", " A & = & \\left[\\begin{array}{c}\n", " \\rho\\end{array}\\right]\\\\\n", " B & = & \\left[\\begin{array}{c}\n", " \\sqrt{2}\\end{array}\\right]\\\\\n", " R & = & \\left[\\begin{array}{c}\n", " \\sigma_{e}^{2}\\end{array}\\right]\\\\\n", " Q & = & \\left[\\begin{array}{c}\n", " \\sigma_{v}^{2}\\end{array}\\right]\\\\\n", " N & = & \\left[\\begin{array}{c}\n", " 0\\end{array}\\right]\n", "\\end{aligned}\n", "$$" ] }, { "cell_type": "markdown", "metadata": {}, "source": [ "### Step 3: Represent the system using `quantecon.LinearStateSpace`\n", "\n", "We use the following representation for constructing the\n", "`quantecon.LinearStateSpace` instance.\n", "\n", "$$\n", "\\begin{eqnarray*}\n", "\\underbrace{\\left[\\begin{array}{c}\n", "e_{t+1}\\\\\n", "k_{t+1}^{i}\\\\\n", "\\tilde{\\theta}_{t+1}\\\\\n", "P_{t+1}\\\\\n", "\\theta_{t+1}\\\\\n", "v_{t+1}\n", "\\end{array}\\right]}_{x_{t+1}} & = & \\underbrace{\\left[\\begin{array}{cccccc}\n", "0 & 0 & 0 & 0 & 0 & 0\\\\\n", "\\frac{\\kappa}{\\lambda-\\rho} & \\tilde{\\lambda} & \\frac{-1}{\\lambda-\\rho}\\frac{\\kappa\\sigma_{e}^{2}}{p} & 0 & \\frac{\\rho}{\\lambda-\\rho} & 0\\\\\n", "-\\kappa & 0 & \\frac{\\kappa\\sigma_{e}^{2}}{p} & 0 & 0 & 1\\\\\n", "\\frac{b\\kappa}{\\lambda-\\rho} & b\\tilde{\\lambda} & \\frac{-b}{\\lambda-\\rho}\\frac{\\kappa\\sigma_{e}^{2}}{p} & 0 & \\frac{b\\rho}{\\lambda-\\rho}+\\rho & 1\\\\\n", "0 & 0 & 0 & 0 & \\rho & 1\\\\\n", "0 & 0 & 0 & 0 & 0 & 0\n", "\\end{array}\\right]}_{A}\\underbrace{\\left[\\begin{array}{c}\n", "e_{t}\\\\\n", "k_{t}^{i}\\\\\n", "\\tilde{\\theta}_{t}\\\\\n", "P_{t}\\\\\n", "\\theta_{t}\\\\\n", "v_{t}\n", "\\end{array}\\right]}_{x_{t}}+\\underbrace{\\left[\\begin{array}{cc}\n", "\\sigma_{e} & 0\\\\\n", "0 & 0\\\\\n", "0 & 0\\\\\n", "\\sigma_{e} & 0\\\\\n", "0 & 0\\\\\n", "0 & \\sigma_{v}\n", "\\end{array}\\right]}_{C}\\left[\\begin{array}{c}\n", "z_{1,t+1}\\\\\n", "z_{2,t+1}\n", "\\end{array}\\right]\\\\\n", "\\underbrace{\\left[\\begin{array}{c}\n", "P_{t}\\\\\n", "e_{t}+\\theta_{t}\\\\\n", "e_{t}\n", "\\end{array}\\right]}_{y_{t}} & = & \\underbrace{\\left[\\begin{array}{cccccc}\n", "0 & 0 & 0 & 1 & 0 & 0\\\\\n", "1 & 0 & 0 & 0 & 1 & 0\\\\\n", "1 & 0 & 0 & 0 & 0 & 0\n", "\\end{array}\\right]}_{G}\\underbrace{\\left[\\begin{array}{c}\n", "e_{t}\\\\\n", "k_{t}^{i}\\\\\n", "\\tilde{\\theta}_{t}\\\\\n", "P_{t}\\\\\n", "\\theta_{t}\\\\\n", "v_{t}\n", "\\end{array}\\right]}_{x_{t}}+\\underbrace{\\left[\\begin{array}{c}\n", "0\\\\\n", "0\\\\\n", "0\n", "\\end{array}\\right]}_{H}w_{t+1}\\\\\n", "\\left[\\begin{array}{c}\n", "z_{1,t+1}\\\\\n", "z_{2,t+1}\\\\\n", "w_{t+1}\n", "\\end{array}\\right] & \\sim & \\mathcal{N}\\left(0,I\\right)\\\\\n", "\\kappa & = & \\frac{\\rho p}{p+\\sigma_{e}^{2}}\n", "\\end{eqnarray*}\n", "$$\n", "\n", "This representation includes extraneous variables such as $ P_{t} $ in the\n", "state vector.\n", "\n", "We formulate things in this way because\n", "it allows us easily to compute covariances of these variables with other\n", "components of the state vector (step 5 above) by using the `stationary_distributions` method of the `LinearStateSpace` class." ] }, { "cell_type": "code", "execution_count": null, "metadata": { "hide-output": false }, "outputs": [], "source": [ "import numpy as np\n", "import quantecon as qe\n", "from plotly.subplots import make_subplots\n", "import plotly.graph_objects as go\n", "import plotly.express as px\n", "import plotly.offline as pyo\n", "from statsmodels.regression.linear_model import OLS\n", "from IPython.display import display, Latex, Image\n", "\n", "pyo.init_notebook_mode(connected=True)" ] }, { "cell_type": "code", "execution_count": null, "metadata": { "hide-output": false }, "outputs": [], "source": [ "β = 0.9 # Discount factor\n", "ρ = 0.8 # Persistence parameter for the hidden state\n", "b = 1.5 # Demand curve parameter\n", "σ_v = 0.5 # Standard deviation of shock to θ_t\n", "σ_e = 0.6 # Standard deviation of shocks to w_t" ] }, { "cell_type": "code", "execution_count": null, "metadata": { "hide-output": false }, "outputs": [], "source": [ "# Compute λ\n", "poly = np.array([1, -(1 + β + b) / β, 1 / β])\n", "roots_poly = np.roots(poly)\n", "λ_tilde = roots_poly.min()\n", "λ = roots_poly.max()" ] }, { "cell_type": "code", "execution_count": null, "metadata": { "hide-output": false }, "outputs": [], "source": [ "# Verify that λ = (βλ_tilde) ^ (-1)\n", "tol = 1e-12\n", "np.max(np.abs(λ - 1 / (β * λ_tilde))) < tol" ] }, { "cell_type": "code", "execution_count": null, "metadata": { "hide-output": false }, "outputs": [], "source": [ "A_ricc = np.array([[ρ]])\n", "B_ricc = np.array([[1.]])\n", "R_ricc = np.array([[σ_e ** 2]])\n", "Q_ricc = np.array([[σ_v ** 2]])\n", "N_ricc = np.zeros((1, 1))\n", "p = qe.solve_discrete_riccati(A_ricc, B_ricc, Q_ricc, R_ricc, N_ricc).item()\n", "\n", "p_one = p # Save for comparison later" ] }, { "cell_type": "code", "execution_count": null, "metadata": { "hide-output": false }, "outputs": [], "source": [ "# Verify that p = σ_v ^ 2 + p * ρ ^ 2 - (ρ * p) ^ 2 / (p + σ_e ** 2)\n", "tol = 1e-12\n", "np.abs(p - (σ_v ** 2 + p * ρ ** 2 - (ρ * p) ** 2 / (p + σ_e ** 2))) < tol" ] }, { "cell_type": "code", "execution_count": null, "metadata": { "hide-output": false }, "outputs": [], "source": [ "κ = ρ * p / (p + σ_e ** 2)\n", "κ_prod = κ * σ_e ** 2 / p\n", "\n", "κ_one = κ # Save for comparison later\n", "\n", "A_lss = np.array([[0., 0., 0., 0., 0., 0.],\n", " [κ / (λ - ρ), λ_tilde, -κ_prod / (λ - ρ), 0., ρ / (λ - ρ), 0.],\n", " [-κ, 0., κ_prod, 0., 0., 1.],\n", " [b * κ / (λ - ρ) , b * λ_tilde, -b * κ_prod / (λ - ρ), 0., b * ρ / (λ - ρ) + ρ, 1.],\n", " [0., 0., 0., 0., ρ, 1.],\n", " [0., 0., 0., 0., 0., 0.]])\n", "\n", "C_lss = np.array([[σ_e, 0.],\n", " [0., 0.],\n", " [0., 0.],\n", " [σ_e, 0.],\n", " [0., 0.],\n", " [0., σ_v]])\n", "\n", "G_lss = np.array([[0., 0., 0., 1., 0., 0.],\n", " [1., 0., 0., 0., 1., 0.],\n", " [1., 0., 0., 0., 0., 0.]])" ] }, { "cell_type": "code", "execution_count": null, "metadata": { "hide-output": false }, "outputs": [], "source": [ "mu_0 = np.array([0., 0., 0., 0., 0., 0.])\n", "\n", "lss = qe.LinearStateSpace(A_lss, C_lss, G_lss, mu_0=mu_0)" ] }, { "cell_type": "code", "execution_count": null, "metadata": { "hide-output": false }, "outputs": [], "source": [ "ts_length = 100_000\n", "x, y = lss.simulate(ts_length, random_state=1)" ] }, { "cell_type": "code", "execution_count": null, "metadata": { "hide-output": false }, "outputs": [], "source": [ "# Verify that two ways of computing P_t match\n", "np.max(np.abs(np.array([[1., b, 0., 0., 1., 0.]]) @ x - x[3])) < 1e-12" ] }, { "cell_type": "markdown", "metadata": {}, "source": [ "### Step 4: Compute impulse response functions\n", "\n", "To compute impulse response functions of $ k_t^i $, we use the `impulse_response` method of the\n", "`quantecon.LinearStateSpace` class and plot the result." ] }, { "cell_type": "code", "execution_count": null, "metadata": { "hide-output": false }, "outputs": [], "source": [ "xcoef, ycoef = lss.impulse_response(j=21)\n", "data = np.array([xcoef])[0, :, 1, :]\n", "\n", "fig = go.Figure(data=go.Scatter(y=data[:-1, 0], name=r'$e_{t+1}$'))\n", "fig.add_trace(go.Scatter(y=data[1:, 1], name=r'$v_{t+1}$'))\n", "fig.update_layout(title=r'Impulse Response Function',\n", " xaxis_title='Time',\n", " yaxis_title=r'$k^{i}_{t}$')\n", "fig1 = fig\n", "# Export to PNG file\n", "Image(fig1.to_image(format=\"png\"))\n", "# fig1.show() will provide interactive plot when running\n", "# notebook locally" ] }, { "cell_type": "markdown", "metadata": {}, "source": [ "### Step 5: Compute stationary covariance matrices and population regressions\n", "\n", "We compute stationary covariance matrices by\n", "calling the `stationary_distributions` method of\n", "the `quantecon.LinearStateSpace` class.\n", "\n", "By appropriately decomposing the covariance matrix of the state vector, we obtain ingredients\n", "of some population regression coefficients.\n", "\n", "$$\n", "\\Sigma_{x}=\\left[\\begin{array}{cc}\n", "\\Sigma_{11} & \\Sigma_{12}\\\\\n", "\\Sigma_{21} & \\Sigma_{22}\n", "\\end{array}\\right]\n", "$$\n", "\n", "where $ \\Sigma_{11} $ is the covariance matrix of dependent variables and $ \\Sigma_{22} $ is the covariance matrix of independent variables.\n", "\n", "Regression coefficients are $ \\beta=\\Sigma_{21}\\Sigma_{22}^{-1} $.\n", "\n", "To verify an instance of a law of large numbers computation, we construct a long simulation of\n", "the state vector and for the resulting sample compute\n", "the ordinary least-squares estimator of $ \\beta $ that we shall compare to the corresponding population regression\n", "coefficients." ] }, { "cell_type": "code", "execution_count": null, "metadata": { "hide-output": false }, "outputs": [], "source": [ "_, _, Σ_x, Σ_y, Σ_yx = lss.stationary_distributions()\n", "\n", "Σ_11 = Σ_x[0, 0]\n", "Σ_12 = Σ_x[0, 1:4]\n", "Σ_21 = Σ_x[1:4, 0]\n", "Σ_22 = Σ_x[1:4, 1:4]\n", "\n", "reg_coeffs = Σ_12 @ np.linalg.inv(Σ_22)\n", "\n", "print('Regression coefficients (e_t on k_t, P_t, \\\\tilde{\\\\theta_t})')\n", "print('------------------------------')\n", "print(r'k_t:', reg_coeffs[0])\n", "print(r'\\tilde{\\theta_t}:', reg_coeffs[1])\n", "print(r'P_t:', reg_coeffs[2])" ] }, { "cell_type": "code", "execution_count": null, "metadata": { "hide-output": false }, "outputs": [], "source": [ "# Compute R squared\n", "R_squared = reg_coeffs @ Σ_x[1:4, 1:4] @ reg_coeffs / Σ_x[0, 0]\n", "R_squared" ] }, { "cell_type": "code", "execution_count": null, "metadata": { "hide-output": false }, "outputs": [], "source": [ "# Verify that the computed coefficients are close to least squares estimates\n", "model = OLS(x[0], x[1:4].T)\n", "reg_res = model.fit()\n", "np.max(np.abs(reg_coeffs - reg_res.params)) < 1e-2" ] }, { "cell_type": "code", "execution_count": null, "metadata": { "hide-output": false }, "outputs": [], "source": [ "# Verify that R_squared matches least squares estimate\n", "np.abs(reg_res.rsquared - R_squared) < 1e-2" ] }, { "cell_type": "code", "execution_count": null, "metadata": { "hide-output": false }, "outputs": [], "source": [ "# Verify that θ_t + e_t can be recovered\n", "model = OLS(y[1], x[1:4].T)\n", "reg_res = model.fit()\n", "np.abs(reg_res.rsquared - 1.) < 1e-6" ] }, { "cell_type": "markdown", "metadata": {}, "source": [ "## Equilibrium with two noisy signals on $ \\theta_t $\n", "\n", "Steps 1, 4, and 5 are identical to those for the one-noisy-signal structure.\n", "\n", "Step 2 requires only a straightforward modification.\n", "\n", "For step 3, we use construct the following state-space representation so that we can get our hands on\n", "all of the random processes that we require in order to compute a regression of the noisy signal about\n", "$ \\theta $ from the other industry that a firm receives directly in a pooling equilibrium on the information that\n", "a firm receives in Townsend’s original model.\n", "\n", "For this purpose, we include equilibrium goods prices from both industries appear in the state vector:\n", "\n", "$$\n", "\\begin{eqnarray*}\n", "\\underbrace{\\left[\\begin{array}{c}\n", "e_{1,t+1}\\\\\n", "e_{2,t+1}\\\\\n", "k_{t+1}^{i}\\\\\n", "\\tilde{\\theta}_{t+1}\\\\\n", "P_{t+1}^{1}\\\\\n", "P_{t+1}^{2}\\\\\n", "\\theta_{t+1}\\\\\n", "v_{t+1}\n", "\\end{array}\\right]}_{x_{t+1}} & = & \\underbrace{\\left[\\begin{array}{cccccccc}\n", "0 & 0 & 0 & 0 & 0 & 0 & 0 & 0\\\\\n", "0 & 0 & 0 & 0 & 0 & 0 & 0 & 0\\\\\n", "\\frac{\\kappa}{\\lambda-\\rho} & \\frac{\\kappa}{\\lambda-\\rho} & \\tilde{\\lambda} & \\frac{-1}{\\lambda-\\rho}\\frac{\\kappa\\sigma_{e}^{2}}{p} & 0 & 0 & \\frac{\\rho}{\\lambda-\\rho} & 0\\\\\n", "-\\kappa & -\\kappa & 0 & \\frac{\\kappa\\sigma_{e}^{2}}{p} & 0 & 0 & 0 & 1\\\\\n", "\\frac{b\\kappa}{\\lambda-\\rho} & \\frac{b\\kappa}{\\lambda-\\rho} & b\\tilde{\\lambda} & \\frac{-b}{\\lambda-\\rho}\\frac{\\kappa\\sigma_{e}^{2}}{p} & 0 & 0 & \\frac{b\\rho}{\\lambda-\\rho}+\\rho & 1\\\\\n", "\\frac{b\\kappa}{\\lambda-\\rho} & \\frac{b\\kappa}{\\lambda-\\rho} & b\\tilde{\\lambda} & \\frac{-b}{\\lambda-\\rho}\\frac{\\kappa\\sigma_{e}^{2}}{p} & 0 & 0 & \\frac{b\\rho}{\\lambda-\\rho}+\\rho & 1\\\\\n", "0 & 0 & 0 & 0 & 0 & 0 & \\rho & 1\\\\\n", "0 & 0 & 0 & 0 & 0 & 0 & 0 & 0\n", "\\end{array}\\right]}_{A}\\underbrace{\\left[\\begin{array}{c}\n", "e_{1,t}\\\\\n", "e_{2,t}\\\\\n", "k_{t}^{i}\\\\\n", "\\tilde{\\theta}_{t}\\\\\n", "P_{t}^{1}\\\\\n", "P_{t}^{2}\\\\\n", "\\theta_{t}\\\\\n", "v_{t}\n", "\\end{array}\\right]}_{x_{t}}+\\underbrace{\\left[\\begin{array}{ccc}\n", "\\sigma_{e} & 0 & 0\\\\\n", "0 & \\sigma_{e} & 0\\\\\n", "0 & 0 & 0\\\\\n", "0 & 0 & 0\\\\\n", "\\sigma_{e} & 0 & 0\\\\\n", "0 & \\sigma_{e} & 0\\\\\n", "0 & 0 & 0\\\\\n", "0 & 0 & \\sigma_{v}\n", "\\end{array}\\right]}_{C}\\left[\\begin{array}{c}\n", "z_{1,t+1}\\\\\n", "z_{2,t+1}\\\\\n", "z_{3,t+1}\n", "\\end{array}\\right]\\\\\n", "\\underbrace{\\left[\\begin{array}{c}\n", "P_{t}^{1}\\\\\n", "P_{t}^{2}\\\\\n", "e_{1,t}+\\theta_{t}\\\\\n", "e_{2,t}+\\theta_{t}\\\\\n", "e_{1,t}\\\\\n", "e_{2,t}\n", "\\end{array}\\right]}_{y_{t}} & = & \\underbrace{\\left[\\begin{array}{cccccccc}\n", "0 & 0 & 0 & 0 & 1 & 0 & 0 & 0\\\\\n", "0 & 0 & 0 & 0 & 0 & 1 & 0 & 0\\\\\n", "1 & 0 & 0 & 0 & 0 & 0 & 1 & 0\\\\\n", "0 & 1 & 0 & 0 & 0 & 0 & 1 & 0\\\\\n", "1 & 0 & 0 & 0 & 0 & 0 & 0 & 0\\\\\n", "0 & 1 & 0 & 0 & 0 & 0 & 0 & 0\n", "\\end{array}\\right]}_{G}\\underbrace{\\left[\\begin{array}{c}\n", "e_{1,t}\\\\\n", "e_{2,t}\\\\\n", "k_{t}^{i}\\\\\n", "\\tilde{\\theta}_{t}\\\\\n", "P_{t}^{1}\\\\\n", "P_{t}^{2}\\\\\n", "\\theta_{t}\\\\\n", "v_{t}\n", "\\end{array}\\right]}_{x_{t}}+\\underbrace{\\left[\\begin{array}{c}\n", "0\\\\\n", "0\\\\\n", "0\\\\\n", "0\\\\\n", "0\\\\\n", "0\n", "\\end{array}\\right]}_{H}w_{t+1}\\\\\n", "\\left[\\begin{array}{c}\n", "z_{1,t+1}\\\\\n", "z_{2,t+1}\\\\\n", "z_{3,t+1}\\\\\n", "w_{t+1}\n", "\\end{array}\\right] & \\sim & \\mathcal{N}\\left(0,I\\right)\\\\\n", "\\kappa & = & \\frac{\\rho p}{2p+\\sigma_{e}^{2}}\n", "\\end{eqnarray*}\n", "$$" ] }, { "cell_type": "code", "execution_count": null, "metadata": { "hide-output": false }, "outputs": [], "source": [ "A_ricc = np.array([[ρ]])\n", "B_ricc = np.array([[np.sqrt(2)]])\n", "R_ricc = np.array([[σ_e ** 2]])\n", "Q_ricc = np.array([[σ_v ** 2]])\n", "N_ricc = np.zeros((1, 1))\n", "p = qe.solve_discrete_riccati(A_ricc, B_ricc, Q_ricc, R_ricc, N_ricc).item()\n", "\n", "p_two = p # Save for comparison later" ] }, { "cell_type": "code", "execution_count": null, "metadata": { "hide-output": false }, "outputs": [], "source": [ "# Verify that p = σ_v^2 + (pρ^2σ_e^2) / (2p + σ_e^2)\n", "tol = 1e-12\n", "np.abs(p - (σ_v ** 2 + p * ρ ** 2 * σ_e ** 2 / (2 * p + σ_e ** 2))) < tol" ] }, { "cell_type": "code", "execution_count": null, "metadata": { "hide-output": false }, "outputs": [], "source": [ "κ = ρ * p / (2 * p + σ_e ** 2)\n", "κ_prod = κ * σ_e ** 2 / p\n", "\n", "κ_two = κ # Save for comparison later\n", "\n", "A_lss = np.array([[0., 0., 0., 0., 0., 0., 0., 0.],\n", " [0., 0., 0., 0., 0., 0., 0., 0.],\n", " [κ / (λ - ρ), κ / (λ - ρ), λ_tilde, -κ_prod / (λ - ρ), 0., 0., ρ / (λ - ρ), 0.],\n", " [-κ, -κ, 0., κ_prod, 0., 0., 0., 1.],\n", " [b * κ / (λ - ρ), b * κ / (λ - ρ), b * λ_tilde, -b * κ_prod / (λ - ρ), 0., 0., b * ρ / (λ - ρ) + ρ, 1.],\n", " [b * κ / (λ - ρ), b * κ / (λ - ρ), b * λ_tilde, -b * κ_prod / (λ - ρ), 0., 0., b * ρ / (λ - ρ) + ρ, 1.],\n", " [0., 0., 0., 0., 0., 0., ρ, 1.],\n", " [0., 0., 0., 0., 0., 0., 0., 0.]])\n", "\n", "C_lss = np.array([[σ_e, 0., 0.],\n", " [0., σ_e, 0.],\n", " [0., 0., 0.],\n", " [0., 0., 0.],\n", " [σ_e, 0., 0.],\n", " [0., σ_e, 0.],\n", " [0., 0., 0.],\n", " [0., 0., σ_v]])\n", "\n", "G_lss = np.array([[0., 0., 0., 0., 1., 0., 0., 0.],\n", " [0., 0, 0, 0., 0., 1., 0., 0.],\n", " [1., 0., 0., 0., 0., 0., 1., 0.],\n", " [0., 1., 0., 0., 0., 0., 1., 0.],\n", " [1., 0., 0., 0., 0., 0., 0., 0.],\n", " [0., 1., 0., 0., 0., 0., 0., 0.]])" ] }, { "cell_type": "code", "execution_count": null, "metadata": { "hide-output": false }, "outputs": [], "source": [ "mu_0 = np.array([0., 0., 0., 0., 0., 0., 0., 0.])\n", "\n", "lss = qe.LinearStateSpace(A_lss, C_lss, G_lss, mu_0=mu_0)" ] }, { "cell_type": "code", "execution_count": null, "metadata": { "hide-output": false }, "outputs": [], "source": [ "ts_length = 100_000\n", "x, y = lss.simulate(ts_length, random_state=1)" ] }, { "cell_type": "code", "execution_count": null, "metadata": { "hide-output": false }, "outputs": [], "source": [ "xcoef, ycoef = lss.impulse_response(j=20)" ] }, { "cell_type": "code", "execution_count": null, "metadata": { "hide-output": false }, "outputs": [], "source": [ "data = np.array([xcoef])[0, :, 2, :]\n", "\n", "fig = go.Figure(data=go.Scatter(y=data[:-1, 0], name=r'$e_{1,t+1}$'))\n", "fig.add_trace(go.Scatter(y=data[:-1, 1], name=r'$e_{2,t+1}$'))\n", "fig.add_trace(go.Scatter(y=data[1:, 2], name=r'$v_{t+1}$'))\n", "fig.update_layout(title=r'Impulse Response Function',\n", " xaxis_title='Time',\n", " yaxis_title=r'$k^{i}_{t}$')\n", "fig2=fig\n", "# Export to PNG file\n", "Image(fig2.to_image(format=\"png\"))\n", "# fig2.show() will provide interactive plot when running\n", "# notebook locally" ] }, { "cell_type": "code", "execution_count": null, "metadata": { "hide-output": false }, "outputs": [], "source": [ "_, _, Σ_x, Σ_y, Σ_yx = lss.stationary_distributions()\n", "\n", "Σ_11 = Σ_x[1, 1]\n", "Σ_12 = Σ_x[1, 2:5]\n", "Σ_21 = Σ_x[2:5, 1]\n", "Σ_22 = Σ_x[2:5, 2:5]\n", "\n", "reg_coeffs = Σ_12 @ np.linalg.inv(Σ_22)\n", "\n", "print('Regression coefficients (e_{2,t} on k_t, P^{1}_t, \\\\tilde{\\\\theta_t})')\n", "print('------------------------------')\n", "print(r'k_t:', reg_coeffs[0])\n", "print(r'\\tilde{\\theta_t}:', reg_coeffs[1])\n", "print(r'P_t:', reg_coeffs[2])" ] }, { "cell_type": "code", "execution_count": null, "metadata": { "hide-output": false }, "outputs": [], "source": [ "# Compute R squared\n", "R_squared = reg_coeffs @ Σ_x[2:5, 2:5] @ reg_coeffs / Σ_x[1, 1]\n", "R_squared" ] }, { "cell_type": "code", "execution_count": null, "metadata": { "hide-output": false }, "outputs": [], "source": [ "# Verify that the computed coefficients are close to least squares estimates\n", "model = OLS(x[1], x[2:5].T)\n", "reg_res = model.fit()\n", "np.max(np.abs(reg_coeffs - reg_res.params)) < 1e-2" ] }, { "cell_type": "code", "execution_count": null, "metadata": { "hide-output": false }, "outputs": [], "source": [ "# Verify that R_squared matches least squares estimate\n", "np.abs(reg_res.rsquared - R_squared) < 1e-2" ] }, { "cell_type": "code", "execution_count": null, "metadata": { "hide-output": false }, "outputs": [], "source": [ "_, _, Σ_x, Σ_y, Σ_yx = lss.stationary_distributions()\n", "\n", "Σ_11 = Σ_x[1, 1]\n", "Σ_12 = Σ_x[1, 2:6]\n", "Σ_21 = Σ_x[2:6, 1]\n", "Σ_22 = Σ_x[2:6, 2:6]\n", "\n", "reg_coeffs = Σ_12 @ np.linalg.inv(Σ_22)\n", "\n", "print('Regression coefficients (e_{2,t} on k_t, P^{1}_t, P^{2}_t, \\\\tilde{\\\\theta_t})')\n", "print('------------------------------')\n", "print(r'k_t:', reg_coeffs[0])\n", "print(r'\\tilde{\\theta_t}:', reg_coeffs[1])\n", "print(r'P^{1}_t:', reg_coeffs[2])\n", "print(r'P^{2}_t:', reg_coeffs[3])" ] }, { "cell_type": "code", "execution_count": null, "metadata": { "hide-output": false }, "outputs": [], "source": [ "# Compute R squared\n", "R_squared = reg_coeffs @ Σ_x[2:6, 2:6] @ reg_coeffs / Σ_x[1, 1]\n", "R_squared" ] }, { "cell_type": "markdown", "metadata": {}, "source": [ "## Key step\n", "\n", "Now we come to the key step of verifying that equilibrium outcomes for prices and quantities are identical\n", "in the pooling equilibrium and Townsend’s original model.\n", "\n", "We accomplish this by compute a population linear least squares regression of the noisy signal that firms in the other\n", "industry receive in a pooling equilibrium on time $ t $ information that a firm receives in Townsend’s\n", "original model.\n", "\n", "Let’s compute the regression and stare at the $ R^2 $:" ] }, { "cell_type": "code", "execution_count": null, "metadata": { "hide-output": false }, "outputs": [], "source": [ "# Verify that θ_t + e^{2}_t can be recovered\n", "\n", "# θ_t + e^{2}_t on k^{i}_t, P^{1}_t, P^{2}_t, \\\\tilde{\\\\theta_t}\n", "\n", "\n", "model = OLS(y[1], x[2:6].T)\n", "reg_res = model.fit()\n", "np.abs(reg_res.rsquared - 1.) < 1e-6" ] }, { "cell_type": "code", "execution_count": null, "metadata": { "hide-output": false }, "outputs": [], "source": [ "reg_res.rsquared" ] }, { "cell_type": "markdown", "metadata": {}, "source": [ "The $ R^2 $ in this regression equals $ 1 $.\n", "\n", "That verifies that a firm’s information\n", "set in Townsend’s original model equals its information set in a pooling equilibrium.\n", "\n", "Therefore, equilibrium prices and quantities in Townsend’s original model equal those in a pooling equilibrium." ] }, { "cell_type": "markdown", "metadata": {}, "source": [ "## Comparison of the two signal structures\n", "\n", "It is enlightening side by side to plot impulse response functions for capital in an industry for the two\n", "information noisy-signal information structures.\n", "\n", "Please remember that the two-signal structure corresponds to the **pooling equilibrium** and also\n", "**Townsend’s original model**." ] }, { "cell_type": "code", "execution_count": null, "metadata": { "hide-output": false }, "outputs": [], "source": [ "fig_comb = go.Figure(data=[*fig1.data,\n", " *fig2.update_traces(xaxis='x2', yaxis='y2').data]).set_subplots(1, 2,\n", " subplot_titles=(\"One noisy-signal structure\", \"Two noisy-signal structure\"),\n", " horizontal_spacing=0.1,\n", " shared_yaxes=True)\n", "# Export to PNG file\n", "Image(fig_comb.to_image(format=\"png\"))\n", "# fig_comb.show() will provide interactive plot when running\n", "# notebook locally" ] }, { "cell_type": "markdown", "metadata": {}, "source": [ "The graphs above show that\n", "\n", "- the response of $ k_t^i $ to shocks $ v_t $ to the hidden Markov demand state $ \\theta_t $ process is **larger** in\n", " the two-noisy=signal structure \n", "- the response of $ k_t^i $ to idiosyncratic *own-market* noise-shocks $ e_t $ is **smaller** in the two-noisy-signal structure \n", "\n", "\n", "Taken together, these findings in turn can be shown to imply that time series correlations and coherences between outputs in\n", "the two industries are higher in the two-noisy-signals or **pooling** model.\n", "\n", "The enhanced influence of the shocks $ v_t $ to the hidden Markov demand state $ \\theta_t $ process that\n", "emerges from the two-noisy-signal model relative to the one-noisy-signal model is a symptom of a lower\n", "equilibrium hidden-state reconstruction error variance in the two-signal model:" ] }, { "cell_type": "code", "execution_count": null, "metadata": { "hide-output": false }, "outputs": [], "source": [ "display(Latex('$\\\\textbf{Reconstruction error variances}$'))\n", "display(Latex(f'One-noise structure: ${round(p_one, 6)}$'))\n", "display(Latex(f'Two-noise structure: ${round(p_two, 6)}$'))" ] }, { "cell_type": "markdown", "metadata": {}, "source": [ "Kalman gains for the two\n", "structures are" ] }, { "cell_type": "code", "execution_count": null, "metadata": { "hide-output": false }, "outputs": [], "source": [ "display(Latex('$\\\\textbf{Kalman Gains}$'))\n", "display(Latex(f'One noisy-signal structure: ${round(κ_one, 6)}$'))\n", "display(Latex(f'Two noisy-signals structure: ${round(κ_two, 6)}$'))" ] }, { "cell_type": "markdown", "metadata": {}, "source": [ "## Notes on History of the Problem\n", "\n", "To truncate what he saw as an intractable, infinite dimensional state space,\n", "Townsend constructed an approximating model in which the common hidden Markov demand shock\n", "is revealed to all firms after a fixed number of periods.\n", "\n", "Thus,\n", "\n", "> - Townsend wanted to assume that at time $ t $ firms in industry $ i $ observe\n", " $ k_t^i, Y_t^i, P_t^i, (P^{-i})^t $, where $ (P^{-i})^t $ is the history of prices in\n", " the other market up to time $ t $. \n", "- Because that turned out to be too challenging, Townsend made an\n", " alternative assumption that eased his calculations: that after a large\n", " number $ S $ of periods, firms in industry $ i $ observe the\n", " hidden Markov component of the demand shock $ \\theta_{t-S} $. \n", "\n", "\n", "\n", "Townsend argued that the more manageable model could do a good job of\n", "approximating the intractable model in which the Markov component of the demand shock remains unobserved\n", "for ever.\n", "\n", "By applying technical machinery of [[PCL86]](https://python-programming.quantecon.org/zreferences.html#pcl),\n", "[[PS05]](https://python-programming.quantecon.org/zreferences.html#pearlman-sargent2005) showed that there is a recursive\n", "representation of the equilibrium of the perpetually and symmetrically\n", "uninformed model formulated but not completely solved in section 8 of\n", "[[Tow83]](https://python-programming.quantecon.org/zreferences.html#townsend).\n", "\n", "A reader of [[PS05]](https://python-programming.quantecon.org/zreferences.html#pearlman-sargent2005) will notice that their representation of the equilibrium of\n", "Townsend’s model exactly matches that of the **pooling equilibrium** presented here.\n", "\n", "We have structured our notation in this lecture to faciliate comparison of the **pooling equilibrium**\n", "constructed here with the equilibrium of Townsend’s model reported in [[PS05]](https://python-programming.quantecon.org/zreferences.html#pearlman-sargent2005).\n", "\n", "The computational method of [[PS05]](https://python-programming.quantecon.org/zreferences.html#pearlman-sargent2005) is recursive:\n", "it enlists the Kalman filter and invariant subspace methods for\n", "solving systems of Euler\n", "equations [2] .\n", "\n", "As [[Sin87]](https://python-programming.quantecon.org/zreferences.html#singleton),\n", "[[Kas00]](https://python-programming.quantecon.org/zreferences.html#kasa), and [[Sar91]](https://python-programming.quantecon.org/zreferences.html#sargent91) also\n", "found, the equilibrium is fully revealing: observed prices tell\n", "participants in industry $ i $ all of the information held by\n", "participants in market $ -i $ ($ -i $ means not $ i $).\n", "\n", "This\n", "means that higher-order beliefs play no role: seeing equilibrium prices\n", "in effect lets decision makers pool their information\n", "sets [3] .\n", "\n", "The disappearance of higher order beliefs means that\n", "decision makers in this model do not really face a problem of\n", "forecasting the forecasts of others.\n", "\n", "They know those forecasts because\n", "they are the same as their own." ] }, { "cell_type": "markdown", "metadata": {}, "source": [ "### Further historical remarks\n", "\n", "[[Sar91]](https://python-programming.quantecon.org/zreferences.html#sargent91) proposed a way to compute an equilibrium\n", "without making Townsend’s approximation.\n", "\n", "Extending the reasoning of [muth1960], Sargent noticed that it is possible to\n", "summarize the relevant history with a low dimensional object, namely, a\n", "small number of current and lagged forecasting errors.\n", "\n", "Positing an\n", "equilibrium in a space of perceived laws of motion for endogenous\n", "variables that takes the form of a vector autoregressive, moving\n", "average, Sargent described an equilibrium as a fixed point of a mapping\n", "from the perceived law of motion to the actual law of motion of that\n", "form.\n", "\n", "Sargent worked in the time domain and had to guess and verify the\n", "appropriate orders of the autoregressive and moving average pieces of\n", "the equilibrium representation.\n", "\n", "By working in the frequency\n", "domain [[Kas00]](https://python-programming.quantecon.org/zreferences.html#kasa) showed how to discover the appropriate\n", "orders of the autoregressive and moving average parts, and also how to\n", "compute an equilibrium.\n", "\n", "The [[PS05]](https://python-programming.quantecon.org/zreferences.html#pearlman-sargent2005) recursive computational method, which stays in the time domain, also\n", "discovered appropriate orders of the autoregressive and moving\n", "average pieces.\n", "\n", "In addition, by displaying equilibrium representations\n", "in the form of [[PCL86]](https://python-programming.quantecon.org/zreferences.html#pcl), [[PS05]](https://python-programming.quantecon.org/zreferences.html#pearlman-sargent2005)\n", "showed how the moving average piece is linked to the innovation process\n", "of the hidden persistent component of the demand shock.\n", "\n", "That scalar\n", "innovation process is the additional state variable contributed by the\n", "problem of extracting a signal from equilibrium prices that decision\n", "makers face in Townsend’s model." ] }, { "cell_type": "markdown", "metadata": {}, "source": [ "**Footnotes**\n", "\n", "

[1] [[PS05]](https://python-programming.quantecon.org/zreferences.html#pearlman-sargent2005) verified this assertion using a different tactic, namely, by constructing\n", "analytic formulas an equilibrium under the incomplete\n", "information structure and confirming that they match the pooling equilibrium formulas derived here.\n", "\n", "

[2] See [[AHMS96]](https://python-programming.quantecon.org/zreferences.html#ahms) for an account of invariant subspace methods.\n", "\n", "

[3] See [[AHMS96]](https://python-programming.quantecon.org/zreferences.html#ahms) for a discussion\n", "of the information assumptions needed to create a situation\n", "in which higher order beliefs appear in equilibrium decision rules. The way\n", "to read our findings in light of [[AMS02]](https://python-programming.quantecon.org/zreferences.html#ams) is that Townsend’s\n", "section 8 model has too few sources of random shocks relative\n", "to sources of signals to permit higher order beliefs to\n", "play a role.\n", "\n", "

[4] See [[Sar87]](https://python-programming.quantecon.org/zreferences.html#sargent1987), especially\n", "chapters IX and XIV, for the principles that guide solving some roots backwards and others forwards.\n", "\n", "

[5] As noted [[Sar87]](https://python-programming.quantecon.org/zreferences.html#sargent1987), this difference equation is the Euler equation for\n", "the planning problem of maximizing the discounted sum of consumer plus\n", "producer surplus.\n", "\n", "

[6] [[PS05]](https://python-programming.quantecon.org/zreferences.html#pearlman-sargent2005) verify the same claim by applying machinery of [[PCL86]](https://python-programming.quantecon.org/zreferences.html#pcl)." ] } ], "metadata": { "date": 1624431174.2590406, "filename": "knowing_forecasts_of_others.rst", "kernelspec": { "display_name": "Python", "language": "python3", "name": "python3" }, "next_doc": { "link": "index_asset_pricing", "title": "Asset Pricing and Finance" }, "prev_doc": { "link": "classical_filtering", "title": "Classical Prediction and Filtering With Linear Algebra" }, "title": "Knowing the Forecasts of Others" }, "nbformat": 4, "nbformat_minor": 2 }