From af8a3626e1c1178ef70f553af326d8469a68a0bf Mon Sep 17 00:00:00 2001 From: quantecon-services Date: Tue, 30 May 2023 23:49:41 +0000 Subject: [PATCH] auto publishing updates to notebooks --- BCG_complete_mkts.ipynb | 78 ++++----- BCG_incomplete_mkts.ipynb | 104 ++++++------ additive_functionals.ipynb | 86 +++++----- amss.ipynb | 96 ++++++------ amss2.ipynb | 106 ++++++------- amss3.ipynb | 128 +++++++-------- arellano.ipynb | 88 +++++------ arma.ipynb | 98 ++++++------ asset_pricing_lph.ipynb | 108 ++++++------- black_litterman.ipynb | 62 ++++---- calvo.ipynb | 116 +++++++------- cattle_cycles.ipynb | 54 +++---- chang_credible.ipynb | 58 +++---- chang_ramsey.ipynb | 76 ++++----- classical_filtering.ipynb | 70 ++++----- coase.ipynb | 82 +++++----- cons_news.ipynb | 78 ++++----- discrete_dp.ipynb | 206 ++++++++++++------------ dyn_stack.ipynb | 252 ++++++++++++++++++------------ entropy.ipynb | 38 ++--- estspec.ipynb | 54 +++---- five_preferences.ipynb | 142 ++++++++--------- growth_in_dles.ipynb | 100 ++++++------ hs_invertibility_example.ipynb | 38 ++--- hs_recursive_models.ipynb | 104 ++++++------ intro.ipynb | 24 +-- irfs_in_hall_model.ipynb | 54 +++---- knowing_forecasts_of_others.ipynb | 146 ++++++++--------- lqramsey.ipynb | 78 ++++----- lu_tricks.ipynb | 60 +++---- lucas_asset_pricing_dles.ipynb | 58 +++---- lucas_model.ipynb | 66 ++++---- markov_jump_lq.ipynb | 122 +++++++-------- matsuyama.ipynb | 54 +++---- muth_kalman.ipynb | 54 +++---- opt_tax_recur.ipynb | 100 ++++++------ orth_proj.ipynb | 90 +++++------ permanent_income_dles.ipynb | 30 ++-- rob_markov_perf.ipynb | 76 ++++----- robustness.ipynb | 64 ++++---- rosen_schooling_model.ipynb | 46 +++--- smoothing.ipynb | 58 +++---- smoothing_tax.ipynb | 94 +++++------ stationary_densities.ipynb | 86 +++++----- status.ipynb | 106 ++++++------- tax_smoothing_1.ipynb | 56 +++---- tax_smoothing_2.ipynb | 48 +++--- tax_smoothing_3.ipynb | 34 ++-- troubleshooting.ipynb | 14 +- un_insure.ipynb | 78 ++++----- zreferences.ipynb | 6 +- 51 files changed, 2084 insertions(+), 2040 deletions(-) diff --git a/BCG_complete_mkts.ipynb b/BCG_complete_mkts.ipynb index 13a2cde..01108c2 100644 --- a/BCG_complete_mkts.ipynb +++ b/BCG_complete_mkts.ipynb @@ -2,7 +2,7 @@ "cells": [ { "cell_type": "markdown", - "id": "c8f45e6c", + "id": "96e9cc56", "metadata": {}, "source": [ "\n", @@ -11,7 +11,7 @@ }, { "cell_type": "markdown", - "id": "1083a206", + "id": "6d7f531e", "metadata": {}, "source": [ "# Irrelevance of Capital Structures with Complete Markets" @@ -19,7 +19,7 @@ }, { "cell_type": "markdown", - "id": "65a38935", + "id": "43176217", "metadata": {}, "source": [ "## Contents\n", @@ -32,7 +32,7 @@ }, { "cell_type": "markdown", - "id": "086c6212", + "id": "a5c5f040", "metadata": {}, "source": [ "In addition to what’s in Anaconda, this lecture will need the following libraries:" @@ -41,7 +41,7 @@ { "cell_type": "code", "execution_count": null, - "id": "42c30913", + "id": "755b4403", "metadata": { "hide-output": false }, @@ -54,7 +54,7 @@ }, { "cell_type": "markdown", - "id": "4032602f", + "id": "52e80252", "metadata": {}, "source": [ "## Introduction\n", @@ -87,7 +87,7 @@ }, { "cell_type": "markdown", - "id": "162a9778", + "id": "e5addf3f", "metadata": {}, "source": [ "### Setup\n", @@ -120,7 +120,7 @@ }, { "cell_type": "markdown", - "id": "2bf3f17f", + "id": "23bddf02", "metadata": {}, "source": [ "### Endowments\n", @@ -145,7 +145,7 @@ }, { "cell_type": "markdown", - "id": "3fd7714d", + "id": "12d913ed", "metadata": {}, "source": [ "### Technology:\n", @@ -162,7 +162,7 @@ }, { "cell_type": "markdown", - "id": "09471949", + "id": "a6e54082", "metadata": {}, "source": [ "### Preferences:\n", @@ -187,7 +187,7 @@ }, { "cell_type": "markdown", - "id": "371c9fa0", + "id": "01c4a1d8", "metadata": {}, "source": [ "### Parameterizations\n", @@ -210,7 +210,7 @@ }, { "cell_type": "markdown", - "id": "06d226fa", + "id": "fcc1958b", "metadata": {}, "source": [ "### Pareto criterion and planning problem\n", @@ -268,7 +268,7 @@ }, { "cell_type": "markdown", - "id": "2a36b95e", + "id": "1d80f034", "metadata": {}, "source": [ "### Helpful observations and bookkeeping\n", @@ -349,7 +349,7 @@ }, { "cell_type": "markdown", - "id": "92a74505", + "id": "3d050ce8", "metadata": {}, "source": [ "#### Remarks\n", @@ -368,7 +368,7 @@ }, { "cell_type": "markdown", - "id": "b7ecc904", + "id": "4e73b4ef", "metadata": {}, "source": [ "## Competitive equilibrium\n", @@ -387,7 +387,7 @@ }, { "cell_type": "markdown", - "id": "7647dd50", + "id": "1ffc774a", "metadata": {}, "source": [ "### Measures of agents and firms\n", @@ -439,7 +439,7 @@ }, { "cell_type": "markdown", - "id": "8569ee0d", + "id": "65f9cd11", "metadata": {}, "source": [ "#### Ownership\n", @@ -479,7 +479,7 @@ }, { "cell_type": "markdown", - "id": "7a297e57", + "id": "d7ff1d8c", "metadata": {}, "source": [ "#### Asset markets\n", @@ -498,7 +498,7 @@ }, { "cell_type": "markdown", - "id": "f59d1012", + "id": "11fd5dda", "metadata": {}, "source": [ "### Objects appearing in a competitive equilibrium\n", @@ -527,7 +527,7 @@ }, { "cell_type": "markdown", - "id": "7a55e935", + "id": "5401a369", "metadata": {}, "source": [ "### A representative firm’s problem\n", @@ -574,7 +574,7 @@ }, { "cell_type": "markdown", - "id": "d078980f", + "id": "94e74df6", "metadata": {}, "source": [ "### A consumer’s problem\n", @@ -747,7 +747,7 @@ }, { "cell_type": "markdown", - "id": "0571b20d", + "id": "d7745e87", "metadata": {}, "source": [ "### Computing competitive equilibrium prices and quantities\n", @@ -842,7 +842,7 @@ }, { "cell_type": "markdown", - "id": "d5d8b029", + "id": "bda6a46f", "metadata": {}, "source": [ "### Modigliani-Miller theorem\n", @@ -924,7 +924,7 @@ }, { "cell_type": "markdown", - "id": "1050e6b7", + "id": "b757a100", "metadata": {}, "source": [ "## Code\n", @@ -998,7 +998,7 @@ { "cell_type": "code", "execution_count": null, - "id": "2513d112", + "id": "b992013b", "metadata": { "hide-output": false }, @@ -1016,7 +1016,7 @@ { "cell_type": "code", "execution_count": null, - "id": "4deeda7c", + "id": "9752af83", "metadata": { "hide-output": false }, @@ -1211,7 +1211,7 @@ }, { "cell_type": "markdown", - "id": "dee2e65d", + "id": "a5965762", "metadata": {}, "source": [ "### Examples\n", @@ -1221,7 +1221,7 @@ }, { "cell_type": "markdown", - "id": "692f41a3", + "id": "0bd8691c", "metadata": {}, "source": [ "#### 1st example\n", @@ -1240,7 +1240,7 @@ { "cell_type": "code", "execution_count": null, - "id": "8b3a055f", + "id": "4c0f152b", "metadata": { "hide-output": false }, @@ -1253,7 +1253,7 @@ }, { "cell_type": "markdown", - "id": "3272a03c", + "id": "4aff44e1", "metadata": {}, "source": [ "Let’s plot the agents’ time-1 endowments with respect to shocks to see\n", @@ -1263,7 +1263,7 @@ { "cell_type": "code", "execution_count": null, - "id": "a5668c83", + "id": "8876d17a", "metadata": { "hide-output": false }, @@ -1300,7 +1300,7 @@ }, { "cell_type": "markdown", - "id": "52e482c1", + "id": "aae8b648", "metadata": {}, "source": [ "Let’s also compare the optimal capital stock, $ k $, and optimal\n", @@ -1310,7 +1310,7 @@ { "cell_type": "code", "execution_count": null, - "id": "df0b62e5", + "id": "78413cc2", "metadata": { "hide-output": false }, @@ -1333,7 +1333,7 @@ }, { "cell_type": "markdown", - "id": "5bebe1fb", + "id": "5aeb5dfd", "metadata": {}, "source": [ "#### 2nd example\n", @@ -1348,7 +1348,7 @@ { "cell_type": "code", "execution_count": null, - "id": "6b654fa7", + "id": "3b12e2f8", "metadata": { "hide-output": false }, @@ -1380,7 +1380,7 @@ { "cell_type": "code", "execution_count": null, - "id": "4da55ccc", + "id": "b17f6cdf", "metadata": { "hide-output": false }, @@ -1393,7 +1393,7 @@ { "cell_type": "code", "execution_count": null, - "id": "13a3e561", + "id": "3d0550d2", "metadata": { "hide-output": false }, @@ -1407,7 +1407,7 @@ { "cell_type": "code", "execution_count": null, - "id": "5b4bc1a4", + "id": "d0c118ef", "metadata": { "hide-output": false }, @@ -1438,7 +1438,7 @@ } ], "metadata": { - "date": 1680677523.0149946, + "date": 1685490450.0954695, "filename": "BCG_complete_mkts.md", "kernelspec": { "display_name": "Python", diff --git a/BCG_incomplete_mkts.ipynb b/BCG_incomplete_mkts.ipynb index 1f3464a..904cd2a 100644 --- a/BCG_incomplete_mkts.ipynb +++ b/BCG_incomplete_mkts.ipynb @@ -2,7 +2,7 @@ "cells": [ { "cell_type": "markdown", - "id": "6cbf990a", + "id": "c7b29cca", "metadata": {}, "source": [ "\n", @@ -11,7 +11,7 @@ }, { "cell_type": "markdown", - "id": "30b7128c", + "id": "4bc31f30", "metadata": {}, "source": [ "# Equilibrium Capital Structures with Incomplete Markets" @@ -19,7 +19,7 @@ }, { "cell_type": "markdown", - "id": "68cbb00c", + "id": "6976cdc4", "metadata": {}, "source": [ "## Contents\n", @@ -36,7 +36,7 @@ }, { "cell_type": "markdown", - "id": "564a07a6", + "id": "9dfefadd", "metadata": {}, "source": [ "In addition to what’s in Anaconda, this lecture will need the following libraries:" @@ -45,7 +45,7 @@ { "cell_type": "code", "execution_count": null, - "id": "66417401", + "id": "5b34e5b6", "metadata": { "hide-output": false }, @@ -58,7 +58,7 @@ }, { "cell_type": "markdown", - "id": "64a6627b", + "id": "248de70e", "metadata": {}, "source": [ "## Introduction\n", @@ -109,7 +109,7 @@ }, { "cell_type": "markdown", - "id": "57b94157", + "id": "a307283f", "metadata": {}, "source": [ "### Setup\n", @@ -133,7 +133,7 @@ }, { "cell_type": "markdown", - "id": "3edca186", + "id": "46b48e6c", "metadata": {}, "source": [ "### Ownership\n", @@ -148,7 +148,7 @@ }, { "cell_type": "markdown", - "id": "eb99fc80", + "id": "24dbcf88", "metadata": {}, "source": [ "### Measures of agents and firms\n", @@ -225,7 +225,7 @@ }, { "cell_type": "markdown", - "id": "e3ac6dca", + "id": "69e4f455", "metadata": {}, "source": [ "### Endowments\n", @@ -242,7 +242,7 @@ }, { "cell_type": "markdown", - "id": "45593c21", + "id": "2934638a", "metadata": {}, "source": [ "### Feasibility:\n", @@ -261,7 +261,7 @@ }, { "cell_type": "markdown", - "id": "50a568fb", + "id": "6ba859a3", "metadata": {}, "source": [ "### Parameterizations\n", @@ -284,7 +284,7 @@ }, { "cell_type": "markdown", - "id": "04cc77ea", + "id": "a97ca9fe", "metadata": {}, "source": [ "### Preferences:\n", @@ -309,7 +309,7 @@ }, { "cell_type": "markdown", - "id": "43b08fcd", + "id": "de52fe58", "metadata": {}, "source": [ "### Risk-sharing motives\n", @@ -329,7 +329,7 @@ }, { "cell_type": "markdown", - "id": "f8d10c43", + "id": "de82f252", "metadata": {}, "source": [ "## Asset Markets\n", @@ -385,7 +385,7 @@ }, { "cell_type": "markdown", - "id": "61510a56", + "id": "442455a2", "metadata": {}, "source": [ "### Consumers\n", @@ -476,7 +476,7 @@ }, { "cell_type": "markdown", - "id": "22029450", + "id": "4ecdfdae", "metadata": {}, "source": [ "### Pricing functions\n", @@ -515,7 +515,7 @@ }, { "cell_type": "markdown", - "id": "5451e262", + "id": "e516fbd6", "metadata": {}, "source": [ "### Firms\n", @@ -572,7 +572,7 @@ }, { "cell_type": "markdown", - "id": "c3dd91cf", + "id": "cc653188", "metadata": {}, "source": [ "#### Firm’s optimization problem\n", @@ -645,7 +645,7 @@ }, { "cell_type": "markdown", - "id": "7431acec", + "id": "4f9f0ae6", "metadata": {}, "source": [ "## Equilibrium verification\n", @@ -672,7 +672,7 @@ }, { "cell_type": "markdown", - "id": "406ffaf5", + "id": "1779f5f1", "metadata": {}, "source": [ "## Pseudo Code\n", @@ -770,7 +770,7 @@ }, { "cell_type": "markdown", - "id": "2dbfe3f1", + "id": "a93d401b", "metadata": {}, "source": [ "## Code\n", @@ -817,7 +817,7 @@ { "cell_type": "code", "execution_count": null, - "id": "532b1330", + "id": "7c8ff17c", "metadata": { "hide-output": false }, @@ -836,7 +836,7 @@ { "cell_type": "code", "execution_count": null, - "id": "b6492f1f", + "id": "1b00f97a", "metadata": { "hide-output": false }, @@ -1329,7 +1329,7 @@ }, { "cell_type": "markdown", - "id": "2a426622", + "id": "ebbed204", "metadata": {}, "source": [ "## Examples\n", @@ -1339,7 +1339,7 @@ }, { "cell_type": "markdown", - "id": "97dfc9e2", + "id": "9de713f2", "metadata": {}, "source": [ "### First example\n", @@ -1351,7 +1351,7 @@ { "cell_type": "code", "execution_count": null, - "id": "db54c073", + "id": "b13fb60f", "metadata": { "hide-output": false }, @@ -1364,7 +1364,7 @@ { "cell_type": "code", "execution_count": null, - "id": "b81e84a0", + "id": "c24d2afe", "metadata": { "hide-output": false }, @@ -1377,7 +1377,7 @@ }, { "cell_type": "markdown", - "id": "0f9215f4", + "id": "2b8bd3a7", "metadata": {}, "source": [ "Python reports to us that the equilibrium firm value is $ V=0.101 $,\n", @@ -1394,7 +1394,7 @@ { "cell_type": "code", "execution_count": null, - "id": "fcaf1a49", + "id": "02a1e25a", "metadata": { "hide-output": false }, @@ -1408,7 +1408,7 @@ }, { "cell_type": "markdown", - "id": "697df849", + "id": "5532bc6b", "metadata": {}, "source": [ "Up to the approximation involved in using a discrete grid, these numbers\n", @@ -1425,7 +1425,7 @@ { "cell_type": "code", "execution_count": null, - "id": "431d4a04", + "id": "79246efc", "metadata": { "hide-output": false }, @@ -1466,7 +1466,7 @@ }, { "cell_type": "markdown", - "id": "36cae3a8", + "id": "f703a8ff", "metadata": {}, "source": [ "#### A Modigliani-Miller theorem?\n", @@ -1561,7 +1561,7 @@ { "cell_type": "code", "execution_count": null, - "id": "b79cb454", + "id": "0dfc7d36", "metadata": { "hide-output": false }, @@ -1785,7 +1785,7 @@ }, { "cell_type": "markdown", - "id": "69d174b1", + "id": "1649c9ca", "metadata": {}, "source": [ "Here is our strategy for checking *stability* of an equilibrium.\n", @@ -1811,7 +1811,7 @@ { "cell_type": "code", "execution_count": null, - "id": "d2ba3182", + "id": "9ddde123", "metadata": { "hide-output": false }, @@ -1859,7 +1859,7 @@ }, { "cell_type": "markdown", - "id": "edfb338c", + "id": "5623e018", "metadata": {}, "source": [ "In the above 3D surface of prospective firm valuations, the perturbed\n", @@ -1877,7 +1877,7 @@ { "cell_type": "code", "execution_count": null, - "id": "e58cf65f", + "id": "1ee06248", "metadata": { "hide-output": false }, @@ -1924,7 +1924,7 @@ }, { "cell_type": "markdown", - "id": "418ba551", + "id": "773eb9b8", "metadata": {}, "source": [ "In contrast to $ (k^*,b^* - e) $, the 3D surface for\n", @@ -1944,7 +1944,7 @@ { "cell_type": "code", "execution_count": null, - "id": "76c9ffce", + "id": "a27d5165", "metadata": { "hide-output": false }, @@ -1955,7 +1955,7 @@ }, { "cell_type": "markdown", - "id": "db0d518b", + "id": "6d4cbf46", "metadata": {}, "source": [ "Our two *stability experiments* suggest that the equilibrium capital\n", @@ -1969,7 +1969,7 @@ }, { "cell_type": "markdown", - "id": "23699433", + "id": "e3a87712", "metadata": {}, "source": [ "#### Equilibrium equity and bond price functions\n", @@ -1982,7 +1982,7 @@ { "cell_type": "code", "execution_count": null, - "id": "57c581c7", + "id": "3b9e332a", "metadata": { "hide-output": false }, @@ -2020,7 +2020,7 @@ { "cell_type": "code", "execution_count": null, - "id": "91c99424", + "id": "78146637", "metadata": { "hide-output": false }, @@ -2057,7 +2057,7 @@ }, { "cell_type": "markdown", - "id": "6386139e", + "id": "540ff0fe", "metadata": {}, "source": [ "### Comments on equilibrium pricing functions\n", @@ -2073,7 +2073,7 @@ }, { "cell_type": "markdown", - "id": "da972492", + "id": "9019e726", "metadata": {}, "source": [ "### Another example economy\n", @@ -2099,7 +2099,7 @@ { "cell_type": "code", "execution_count": null, - "id": "c9673884", + "id": "03b9a905", "metadata": { "hide-output": false }, @@ -2154,7 +2154,7 @@ { "cell_type": "code", "execution_count": null, - "id": "df8046cb", + "id": "75e89b35", "metadata": { "hide-output": false }, @@ -2193,7 +2193,7 @@ }, { "cell_type": "markdown", - "id": "de9cf3c5", + "id": "fbcdd130", "metadata": {}, "source": [ "## A picture worth a thousand words\n", @@ -2213,7 +2213,7 @@ { "cell_type": "code", "execution_count": null, - "id": "251bde7a", + "id": "2bfeb3b6", "metadata": { "hide-output": false }, @@ -2245,7 +2245,7 @@ }, { "cell_type": "markdown", - "id": "c0366383", + "id": "83646a14", "metadata": {}, "source": [ "It is rewarding to stare at the above plots too.\n", @@ -2261,7 +2261,7 @@ } ], "metadata": { - "date": 1680677523.1082954, + "date": 1685490450.1857154, "filename": "BCG_incomplete_mkts.md", "kernelspec": { "display_name": "Python", diff --git a/additive_functionals.ipynb b/additive_functionals.ipynb index c448a42..0f11653 100644 --- a/additive_functionals.ipynb +++ b/additive_functionals.ipynb @@ -2,7 +2,7 @@ "cells": [ { "cell_type": "markdown", - "id": "d0d5f37d", + "id": "b77d1432", "metadata": {}, "source": [ "\n", @@ -11,7 +11,7 @@ }, { "cell_type": "markdown", - "id": "97d368d9", + "id": "da982747", "metadata": {}, "source": [ "# Additive and Multiplicative Functionals\n", @@ -22,7 +22,7 @@ }, { "cell_type": "markdown", - "id": "ffd3ad8a", + "id": "47f55475", "metadata": {}, "source": [ "## Contents\n", @@ -37,7 +37,7 @@ }, { "cell_type": "markdown", - "id": "f3accf71", + "id": "0e695a83", "metadata": {}, "source": [ "In addition to what’s in Anaconda, this lecture will need the following libraries:" @@ -46,7 +46,7 @@ { "cell_type": "code", "execution_count": null, - "id": "1a16f571", + "id": "890e8e35", "metadata": { "hide-output": false }, @@ -57,7 +57,7 @@ }, { "cell_type": "markdown", - "id": "068390e3", + "id": "78561324", "metadata": {}, "source": [ "## Overview\n", @@ -68,11 +68,9 @@ "\n", "Asymptotic stationarity and ergodicity are key assumptions needed to make it possible to learn by applying statistical methods.\n", "\n", - "Are there ways to model time series that have persistent growth that still enable statistical learning based on a law of large numbers for an asymptotically stationary and ergodic process?\n", + "But there are good ways to model time series that have persistent growth that still enable statistical learning based on a law of large numbers for an asymptotically stationary and ergodic process.\n", "\n", - "The answer provided by Hansen [[Han12](https://python-advanced.quantecon.org/zreferences.html#id240)] is yes.\n", - "\n", - "He described two classes of time series models that accommodate growth.\n", + "Thus, [[Han12](https://python-advanced.quantecon.org/zreferences.html#id240)] described two classes of time series models that accommodate growth.\n", "\n", "They are\n", "\n", @@ -104,7 +102,7 @@ { "cell_type": "code", "execution_count": null, - "id": "f227aa5c", + "id": "41544fd5", "metadata": { "hide-output": false }, @@ -121,7 +119,7 @@ }, { "cell_type": "markdown", - "id": "af1e2879", + "id": "7be39c0f", "metadata": {}, "source": [ "## A Particular Additive Functional\n", @@ -175,7 +173,7 @@ }, { "cell_type": "markdown", - "id": "82d56821", + "id": "338b4793", "metadata": {}, "source": [ "### Linear State-Space Representation\n", @@ -246,7 +244,7 @@ }, { "cell_type": "markdown", - "id": "8756b2cd", + "id": "e57b02bc", "metadata": {}, "source": [ "## Dynamics\n", @@ -295,7 +293,7 @@ }, { "cell_type": "markdown", - "id": "e4ed5427", + "id": "b8ff0152", "metadata": {}, "source": [ "### Simulation\n", @@ -313,7 +311,7 @@ { "cell_type": "code", "execution_count": null, - "id": "c23bcf59", + "id": "97896573", "metadata": { "hide-output": false }, @@ -473,7 +471,7 @@ }, { "cell_type": "markdown", - "id": "74f4d9ce", + "id": "8d2274e9", "metadata": {}, "source": [ "#### Plotting\n", @@ -484,7 +482,7 @@ { "cell_type": "code", "execution_count": null, - "id": "e38e3f7e", + "id": "c1fcfc04", "metadata": { "hide-output": false }, @@ -767,7 +765,7 @@ }, { "cell_type": "markdown", - "id": "25d3a22c", + "id": "96012a1b", "metadata": {}, "source": [ "For now, we just plot $ y_t $ and $ x_t $, postponing until later a description of exactly how we compute them.\n", @@ -779,7 +777,7 @@ { "cell_type": "code", "execution_count": null, - "id": "eeb2f069", + "id": "2890320e", "metadata": { "hide-output": false }, @@ -818,7 +816,7 @@ }, { "cell_type": "markdown", - "id": "0c60d5bc", + "id": "2575a2fa", "metadata": {}, "source": [ "Notice the irregular but persistent growth in $ y_t $." @@ -826,7 +824,7 @@ }, { "cell_type": "markdown", - "id": "cb8941d3", + "id": "0ffb5e1d", "metadata": {}, "source": [ "### Decomposition\n", @@ -962,7 +960,7 @@ }, { "cell_type": "markdown", - "id": "62bf1381", + "id": "86f2ca73", "metadata": {}, "source": [ "## Code\n", @@ -985,7 +983,7 @@ { "cell_type": "code", "execution_count": null, - "id": "40a40473", + "id": "96b9a271", "metadata": { "hide-output": false }, @@ -997,7 +995,7 @@ }, { "cell_type": "markdown", - "id": "2e8c0f35", + "id": "11838bf3", "metadata": {}, "source": [ "When we plot multiple realizations of a component in the 2nd, 3rd, and 4th panels, we also plot the population 95% probability coverage sets computed using the LinearStateSpace class.\n", @@ -1014,7 +1012,7 @@ }, { "cell_type": "markdown", - "id": "4bfb9a5b", + "id": "e1903510", "metadata": {}, "source": [ "### Associated Multiplicative Functional\n", @@ -1061,7 +1059,7 @@ { "cell_type": "code", "execution_count": null, - "id": "f94b92df", + "id": "a6fe0784", "metadata": { "hide-output": false }, @@ -1073,7 +1071,7 @@ }, { "cell_type": "markdown", - "id": "fab0629f", + "id": "10eb935e", "metadata": {}, "source": [ "As before, when we plotted multiple realizations of a component in the 2nd, 3rd, and 4th panels, we also plotted population 95% confidence bands computed using the LinearStateSpace class.\n", @@ -1091,7 +1089,7 @@ }, { "cell_type": "markdown", - "id": "d0f8658a", + "id": "26ee32f7", "metadata": {}, "source": [ "### Peculiar Large Sample Property\n", @@ -1116,7 +1114,7 @@ { "cell_type": "code", "execution_count": null, - "id": "cede538a", + "id": "d505dd35", "metadata": { "hide-output": false }, @@ -1129,7 +1127,7 @@ }, { "cell_type": "markdown", - "id": "b391f98f", + "id": "4bde63e6", "metadata": {}, "source": [ "The dotted line in the above graph is the mean $ E \\tilde M_t = 1 $ of the martingale.\n", @@ -1141,7 +1139,7 @@ }, { "cell_type": "markdown", - "id": "b2a4cc79", + "id": "107332c6", "metadata": {}, "source": [ "## More About the Multiplicative Martingale\n", @@ -1162,7 +1160,7 @@ }, { "cell_type": "markdown", - "id": "dbd4beb0", + "id": "7833bf89", "metadata": {}, "source": [ "### Simulating a Multiplicative Martingale Again\n", @@ -1179,7 +1177,7 @@ }, { "cell_type": "markdown", - "id": "8c71acc0", + "id": "a1aaf79c", "metadata": {}, "source": [ "### Sample Paths\n", @@ -1192,7 +1190,7 @@ { "cell_type": "code", "execution_count": null, - "id": "d647d328", + "id": "6355c47b", "metadata": { "hide-output": false }, @@ -1304,7 +1302,7 @@ }, { "cell_type": "markdown", - "id": "f395d1e4", + "id": "519d3fe3", "metadata": {}, "source": [ "The heavy lifting is done inside the `AMF_LSS_VAR` class.\n", @@ -1315,7 +1313,7 @@ { "cell_type": "code", "execution_count": null, - "id": "0672fa93", + "id": "085ae708", "metadata": { "hide-output": false }, @@ -1365,7 +1363,7 @@ }, { "cell_type": "markdown", - "id": "ecebf779", + "id": "1a43750d", "metadata": {}, "source": [ "Now that we have these functions in our toolkit, let’s apply them to run some\n", @@ -1375,7 +1373,7 @@ { "cell_type": "code", "execution_count": null, - "id": "3df93f6e", + "id": "1a6bf5db", "metadata": { "hide-output": false }, @@ -1418,7 +1416,7 @@ }, { "cell_type": "markdown", - "id": "4179851d", + "id": "81b576ff", "metadata": {}, "source": [ "Let’s plot the probability density functions for $ \\log {\\widetilde M}_t $ for\n", @@ -1445,7 +1443,7 @@ { "cell_type": "code", "execution_count": null, - "id": "545d9e9b", + "id": "f8737f92", "metadata": { "hide-output": false }, @@ -1500,7 +1498,7 @@ }, { "cell_type": "markdown", - "id": "61674988", + "id": "8a370b06", "metadata": {}, "source": [ "These probability density functions help us understand mechanics underlying the **peculiar property** of our multiplicative martingale\n", @@ -1515,7 +1513,7 @@ }, { "cell_type": "markdown", - "id": "17e65361", + "id": "cdfa5edf", "metadata": {}, "source": [ "### Multiplicative Martingale as Likelihood Ratio Process\n", @@ -1531,7 +1529,7 @@ } ], "metadata": { - "date": 1680677523.1599522, + "date": 1685490450.2383587, "filename": "additive_functionals.md", "kernelspec": { "display_name": "Python", diff --git a/amss.ipynb b/amss.ipynb index c4493cd..cc020ce 100644 --- a/amss.ipynb +++ b/amss.ipynb @@ -2,7 +2,7 @@ "cells": [ { "cell_type": "markdown", - "id": "fd13a8d7", + "id": "2c445c5e", "metadata": {}, "source": [ "\n", @@ -11,7 +11,7 @@ }, { "cell_type": "markdown", - "id": "dde89be0", + "id": "61eda6ad", "metadata": {}, "source": [ "# Optimal Taxation without State-Contingent Debt" @@ -19,7 +19,7 @@ }, { "cell_type": "markdown", - "id": "22af500f", + "id": "b6c379fa", "metadata": {}, "source": [ "## Contents\n", @@ -33,7 +33,7 @@ }, { "cell_type": "markdown", - "id": "fbb36d50", + "id": "a2162af0", "metadata": {}, "source": [ "In addition to what’s in Anaconda, this lecture will need the following libraries:" @@ -42,7 +42,7 @@ { "cell_type": "code", "execution_count": null, - "id": "f0c6ff2e", + "id": "260bfa16", "metadata": { "hide-output": false }, @@ -54,7 +54,7 @@ }, { "cell_type": "markdown", - "id": "1d038810", + "id": "d86de9e5", "metadata": {}, "source": [ "## Overview\n", @@ -65,7 +65,7 @@ { "cell_type": "code", "execution_count": null, - "id": "eabbcebe", + "id": "80e4a037", "metadata": { "hide-output": false }, @@ -84,7 +84,7 @@ }, { "cell_type": "markdown", - "id": "cc378590", + "id": "29a77631", "metadata": {}, "source": [ "In [an earlier lecture](https://python-advanced.quantecon.org/opt_tax_recur.html), we described a model of\n", @@ -108,7 +108,7 @@ }, { "cell_type": "markdown", - "id": "344ef417", + "id": "a3434ee5", "metadata": {}, "source": [ "## Competitive Equilibrium with Distorting Taxes\n", @@ -172,7 +172,7 @@ }, { "cell_type": "markdown", - "id": "9f97f913", + "id": "590c99ad", "metadata": {}, "source": [ "### Risk-free One-Period Debt Only\n", @@ -306,7 +306,7 @@ }, { "cell_type": "markdown", - "id": "25770fcf", + "id": "39630f00", "metadata": {}, "source": [ "### Comparison with Lucas-Stokey Economy\n", @@ -322,7 +322,7 @@ }, { "cell_type": "markdown", - "id": "b2a1aa41", + "id": "bd71e726", "metadata": {}, "source": [ "### Ramsey Problem Without State-contingent Debt\n", @@ -360,7 +360,7 @@ }, { "cell_type": "markdown", - "id": "4f2824d0", + "id": "2322f095", "metadata": {}, "source": [ "#### Lagrangian Formulation\n", @@ -396,7 +396,7 @@ }, { "cell_type": "markdown", - "id": "2637c08c", + "id": "8087dbee", "metadata": {}, "source": [ "### Some Calculations\n", @@ -486,7 +486,7 @@ { "cell_type": "code", "execution_count": null, - "id": "8c80ed75", + "id": "382cba44", "metadata": { "hide-output": false }, @@ -694,7 +694,7 @@ }, { "cell_type": "markdown", - "id": "d6b6ab75", + "id": "9b6b0006", "metadata": {}, "source": [ "To analyze the AMSS model, we find it useful to adopt a recursive formulation\n", @@ -703,7 +703,7 @@ }, { "cell_type": "markdown", - "id": "9fa0c346", + "id": "2eadb70d", "metadata": {}, "source": [ "## Recursive Version of AMSS Model\n", @@ -726,7 +726,7 @@ }, { "cell_type": "markdown", - "id": "b3b97878", + "id": "46aea9f8", "metadata": {}, "source": [ "### Recasting State Variables\n", @@ -795,7 +795,7 @@ }, { "cell_type": "markdown", - "id": "bdcf36af", + "id": "ed0aab89", "metadata": {}, "source": [ "### Measurability Constraints\n", @@ -824,7 +824,7 @@ }, { "cell_type": "markdown", - "id": "d5cd1475", + "id": "1ec609c7", "metadata": {}, "source": [ "### Two Bellman Equations\n", @@ -888,7 +888,7 @@ }, { "cell_type": "markdown", - "id": "71b1fb61", + "id": "c1b29793", "metadata": {}, "source": [ "### Martingale Supercedes State-Variable Degeneracy\n", @@ -937,7 +937,7 @@ }, { "cell_type": "markdown", - "id": "2b4d6662", + "id": "2bcbbf24", "metadata": {}, "source": [ "### Exercise 43.1\n", @@ -949,7 +949,7 @@ }, { "cell_type": "markdown", - "id": "989c7085", + "id": "722b9d69", "metadata": {}, "source": [ "### Absence of State Variable Degeneracy\n", @@ -978,7 +978,7 @@ }, { "cell_type": "markdown", - "id": "fd3af1bc", + "id": "e5dd26fa", "metadata": {}, "source": [ "### Digression on Non-negative Transfers\n", @@ -1015,7 +1015,7 @@ }, { "cell_type": "markdown", - "id": "246e04fa", + "id": "436577de", "metadata": {}, "source": [ "### Code\n", @@ -1026,7 +1026,7 @@ { "cell_type": "code", "execution_count": null, - "id": "6fcad146", + "id": "98016258", "metadata": { "hide-output": false }, @@ -1248,7 +1248,7 @@ }, { "cell_type": "markdown", - "id": "dcf2ac9f", + "id": "aa934255", "metadata": {}, "source": [ "## Examples\n", @@ -1258,7 +1258,7 @@ }, { "cell_type": "markdown", - "id": "87312fde", + "id": "f6d800df", "metadata": {}, "source": [ "### Anticipated One-Period War\n", @@ -1324,7 +1324,7 @@ { "cell_type": "code", "execution_count": null, - "id": "712f77b5", + "id": "e7217651", "metadata": { "hide-output": false }, @@ -1380,7 +1380,7 @@ }, { "cell_type": "markdown", - "id": "71d07e41", + "id": "e85b0bc9", "metadata": {}, "source": [ "The following figure plots Ramsey plans under complete and incomplete\n", @@ -1396,7 +1396,7 @@ { "cell_type": "code", "execution_count": null, - "id": "0a44ef20", + "id": "b1daabe7", "metadata": { "hide-output": false }, @@ -1432,7 +1432,7 @@ { "cell_type": "code", "execution_count": null, - "id": "4f51c460", + "id": "294c34e2", "metadata": { "hide-output": false }, @@ -1454,7 +1454,7 @@ { "cell_type": "code", "execution_count": null, - "id": "2638173c", + "id": "108bfa84", "metadata": { "hide-output": false }, @@ -1468,7 +1468,7 @@ { "cell_type": "code", "execution_count": null, - "id": "42545a12", + "id": "2479aa03", "metadata": { "hide-output": false }, @@ -1481,7 +1481,7 @@ { "cell_type": "code", "execution_count": null, - "id": "d2722d59", + "id": "949416b5", "metadata": { "hide-output": false }, @@ -1515,7 +1515,7 @@ }, { "cell_type": "markdown", - "id": "03aff1e8", + "id": "db4d7e24", "metadata": {}, "source": [ "How a Ramsey planner responds to war depends on the structure of the asset market.\n", @@ -1559,7 +1559,7 @@ }, { "cell_type": "markdown", - "id": "f2045fab", + "id": "1b42166f", "metadata": {}, "source": [ "#### Perpetual War Alert\n", @@ -1584,7 +1584,7 @@ { "cell_type": "code", "execution_count": null, - "id": "a03b43ce", + "id": "bf948aa1", "metadata": { "hide-output": false }, @@ -1630,7 +1630,7 @@ }, { "cell_type": "markdown", - "id": "117ea915", + "id": "3d5e0b14", "metadata": {}, "source": [ "With these preferences, Ramsey tax rates will vary even in the Lucas-Stokey\n", @@ -1644,7 +1644,7 @@ { "cell_type": "code", "execution_count": null, - "id": "496789f2", + "id": "3a38a9a1", "metadata": { "hide-output": false }, @@ -1681,7 +1681,7 @@ { "cell_type": "code", "execution_count": null, - "id": "d45463e0", + "id": "653ee697", "metadata": { "hide-output": false }, @@ -1696,7 +1696,7 @@ { "cell_type": "code", "execution_count": null, - "id": "946cdfb8", + "id": "374f12db", "metadata": { "hide-output": false }, @@ -1708,7 +1708,7 @@ { "cell_type": "code", "execution_count": null, - "id": "1bfbcbc5", + "id": "9068e7cd", "metadata": { "hide-output": false }, @@ -1740,7 +1740,7 @@ }, { "cell_type": "markdown", - "id": "921466cd", + "id": "c245b271", "metadata": {}, "source": [ "When the government experiences a prolonged period of peace, it is able to reduce\n", @@ -1762,7 +1762,7 @@ { "cell_type": "code", "execution_count": null, - "id": "2f6e2ada", + "id": "8caf01c6", "metadata": { "hide-output": false }, @@ -1778,7 +1778,7 @@ { "cell_type": "code", "execution_count": null, - "id": "bacf7efa", + "id": "5742d454", "metadata": { "hide-output": false }, @@ -1806,7 +1806,7 @@ }, { "cell_type": "markdown", - "id": "cb204a8d", + "id": "106c5a73", "metadata": {}, "source": [ "

[1] In an allocation that solves the Ramsey problem and that levies distorting\n", @@ -1826,7 +1826,7 @@ } ], "metadata": { - "date": 1680677523.2296166, + "date": 1685490450.3090146, "filename": "amss.md", "kernelspec": { "display_name": "Python", diff --git a/amss2.ipynb b/amss2.ipynb index 1b75af3..69e1688 100644 --- a/amss2.ipynb +++ b/amss2.ipynb @@ -2,7 +2,7 @@ "cells": [ { "cell_type": "markdown", - "id": "a4af84de", + "id": "67187299", "metadata": {}, "source": [ "\n", @@ -11,7 +11,7 @@ }, { "cell_type": "markdown", - "id": "7c334839", + "id": "fcf54a75", "metadata": {}, "source": [ "# Fluctuating Interest Rates Deliver Fiscal Insurance" @@ -19,7 +19,7 @@ }, { "cell_type": "markdown", - "id": "3933b36f", + "id": "ce058d5c", "metadata": {}, "source": [ "## Contents\n", @@ -38,7 +38,7 @@ }, { "cell_type": "markdown", - "id": "c368d3c6", + "id": "32391475", "metadata": {}, "source": [ "In addition to what’s in Anaconda, this lecture will need the following libraries:" @@ -47,7 +47,7 @@ { "cell_type": "code", "execution_count": null, - "id": "47d6de40", + "id": "f7768436", "metadata": { "hide-output": false }, @@ -58,7 +58,7 @@ }, { "cell_type": "markdown", - "id": "f0db6835", + "id": "0f5f881e", "metadata": {}, "source": [ "## Overview\n", @@ -120,7 +120,7 @@ { "cell_type": "code", "execution_count": null, - "id": "d6575a8f", + "id": "dad3b15d", "metadata": { "hide-output": false }, @@ -133,7 +133,7 @@ }, { "cell_type": "markdown", - "id": "05bf8cf7", + "id": "a49779ba", "metadata": {}, "source": [ "## Forces at Work\n", @@ -163,7 +163,7 @@ }, { "cell_type": "markdown", - "id": "f2fc6a64", + "id": "b071ecfc", "metadata": {}, "source": [ "## Logical Flow of Lecture\n", @@ -183,7 +183,7 @@ }, { "cell_type": "markdown", - "id": "3a03b468", + "id": "8c2e61dd", "metadata": {}, "source": [ "### Equations from Lucas-Stokey (1983) Model\n", @@ -252,7 +252,7 @@ }, { "cell_type": "markdown", - "id": "c0608f44", + "id": "d85e16e8", "metadata": {}, "source": [ "### Specification with CRRA Utility\n", @@ -310,7 +310,7 @@ { "cell_type": "code", "execution_count": null, - "id": "553eab23", + "id": "6b375d74", "metadata": { "hide-output": false }, @@ -358,7 +358,7 @@ }, { "cell_type": "markdown", - "id": "689a6963", + "id": "50113d5a", "metadata": {}, "source": [ "## Example Economy\n", @@ -392,7 +392,7 @@ { "cell_type": "code", "execution_count": null, - "id": "5e15bc91", + "id": "4370f199", "metadata": { "hide-output": false }, @@ -561,7 +561,7 @@ { "cell_type": "code", "execution_count": null, - "id": "fbf1d171", + "id": "4fbb3aa5", "metadata": { "hide-output": false }, @@ -870,7 +870,7 @@ { "cell_type": "code", "execution_count": null, - "id": "9822a018", + "id": "67d5ff11", "metadata": { "hide-output": false }, @@ -949,7 +949,7 @@ }, { "cell_type": "markdown", - "id": "e0ff55c8", + "id": "3a97c8c9", "metadata": {}, "source": [ "## Reverse Engineering Strategy\n", @@ -1000,7 +1000,7 @@ }, { "cell_type": "markdown", - "id": "b3c72ae7", + "id": "93ec54f9", "metadata": {}, "source": [ "## Code for Reverse Engineering\n", @@ -1011,7 +1011,7 @@ { "cell_type": "code", "execution_count": null, - "id": "df99f914", + "id": "7905ac3d", "metadata": { "hide-output": false }, @@ -1057,7 +1057,7 @@ }, { "cell_type": "markdown", - "id": "f02cdca4", + "id": "efe3672b", "metadata": {}, "source": [ "To recover and print out $ \\bar b $" @@ -1066,7 +1066,7 @@ { "cell_type": "code", "execution_count": null, - "id": "03e0e335", + "id": "841d6af2", "metadata": { "hide-output": false }, @@ -1078,7 +1078,7 @@ }, { "cell_type": "markdown", - "id": "b636ef4c", + "id": "4a254fb1", "metadata": {}, "source": [ "To complete the reverse engineering exercise by jointly determining $ c_0, b_0 $, we\n", @@ -1088,7 +1088,7 @@ { "cell_type": "code", "execution_count": null, - "id": "363c4fcb", + "id": "c5578bf6", "metadata": { "hide-output": false }, @@ -1115,7 +1115,7 @@ }, { "cell_type": "markdown", - "id": "46b77a85", + "id": "33ef2a73", "metadata": {}, "source": [ "To solve the equations for $ c_0, b_0 $, we use SciPy’s fsolve function" @@ -1124,7 +1124,7 @@ { "cell_type": "code", "execution_count": null, - "id": "6e7d6a9c", + "id": "850fcbd9", "metadata": { "hide-output": false }, @@ -1137,7 +1137,7 @@ }, { "cell_type": "markdown", - "id": "914fcfa0", + "id": "75e59653", "metadata": {}, "source": [ "Thus, we have reverse engineered an initial $ b0 = -1.038698407551764 $ that ought to render the AMSS measurability constraints slack." @@ -1145,7 +1145,7 @@ }, { "cell_type": "markdown", - "id": "c589918b", + "id": "0ad6bc3c", "metadata": {}, "source": [ "## Short Simulation for Reverse-engineered: Initial Debt\n", @@ -1159,7 +1159,7 @@ { "cell_type": "code", "execution_count": null, - "id": "d8ba8712", + "id": "80068dac", "metadata": { "hide-output": false }, @@ -1207,7 +1207,7 @@ }, { "cell_type": "markdown", - "id": "ae2c6ecb", + "id": "178ab562", "metadata": {}, "source": [ "The Ramsey allocations and Ramsey outcomes are **identical** for the Lucas-Stokey and AMSS economies.\n", @@ -1221,7 +1221,7 @@ }, { "cell_type": "markdown", - "id": "66bb70f3", + "id": "d85580bd", "metadata": {}, "source": [ "## Long Simulation\n", @@ -1256,7 +1256,7 @@ { "cell_type": "code", "execution_count": null, - "id": "9e53946d", + "id": "8a31c6ab", "metadata": { "hide-output": false }, @@ -1284,7 +1284,7 @@ }, { "cell_type": "markdown", - "id": "a5568ae4", + "id": "bcdab763", "metadata": {}, "source": [ "### Remarks about Long Simulation\n", @@ -1305,7 +1305,7 @@ }, { "cell_type": "markdown", - "id": "6c650de0", + "id": "a5b4360a", "metadata": {}, "source": [ "## BEGS Approximations of Limiting Debt and Convergence Rate\n", @@ -1348,7 +1348,7 @@ }, { "cell_type": "markdown", - "id": "1d2fc8c6", + "id": "0019793c", "metadata": {}, "source": [ "### Asymptotic Mean\n", @@ -1388,7 +1388,7 @@ }, { "cell_type": "markdown", - "id": "cc9e1555", + "id": "983a7776", "metadata": {}, "source": [ "### Rate of Convergence\n", @@ -1406,7 +1406,7 @@ }, { "cell_type": "markdown", - "id": "49cb6474", + "id": "08ee9bc4", "metadata": {}, "source": [ "### Formulas and Code Details\n", @@ -1454,7 +1454,7 @@ { "cell_type": "code", "execution_count": null, - "id": "797b8d3d", + "id": "e7d0db78", "metadata": { "hide-output": false }, @@ -1476,7 +1476,7 @@ }, { "cell_type": "markdown", - "id": "6dbadd23", + "id": "43a16d03", "metadata": {}, "source": [ "Now let’s form the two random variables $ {\\mathcal R}, {\\mathcal X} $ appearing in the BEGS approximating formulas" @@ -1485,7 +1485,7 @@ { "cell_type": "code", "execution_count": null, - "id": "c0e67d6a", + "id": "84a4b2f6", "metadata": { "hide-output": false }, @@ -1511,7 +1511,7 @@ }, { "cell_type": "markdown", - "id": "ea615989", + "id": "d8199290", "metadata": {}, "source": [ "Now let’s compute the ingredient of the approximating limit and the approximating rate of convergence" @@ -1520,7 +1520,7 @@ { "cell_type": "code", "execution_count": null, - "id": "eef031b8", + "id": "4f349b3c", "metadata": { "hide-output": false }, @@ -1534,7 +1534,7 @@ }, { "cell_type": "markdown", - "id": "743a3a2e", + "id": "d9e6699a", "metadata": {}, "source": [ "Print out $ \\hat b $ and $ \\bar b $" @@ -1543,7 +1543,7 @@ { "cell_type": "code", "execution_count": null, - "id": "dbfb8bc9", + "id": "18bf8df1", "metadata": { "hide-output": false }, @@ -1554,7 +1554,7 @@ }, { "cell_type": "markdown", - "id": "0b43ab4d", + "id": "696a0ffd", "metadata": {}, "source": [ "So we have" @@ -1563,7 +1563,7 @@ { "cell_type": "code", "execution_count": null, - "id": "dcb46bf9", + "id": "926c55b2", "metadata": { "hide-output": false }, @@ -1574,7 +1574,7 @@ }, { "cell_type": "markdown", - "id": "0c1b4dda", + "id": "38fc2ef7", "metadata": {}, "source": [ "These outcomes show that $ \\hat b $ does a remarkably good job of approximating $ \\bar b $.\n", @@ -1585,7 +1585,7 @@ { "cell_type": "code", "execution_count": null, - "id": "562d17eb", + "id": "fb8a65cb", "metadata": { "hide-output": false }, @@ -1597,7 +1597,7 @@ }, { "cell_type": "markdown", - "id": "464b0ccc", + "id": "101a4229", "metadata": {}, "source": [ "This is *machine zero*, a verification that $ \\hat b $ succeeds in minimizing the nonnegative fiscal cost criterion $ J ( {\\mathcal B}^*) $ defined in\n", @@ -1609,7 +1609,7 @@ { "cell_type": "code", "execution_count": null, - "id": "afe2c8d7", + "id": "98ccfce6", "metadata": { "hide-output": false }, @@ -1622,7 +1622,7 @@ }, { "cell_type": "markdown", - "id": "14602ab3", + "id": "ac1ce1ed", "metadata": {}, "source": [ "Now let’s compute the implied meantime to get to within 0.01 of the limit" @@ -1631,7 +1631,7 @@ { "cell_type": "code", "execution_count": null, - "id": "36951e86", + "id": "7cf4a9cb", "metadata": { "hide-output": false }, @@ -1643,7 +1643,7 @@ }, { "cell_type": "markdown", - "id": "cf4e58ed", + "id": "17693f71", "metadata": {}, "source": [ "The slow rate of convergence and the implied time of getting within one percent of the limiting value do a good job of approximating\n", @@ -1654,7 +1654,7 @@ } ], "metadata": { - "date": 1680677523.4979053, + "date": 1685490450.5272586, "filename": "amss2.md", "kernelspec": { "display_name": "Python", diff --git a/amss3.ipynb b/amss3.ipynb index 846bfb6..86ec562 100644 --- a/amss3.ipynb +++ b/amss3.ipynb @@ -2,7 +2,7 @@ "cells": [ { "cell_type": "markdown", - "id": "f06094d4", + "id": "6e462098", "metadata": {}, "source": [ "\n", @@ -11,7 +11,7 @@ }, { "cell_type": "markdown", - "id": "cc21e715", + "id": "7f82d3b6", "metadata": {}, "source": [ "# Fiscal Risk and Government Debt" @@ -19,7 +19,7 @@ }, { "cell_type": "markdown", - "id": "583b6f3f", + "id": "3b6788db", "metadata": {}, "source": [ "## Contents\n", @@ -33,7 +33,7 @@ }, { "cell_type": "markdown", - "id": "a4171932", + "id": "e67d90c7", "metadata": {}, "source": [ "In addition to what’s in Anaconda, this lecture will need the following libraries:" @@ -42,7 +42,7 @@ { "cell_type": "code", "execution_count": null, - "id": "0894ffbe", + "id": "1a6cb217", "metadata": { "hide-output": false }, @@ -53,7 +53,7 @@ }, { "cell_type": "markdown", - "id": "cafef4a4", + "id": "b8f7a0fe", "metadata": {}, "source": [ "## Overview\n", @@ -101,7 +101,7 @@ { "cell_type": "code", "execution_count": null, - "id": "06e0119c", + "id": "d9bf6b5c", "metadata": { "hide-output": false }, @@ -114,7 +114,7 @@ }, { "cell_type": "markdown", - "id": "b3ff7f27", + "id": "4caa3cc6", "metadata": {}, "source": [ "## The Economy\n", @@ -159,7 +159,7 @@ { "cell_type": "code", "execution_count": null, - "id": "2b39ef01", + "id": "4e104dcf", "metadata": { "hide-output": false }, @@ -207,7 +207,7 @@ }, { "cell_type": "markdown", - "id": "d8d5d98a", + "id": "8a584054", "metadata": {}, "source": [ "### First and Second Moments\n", @@ -220,7 +220,7 @@ { "cell_type": "code", "execution_count": null, - "id": "abccdd41", + "id": "fbd5e831", "metadata": { "hide-output": false }, @@ -242,7 +242,7 @@ }, { "cell_type": "markdown", - "id": "7baaa0f7", + "id": "565c126a", "metadata": {}, "source": [ "## Long Simulation\n", @@ -257,7 +257,7 @@ { "cell_type": "code", "execution_count": null, - "id": "edc42dd1", + "id": "9c078838", "metadata": { "hide-output": false }, @@ -426,7 +426,7 @@ { "cell_type": "code", "execution_count": null, - "id": "ef50c7da", + "id": "7de43c4e", "metadata": { "hide-output": false }, @@ -735,7 +735,7 @@ { "cell_type": "code", "execution_count": null, - "id": "7c1b8fbe", + "id": "9e47f3f5", "metadata": { "hide-output": false }, @@ -814,7 +814,7 @@ }, { "cell_type": "markdown", - "id": "95fb2f85", + "id": "863f5c05", "metadata": {}, "source": [ "Next, we show the code that we use to generate a very long simulation starting from initial\n", @@ -826,7 +826,7 @@ { "cell_type": "code", "execution_count": null, - "id": "d4b74ddb", + "id": "e0b51f90", "metadata": { "hide-output": false }, @@ -867,7 +867,7 @@ }, { "cell_type": "markdown", - "id": "817a8f87", + "id": "bf6400eb", "metadata": {}, "source": [ "![https://python-advanced.quantecon.org/_static/lecture_specific/amss3/amss3_g1.png](https://python-advanced.quantecon.org/_static/lecture_specific/amss3/amss3_g1.png)\n", @@ -899,7 +899,7 @@ { "cell_type": "code", "execution_count": null, - "id": "9baeca00", + "id": "df84a467", "metadata": { "hide-output": false }, @@ -927,7 +927,7 @@ }, { "cell_type": "markdown", - "id": "46993023", + "id": "319d8e50", "metadata": {}, "source": [ "![https://python-advanced.quantecon.org/_static/lecture_specific/amss3/amss3_g2.png](https://python-advanced.quantecon.org/_static/lecture_specific/amss3/amss3_g2.png)\n", @@ -943,7 +943,7 @@ }, { "cell_type": "markdown", - "id": "7a921f50", + "id": "34820333", "metadata": {}, "source": [ "## Asymptotic Mean and Rate of Convergence\n", @@ -997,7 +997,7 @@ }, { "cell_type": "markdown", - "id": "e42c91e5", + "id": "28f01030", "metadata": {}, "source": [ "### Asymptotic Mean\n", @@ -1040,7 +1040,7 @@ }, { "cell_type": "markdown", - "id": "f400dc48", + "id": "ade3f8c7", "metadata": {}, "source": [ "### Rate of Convergence\n", @@ -1059,7 +1059,7 @@ }, { "cell_type": "markdown", - "id": "bbf6993f", + "id": "d7b6d739", "metadata": {}, "source": [ "### More Advanced Topic\n", @@ -1071,7 +1071,7 @@ }, { "cell_type": "markdown", - "id": "3430ae58", + "id": "e3a435e1", "metadata": {}, "source": [ "### Chicken and Egg\n", @@ -1096,7 +1096,7 @@ }, { "cell_type": "markdown", - "id": "3fcdeb49", + "id": "6e0c9744", "metadata": {}, "source": [ "### Approximating the Ergodic Mean\n", @@ -1118,7 +1118,7 @@ }, { "cell_type": "markdown", - "id": "43aba7a5", + "id": "47bc111e", "metadata": {}, "source": [ "### Step by Step\n", @@ -1261,7 +1261,7 @@ }, { "cell_type": "markdown", - "id": "c1344f51", + "id": "bd87bfd7", "metadata": {}, "source": [ "### Execution\n", @@ -1271,7 +1271,7 @@ }, { "cell_type": "markdown", - "id": "9efab1b1", + "id": "0d596378", "metadata": {}, "source": [ "#### Step 1" @@ -1280,7 +1280,7 @@ { "cell_type": "code", "execution_count": null, - "id": "b9ca5644", + "id": "b470ab2b", "metadata": { "hide-output": false }, @@ -1304,7 +1304,7 @@ { "cell_type": "code", "execution_count": null, - "id": "01eb235a", + "id": "907284ef", "metadata": { "hide-output": false }, @@ -1315,7 +1315,7 @@ }, { "cell_type": "markdown", - "id": "5c712549", + "id": "593408a7", "metadata": {}, "source": [ "#### Step 2" @@ -1324,7 +1324,7 @@ { "cell_type": "code", "execution_count": null, - "id": "112c26de", + "id": "bebdbc48", "metadata": { "hide-output": false }, @@ -1335,7 +1335,7 @@ }, { "cell_type": "markdown", - "id": "88570ba0", + "id": "272a48a9", "metadata": {}, "source": [ "### Note about Code\n", @@ -1352,7 +1352,7 @@ }, { "cell_type": "markdown", - "id": "bf98a10c", + "id": "c7e05e07", "metadata": {}, "source": [ "### Running the code\n", @@ -1366,7 +1366,7 @@ { "cell_type": "code", "execution_count": null, - "id": "317fbf3d", + "id": "f8d08057", "metadata": { "hide-output": false }, @@ -1385,7 +1385,7 @@ { "cell_type": "code", "execution_count": null, - "id": "eab1c198", + "id": "de5e4c30", "metadata": { "hide-output": false }, @@ -1397,7 +1397,7 @@ { "cell_type": "code", "execution_count": null, - "id": "ba874847", + "id": "f44b3a46", "metadata": { "hide-output": false }, @@ -1408,7 +1408,7 @@ }, { "cell_type": "markdown", - "id": "caf07dc0", + "id": "056c6587", "metadata": {}, "source": [ "We only want unconditional expectations because we are in an IID case.\n", @@ -1420,7 +1420,7 @@ { "cell_type": "code", "execution_count": null, - "id": "67edabae", + "id": "05f3864c", "metadata": { "hide-output": false }, @@ -1433,7 +1433,7 @@ }, { "cell_type": "markdown", - "id": "e6402677", + "id": "3905ed6c", "metadata": {}, "source": [ "Let’s look at the random variables $ {\\mathcal R}, {\\mathcal X} $" @@ -1442,7 +1442,7 @@ { "cell_type": "code", "execution_count": null, - "id": "dcc74d8d", + "id": "cc82ddc2", "metadata": { "hide-output": false }, @@ -1454,7 +1454,7 @@ { "cell_type": "code", "execution_count": null, - "id": "b0505d92", + "id": "b0a5fc4d", "metadata": { "hide-output": false }, @@ -1466,7 +1466,7 @@ { "cell_type": "code", "execution_count": null, - "id": "c0fb693b", + "id": "2b6a0960", "metadata": { "hide-output": false }, @@ -1478,7 +1478,7 @@ { "cell_type": "code", "execution_count": null, - "id": "1e375884", + "id": "c3a9ecbe", "metadata": { "hide-output": false }, @@ -1490,7 +1490,7 @@ { "cell_type": "code", "execution_count": null, - "id": "6b1c356a", + "id": "d9e95c1c", "metadata": { "hide-output": false }, @@ -1501,7 +1501,7 @@ }, { "cell_type": "markdown", - "id": "924dade6", + "id": "b7854925", "metadata": {}, "source": [ "#### Step 3" @@ -1510,7 +1510,7 @@ { "cell_type": "code", "execution_count": null, - "id": "7f86cf37", + "id": "ec75dafc", "metadata": { "hide-output": false }, @@ -1523,7 +1523,7 @@ }, { "cell_type": "markdown", - "id": "fead0be8", + "id": "40118924", "metadata": {}, "source": [ "Note that $ B $ is a scalar.\n", @@ -1534,7 +1534,7 @@ { "cell_type": "code", "execution_count": null, - "id": "47a5315a", + "id": "71d3bebb", "metadata": { "hide-output": false }, @@ -1549,7 +1549,7 @@ }, { "cell_type": "markdown", - "id": "655c6d7c", + "id": "f09f69d6", "metadata": {}, "source": [ "In the above cell, B is fixed at 1 and $ \\tau $ is to be computed as\n", @@ -1561,7 +1561,7 @@ }, { "cell_type": "markdown", - "id": "ea5b9820", + "id": "bedc8eb7", "metadata": {}, "source": [ "#### Step 4" @@ -1570,7 +1570,7 @@ { "cell_type": "code", "execution_count": null, - "id": "7ee5e72e", + "id": "9b06890f", "metadata": { "hide-output": false }, @@ -1586,7 +1586,7 @@ { "cell_type": "code", "execution_count": null, - "id": "1307c825", + "id": "a9779e33", "metadata": { "hide-output": false }, @@ -1597,7 +1597,7 @@ }, { "cell_type": "markdown", - "id": "8773baac", + "id": "26e5ceb0", "metadata": {}, "source": [ "#### Step 6" @@ -1606,7 +1606,7 @@ { "cell_type": "code", "execution_count": null, - "id": "77a1e7c1", + "id": "c432de82", "metadata": { "hide-output": false }, @@ -1619,7 +1619,7 @@ { "cell_type": "code", "execution_count": null, - "id": "5725d814", + "id": "cafbfbc5", "metadata": { "hide-output": false }, @@ -1631,7 +1631,7 @@ { "cell_type": "code", "execution_count": null, - "id": "6112718c", + "id": "7accbfcf", "metadata": { "hide-output": false }, @@ -1645,7 +1645,7 @@ { "cell_type": "code", "execution_count": null, - "id": "b6e44226", + "id": "512f4d69", "metadata": { "hide-output": false }, @@ -1658,7 +1658,7 @@ { "cell_type": "code", "execution_count": null, - "id": "3d6f33ce", + "id": "0b41fbfa", "metadata": { "hide-output": false }, @@ -1671,7 +1671,7 @@ { "cell_type": "code", "execution_count": null, - "id": "a4305c5b", + "id": "ffc15e6d", "metadata": { "hide-output": false }, @@ -1684,7 +1684,7 @@ { "cell_type": "code", "execution_count": null, - "id": "f5cc4fe5", + "id": "13cde38c", "metadata": { "hide-output": false }, @@ -1697,7 +1697,7 @@ { "cell_type": "code", "execution_count": null, - "id": "048a5a8c", + "id": "e6ee5c7d", "metadata": { "hide-output": false }, @@ -1708,7 +1708,7 @@ } ], "metadata": { - "date": 1680677523.5757244, + "date": 1685490450.6040769, "filename": "amss3.md", "kernelspec": { "display_name": "Python", diff --git a/arellano.ipynb b/arellano.ipynb index 5bb7ef4..e7977d1 100644 --- a/arellano.ipynb +++ b/arellano.ipynb @@ -2,7 +2,7 @@ "cells": [ { "cell_type": "markdown", - "id": "83e95c06", + "id": "0232faa2", "metadata": {}, "source": [ "\n", @@ -11,7 +11,7 @@ }, { "cell_type": "markdown", - "id": "e3b45eb2", + "id": "66ac0555", "metadata": {}, "source": [ "# Default Risk and Income Fluctuations" @@ -19,7 +19,7 @@ }, { "cell_type": "markdown", - "id": "29fb371a", + "id": "92deca77", "metadata": {}, "source": [ "## Contents\n", @@ -35,7 +35,7 @@ }, { "cell_type": "markdown", - "id": "d41624bf", + "id": "23df5c82", "metadata": {}, "source": [ "In addition to what’s in Anaconda, this lecture will need the following libraries:" @@ -44,7 +44,7 @@ { "cell_type": "code", "execution_count": null, - "id": "849d0713", + "id": "1f5a0bf1", "metadata": { "hide-output": false }, @@ -55,7 +55,7 @@ }, { "cell_type": "markdown", - "id": "72bc2e1b", + "id": "1241c95d", "metadata": {}, "source": [ "## Overview\n", @@ -107,7 +107,7 @@ { "cell_type": "code", "execution_count": null, - "id": "be6944d2", + "id": "f2886730", "metadata": { "hide-output": false }, @@ -125,7 +125,7 @@ }, { "cell_type": "markdown", - "id": "37551328", + "id": "1bedd9b3", "metadata": {}, "source": [ "## Structure\n", @@ -135,7 +135,7 @@ }, { "cell_type": "markdown", - "id": "d666774c", + "id": "c638ea38", "metadata": {}, "source": [ "### Output, Consumption and Debt\n", @@ -177,7 +177,7 @@ }, { "cell_type": "markdown", - "id": "a328bba1", + "id": "34473ac5", "metadata": {}, "source": [ "### Asset Markets\n", @@ -219,7 +219,7 @@ }, { "cell_type": "markdown", - "id": "51c030fa", + "id": "204bfadb", "metadata": {}, "source": [ "### Financial Markets\n", @@ -251,7 +251,7 @@ }, { "cell_type": "markdown", - "id": "4b5ef006", + "id": "918db776", "metadata": {}, "source": [ "### Government’s Decisions\n", @@ -277,7 +277,7 @@ }, { "cell_type": "markdown", - "id": "4c20cbb9", + "id": "9bb9f859", "metadata": {}, "source": [ "### Reentering International Credit Market\n", @@ -288,7 +288,7 @@ }, { "cell_type": "markdown", - "id": "c84f1e69", + "id": "6dbd9732", "metadata": {}, "source": [ "## Equilibrium\n", @@ -380,7 +380,7 @@ }, { "cell_type": "markdown", - "id": "b15fea7b", + "id": "4d5a9665", "metadata": {}, "source": [ "### Definition of Equilibrium\n", @@ -405,7 +405,7 @@ }, { "cell_type": "markdown", - "id": "583120f5", + "id": "adfeace7", "metadata": {}, "source": [ "## Computation\n", @@ -451,7 +451,7 @@ { "cell_type": "code", "execution_count": null, - "id": "2cc086c2", + "id": "2ab36d03", "metadata": { "hide-output": false }, @@ -498,7 +498,7 @@ }, { "cell_type": "markdown", - "id": "d4c44aba", + "id": "10a2c323", "metadata": {}, "source": [ "Notice how the class returns the data it stores as simple numerical values and\n", @@ -514,7 +514,7 @@ { "cell_type": "code", "execution_count": null, - "id": "ff48fd3e", + "id": "f8091f9d", "metadata": { "hide-output": false }, @@ -527,7 +527,7 @@ }, { "cell_type": "markdown", - "id": "58dec527", + "id": "bdf6bc0c", "metadata": {}, "source": [ "Here is a function to compute the bond price at each state, given $ v_c $ and\n", @@ -537,7 +537,7 @@ { "cell_type": "code", "execution_count": null, - "id": "bc556c4e", + "id": "924cd056", "metadata": { "hide-output": false }, @@ -565,7 +565,7 @@ }, { "cell_type": "markdown", - "id": "da5c01b8", + "id": "bd94f6dc", "metadata": {}, "source": [ "Next we introduce Bellman operators that updated $ v_d $ and $ v_c $." @@ -574,7 +574,7 @@ { "cell_type": "code", "execution_count": null, - "id": "f386b59b", + "id": "0afa9668", "metadata": { "hide-output": false }, @@ -626,7 +626,7 @@ }, { "cell_type": "markdown", - "id": "bb0d01d4", + "id": "8459219d", "metadata": {}, "source": [ "Here is a fast function that calls these operators in the right sequence." @@ -635,7 +635,7 @@ { "cell_type": "code", "execution_count": null, - "id": "2550dc2a", + "id": "132da180", "metadata": { "hide-output": false }, @@ -672,7 +672,7 @@ }, { "cell_type": "markdown", - "id": "6f767949", + "id": "4a7434d2", "metadata": {}, "source": [ "We can now write a function that will use the `Arellano_Economy` class and the\n", @@ -689,7 +689,7 @@ { "cell_type": "code", "execution_count": null, - "id": "bc9eaea4", + "id": "e6a886ca", "metadata": { "hide-output": false }, @@ -733,7 +733,7 @@ }, { "cell_type": "markdown", - "id": "1612f822", + "id": "03303f96", "metadata": {}, "source": [ "Finally, we write a function that will allow us to simulate the economy once\n", @@ -743,7 +743,7 @@ { "cell_type": "code", "execution_count": null, - "id": "ed5dda6f", + "id": "16bc7bf4", "metadata": { "hide-output": false }, @@ -813,7 +813,7 @@ }, { "cell_type": "markdown", - "id": "eee44f0b", + "id": "d9bfbed3", "metadata": {}, "source": [ "## Results\n", @@ -884,7 +884,7 @@ }, { "cell_type": "markdown", - "id": "7937969a", + "id": "097ed6c6", "metadata": {}, "source": [ "## Exercises\n", @@ -895,7 +895,7 @@ }, { "cell_type": "markdown", - "id": "ea8f8483", + "id": "9c5510d3", "metadata": {}, "source": [ "## Exercise 13.1\n", @@ -908,7 +908,7 @@ }, { "cell_type": "markdown", - "id": "8b312cfb", + "id": "f9528911", "metadata": {}, "source": [ "## Solution to[ Exercise 13.1](https://python-advanced.quantecon.org/#arella_ex1)\n", @@ -919,7 +919,7 @@ { "cell_type": "code", "execution_count": null, - "id": "1863ab53", + "id": "85e7557f", "metadata": { "hide-output": false }, @@ -931,7 +931,7 @@ { "cell_type": "code", "execution_count": null, - "id": "9a2d7681", + "id": "f0e4234e", "metadata": { "hide-output": false }, @@ -942,7 +942,7 @@ }, { "cell_type": "markdown", - "id": "2af5d6f0", + "id": "a38768cb", "metadata": {}, "source": [ "Compute the bond price schedule as seen in figure 3 of Arellano (2008)" @@ -951,7 +951,7 @@ { "cell_type": "code", "execution_count": null, - "id": "0ce648e0", + "id": "b5307241", "metadata": { "hide-output": false }, @@ -987,7 +987,7 @@ }, { "cell_type": "markdown", - "id": "787ccf04", + "id": "717d6eff", "metadata": {}, "source": [ "Draw a plot of the value functions" @@ -996,7 +996,7 @@ { "cell_type": "code", "execution_count": null, - "id": "1d6d5f83", + "id": "3d648585", "metadata": { "hide-output": false }, @@ -1016,7 +1016,7 @@ }, { "cell_type": "markdown", - "id": "e0e2721c", + "id": "91d5b913", "metadata": {}, "source": [ "Draw a heat map for default probability" @@ -1025,7 +1025,7 @@ { "cell_type": "code", "execution_count": null, - "id": "ccfe662e", + "id": "b26cf40b", "metadata": { "hide-output": false }, @@ -1051,7 +1051,7 @@ }, { "cell_type": "markdown", - "id": "58675af6", + "id": "8ba5e356", "metadata": {}, "source": [ "Plot a time series of major variables simulated from the model" @@ -1060,7 +1060,7 @@ { "cell_type": "code", "execution_count": null, - "id": "8002ab51", + "id": "e4c071bb", "metadata": { "hide-output": false }, @@ -1109,7 +1109,7 @@ } ], "metadata": { - "date": 1680677523.6228049, + "date": 1685490450.649887, "filename": "arellano.md", "kernelspec": { "display_name": "Python", diff --git a/arma.ipynb b/arma.ipynb index 5e2a66c..7efa937 100644 --- a/arma.ipynb +++ b/arma.ipynb @@ -2,7 +2,7 @@ "cells": [ { "cell_type": "markdown", - "id": "0388081a", + "id": "1ed3b281", "metadata": {}, "source": [ "\n", @@ -11,7 +11,7 @@ }, { "cell_type": "markdown", - "id": "70c7c36d", + "id": "6c308ac9", "metadata": {}, "source": [ "# Covariance Stationary Processes" @@ -19,7 +19,7 @@ }, { "cell_type": "markdown", - "id": "92e6088b", + "id": "acbc3a43", "metadata": {}, "source": [ "## Contents\n", @@ -33,7 +33,7 @@ }, { "cell_type": "markdown", - "id": "eb20f9fe", + "id": "fa412016", "metadata": {}, "source": [ "In addition to what’s in Anaconda, this lecture will need the following libraries:" @@ -42,7 +42,7 @@ { "cell_type": "code", "execution_count": null, - "id": "48f04af9", + "id": "2a15173c", "metadata": { "hide-output": false }, @@ -53,7 +53,7 @@ }, { "cell_type": "markdown", - "id": "77af9b8c", + "id": "1a71d82c", "metadata": {}, "source": [ "## Overview\n", @@ -72,7 +72,7 @@ }, { "cell_type": "markdown", - "id": "6d71fcb8", + "id": "7f436f7a", "metadata": {}, "source": [ "### ARMA Processes\n", @@ -88,7 +88,7 @@ }, { "cell_type": "markdown", - "id": "7337d23e", + "id": "722ae560", "metadata": {}, "source": [ "### Spectral Analysis\n", @@ -109,7 +109,7 @@ }, { "cell_type": "markdown", - "id": "2604f333", + "id": "bea0a38a", "metadata": {}, "source": [ "### Other Reading\n", @@ -122,7 +122,7 @@ { "cell_type": "code", "execution_count": null, - "id": "68a27406", + "id": "84ed4fd3", "metadata": { "hide-output": false }, @@ -136,7 +136,7 @@ }, { "cell_type": "markdown", - "id": "bc750cf6", + "id": "9b5ab822", "metadata": {}, "source": [ "## Introduction\n", @@ -158,7 +158,7 @@ }, { "cell_type": "markdown", - "id": "094c94e0", + "id": "22e3042d", "metadata": {}, "source": [ "### Definitions\n", @@ -180,7 +180,7 @@ }, { "cell_type": "markdown", - "id": "6ff2a714", + "id": "bfb68850", "metadata": {}, "source": [ "### Example 1: White Noise\n", @@ -203,7 +203,7 @@ }, { "cell_type": "markdown", - "id": "4d87669c", + "id": "0e027b60", "metadata": {}, "source": [ "### Example 2: General Linear Processes\n", @@ -242,7 +242,7 @@ }, { "cell_type": "markdown", - "id": "7a5f5d3b", + "id": "fa69e4bc", "metadata": {}, "source": [ "### Wold Representation\n", @@ -270,7 +270,7 @@ }, { "cell_type": "markdown", - "id": "4faed259", + "id": "e513d7ab", "metadata": {}, "source": [ "### AR and MA\n", @@ -313,7 +313,7 @@ { "cell_type": "code", "execution_count": null, - "id": "613cf449", + "id": "7951a370", "metadata": { "hide-output": false }, @@ -337,7 +337,7 @@ }, { "cell_type": "markdown", - "id": "c3aa3a09", + "id": "79590671", "metadata": {}, "source": [ "Another very simple process is the MA(1) process (here MA means “moving average”)\n", @@ -363,7 +363,7 @@ }, { "cell_type": "markdown", - "id": "686b11c1", + "id": "bf85ddbf", "metadata": {}, "source": [ "### ARMA Processes\n", @@ -432,7 +432,7 @@ }, { "cell_type": "markdown", - "id": "7203326e", + "id": "85604c0e", "metadata": {}, "source": [ "## Spectral Analysis\n", @@ -450,7 +450,7 @@ }, { "cell_type": "markdown", - "id": "a90608d8", + "id": "81ba9c61", "metadata": {}, "source": [ "### Complex Numbers\n", @@ -491,7 +491,7 @@ }, { "cell_type": "markdown", - "id": "39ee3e0d", + "id": "42ba2ee3", "metadata": {}, "source": [ "### Spectral Densities\n", @@ -533,7 +533,7 @@ }, { "cell_type": "markdown", - "id": "aa984b95", + "id": "60094d4b", "metadata": {}, "source": [ "### Example 1: White Noise\n", @@ -549,7 +549,7 @@ }, { "cell_type": "markdown", - "id": "f21c3d41", + "id": "d117fd6d", "metadata": {}, "source": [ "### Example 2: AR and MA and ARMA\n", @@ -597,7 +597,7 @@ }, { "cell_type": "markdown", - "id": "143059d5", + "id": "e31844d9", "metadata": {}, "source": [ "### Interpreting the Spectral Density\n", @@ -610,7 +610,7 @@ { "cell_type": "code", "execution_count": null, - "id": "bda65a35", + "id": "c9d08ff2", "metadata": { "hide-output": false }, @@ -637,7 +637,7 @@ }, { "cell_type": "markdown", - "id": "f4588055", + "id": "38a75975", "metadata": {}, "source": [ "These spectral densities correspond to the autocovariance functions for the\n", @@ -671,7 +671,7 @@ { "cell_type": "code", "execution_count": null, - "id": "b311983d", + "id": "8b9d3699", "metadata": { "hide-output": false }, @@ -714,7 +714,7 @@ }, { "cell_type": "markdown", - "id": "80943ff7", + "id": "3dcecf95", "metadata": {}, "source": [ "On the other hand, if we evaluate $ f(\\omega) $ at $ \\omega = \\pi / 3 $, then the cycles are\n", @@ -725,7 +725,7 @@ { "cell_type": "code", "execution_count": null, - "id": "27a1eacd", + "id": "a19fa24b", "metadata": { "hide-output": false }, @@ -768,7 +768,7 @@ }, { "cell_type": "markdown", - "id": "07e861a8", + "id": "f1f83037", "metadata": {}, "source": [ "In summary, the spectral density is large at frequencies $ \\omega $ where the autocovariance function exhibits damped cycles." @@ -776,7 +776,7 @@ }, { "cell_type": "markdown", - "id": "f49f34cc", + "id": "80149ac0", "metadata": {}, "source": [ "### Inverting the Transformation\n", @@ -802,7 +802,7 @@ }, { "cell_type": "markdown", - "id": "0460427d", + "id": "0994b7bc", "metadata": {}, "source": [ "### Mathematical Theory\n", @@ -891,7 +891,7 @@ }, { "cell_type": "markdown", - "id": "dca9ef64", + "id": "1675d5ac", "metadata": {}, "source": [ "## Implementation\n", @@ -912,7 +912,7 @@ }, { "cell_type": "markdown", - "id": "768a2db0", + "id": "6f79a79c", "metadata": {}, "source": [ "### Application\n", @@ -925,7 +925,7 @@ { "cell_type": "code", "execution_count": null, - "id": "9d46573d", + "id": "06f809a5", "metadata": { "hide-output": false }, @@ -986,7 +986,7 @@ }, { "cell_type": "markdown", - "id": "7627245d", + "id": "995b3f0a", "metadata": {}, "source": [ "Now let’s call these functions to generate plots.\n", @@ -997,7 +997,7 @@ { "cell_type": "code", "execution_count": null, - "id": "00291568", + "id": "d0e7c136", "metadata": { "hide-output": false }, @@ -1011,7 +1011,7 @@ }, { "cell_type": "markdown", - "id": "cf8f52d0", + "id": "cc0e73c3", "metadata": {}, "source": [ "If we look carefully, things look good: the spectrum is the flat line at $ 10^0 $ at the very top of the spectrum graphs,\n", @@ -1033,7 +1033,7 @@ { "cell_type": "code", "execution_count": null, - "id": "90aaf05b", + "id": "5e14769b", "metadata": { "hide-output": false }, @@ -1047,7 +1047,7 @@ }, { "cell_type": "markdown", - "id": "e6f023b5", + "id": "d87daaef", "metadata": {}, "source": [ "Ljungqvist and Sargent’s second model is $ X_t = .9 X_{t-1} + \\epsilon_t $" @@ -1056,7 +1056,7 @@ { "cell_type": "code", "execution_count": null, - "id": "405dd178", + "id": "bd6fb853", "metadata": { "hide-output": false }, @@ -1070,7 +1070,7 @@ }, { "cell_type": "markdown", - "id": "835b6dcb", + "id": "da579295", "metadata": {}, "source": [ "Ljungqvist and Sargent’s third model is $ X_t = .8 X_{t-4} + \\epsilon_t $" @@ -1079,7 +1079,7 @@ { "cell_type": "code", "execution_count": null, - "id": "b8e4c490", + "id": "50af53c4", "metadata": { "hide-output": false }, @@ -1093,7 +1093,7 @@ }, { "cell_type": "markdown", - "id": "c12deccd", + "id": "ff38b552", "metadata": {}, "source": [ "Ljungqvist and Sargent’s fourth model is $ X_t = .98 X_{t-1} + \\epsilon_t -.7 \\epsilon_{t-1} $" @@ -1102,7 +1102,7 @@ { "cell_type": "code", "execution_count": null, - "id": "042bcfc8", + "id": "86929c34", "metadata": { "hide-output": false }, @@ -1116,7 +1116,7 @@ }, { "cell_type": "markdown", - "id": "63d7a2cb", + "id": "f980b740", "metadata": {}, "source": [ "### Explanation\n", @@ -1174,7 +1174,7 @@ }, { "cell_type": "markdown", - "id": "ce1e7a8f", + "id": "405f4423", "metadata": {}, "source": [ "### Computing the Autocovariance Function\n", @@ -1219,7 +1219,7 @@ } ], "metadata": { - "date": 1680677523.6954412, + "date": 1685490450.7223623, "filename": "arma.md", "kernelspec": { "display_name": "Python", diff --git a/asset_pricing_lph.ipynb b/asset_pricing_lph.ipynb index 366cca3..ca6db7d 100644 --- a/asset_pricing_lph.ipynb +++ b/asset_pricing_lph.ipynb @@ -2,7 +2,7 @@ "cells": [ { "cell_type": "markdown", - "id": "546df03d", + "id": "3d643f5e", "metadata": {}, "source": [ "# Elementary Asset Pricing Theory\n", @@ -13,7 +13,7 @@ }, { "cell_type": "markdown", - "id": "a11671a4", + "id": "ef34987b", "metadata": {}, "source": [ "## Contents\n", @@ -33,7 +33,7 @@ }, { "cell_type": "markdown", - "id": "d6efac49", + "id": "8ed72055", "metadata": {}, "source": [ "## Overview\n", @@ -78,7 +78,7 @@ }, { "cell_type": "markdown", - "id": "5f82ea5a", + "id": "731126b8", "metadata": {}, "source": [ "## Key Equation\n", @@ -122,7 +122,7 @@ }, { "cell_type": "markdown", - "id": "2ec4aa44", + "id": "9abf47de", "metadata": {}, "source": [ "## Implications of Key Equation\n", @@ -198,7 +198,7 @@ }, { "cell_type": "markdown", - "id": "222f2b15", + "id": "8a9c68d6", "metadata": {}, "source": [ "## Expected Return - Beta Representation\n", @@ -317,7 +317,7 @@ }, { "cell_type": "markdown", - "id": "5b0b2a25", + "id": "c6679c75", "metadata": {}, "source": [ "## Mean-Variance Frontier\n", @@ -391,7 +391,7 @@ { "cell_type": "code", "execution_count": null, - "id": "f6f143d3", + "id": "11085220", "metadata": { "hide-output": false }, @@ -440,7 +440,7 @@ }, { "cell_type": "markdown", - "id": "2318629a", + "id": "9eb8dbf3", "metadata": {}, "source": [ "The figure shows two straight lines, the blue upper one being the locus of $ ( \\sigma(R^i), E(R^i) $ pairs that are on\n", @@ -475,7 +475,7 @@ }, { "cell_type": "markdown", - "id": "7608fbb7", + "id": "11283146", "metadata": {}, "source": [ "## Sharpe Ratios and the Price of Risk\n", @@ -500,7 +500,7 @@ }, { "cell_type": "markdown", - "id": "16be7b9b", + "id": "59b43c5a", "metadata": {}, "source": [ "## Mathematical Structure of Frontier\n", @@ -532,7 +532,7 @@ }, { "cell_type": "markdown", - "id": "50b6f5a1", + "id": "44888c10", "metadata": {}, "source": [ "## Multi-factor Models\n", @@ -570,7 +570,7 @@ }, { "cell_type": "markdown", - "id": "005fd6e5", + "id": "355b5504", "metadata": {}, "source": [ "## Empirical Implementations\n", @@ -634,7 +634,7 @@ }, { "cell_type": "markdown", - "id": "4666502f", + "id": "beb8fb6c", "metadata": {}, "source": [ "## Exercises\n", @@ -645,7 +645,7 @@ { "cell_type": "code", "execution_count": null, - "id": "12744aff", + "id": "d1cdd7d7", "metadata": { "hide-output": false }, @@ -661,7 +661,7 @@ }, { "cell_type": "markdown", - "id": "668e2d1a", + "id": "aeb5d2b7", "metadata": {}, "source": [ "Lots of our calculations will involve computing population and sample OLS regressions.\n", @@ -672,7 +672,7 @@ { "cell_type": "code", "execution_count": null, - "id": "59ad3333", + "id": "94fe242a", "metadata": { "hide-output": false }, @@ -694,7 +694,7 @@ }, { "cell_type": "markdown", - "id": "d74e57a3", + "id": "c810acfc", "metadata": {}, "source": [ "## Exercise 35.1\n", @@ -710,7 +710,7 @@ }, { "cell_type": "markdown", - "id": "18e29f6e", + "id": "fb30006f", "metadata": {}, "source": [ "## Solution to[ Exercise 35.1](https://python-advanced.quantecon.org/#apl_ex1)\n", @@ -736,7 +736,7 @@ }, { "cell_type": "markdown", - "id": "c0c8d86a", + "id": "75365c39", "metadata": {}, "source": [ "## Exercise 35.2\n", @@ -746,7 +746,7 @@ }, { "cell_type": "markdown", - "id": "de36b1c1", + "id": "13c87bfc", "metadata": {}, "source": [ "## Solution to[ Exercise 35.2](https://python-advanced.quantecon.org/#apl_ex2)\n", @@ -760,7 +760,7 @@ }, { "cell_type": "markdown", - "id": "4ee75306", + "id": "e77b66e5", "metadata": {}, "source": [ "## Exercise 35.3\n", @@ -815,7 +815,7 @@ }, { "cell_type": "markdown", - "id": "4b1de0d5", + "id": "9b83c229", "metadata": {}, "source": [ "## Solution to[ Exercise 35.3](https://python-advanced.quantecon.org/#apl_ex3)\n", @@ -826,7 +826,7 @@ { "cell_type": "code", "execution_count": null, - "id": "ae6c9f6a", + "id": "50e5ca26", "metadata": { "hide-output": false }, @@ -846,7 +846,7 @@ { "cell_type": "code", "execution_count": null, - "id": "47a803ce", + "id": "1b3ca746", "metadata": { "hide-output": false }, @@ -861,7 +861,7 @@ { "cell_type": "code", "execution_count": null, - "id": "9ce91f7d", + "id": "8a7e13b9", "metadata": { "hide-output": false }, @@ -876,7 +876,7 @@ { "cell_type": "code", "execution_count": null, - "id": "c4002d21", + "id": "9e6aee55", "metadata": { "hide-output": false }, @@ -897,7 +897,7 @@ }, { "cell_type": "markdown", - "id": "87a5fa25", + "id": "94f54cd2", "metadata": {}, "source": [ "Now that we have a panel of data, we’d like to solve the inverse problem by assuming the theory specified above and estimating the coefficients given above." @@ -906,7 +906,7 @@ { "cell_type": "code", "execution_count": null, - "id": "eda0c35d", + "id": "3cfddc8d", "metadata": { "hide-output": false }, @@ -917,7 +917,7 @@ }, { "cell_type": "markdown", - "id": "08021d29", + "id": "d146b913", "metadata": {}, "source": [ "**Inverse Problem:**\n", @@ -930,7 +930,7 @@ { "cell_type": "code", "execution_count": null, - "id": "8d45d827", + "id": "039e1d42", "metadata": { "hide-output": false }, @@ -942,7 +942,7 @@ { "cell_type": "code", "execution_count": null, - "id": "58769e38", + "id": "e705c692", "metadata": { "hide-output": false }, @@ -953,7 +953,7 @@ }, { "cell_type": "markdown", - "id": "467251ae", + "id": "152f9434", "metadata": {}, "source": [ "Let’s compare these with the *true* population parameter values." @@ -962,7 +962,7 @@ { "cell_type": "code", "execution_count": null, - "id": "c8486c9c", + "id": "f2ce8244", "metadata": { "hide-output": false }, @@ -973,7 +973,7 @@ }, { "cell_type": "markdown", - "id": "42fd5ef9", + "id": "e3adcb1d", "metadata": {}, "source": [ "1. $ \\xi $ and $ \\lambda $ " @@ -982,7 +982,7 @@ { "cell_type": "code", "execution_count": null, - "id": "2e4666ce", + "id": "0c405424", "metadata": { "hide-output": false }, @@ -994,7 +994,7 @@ { "cell_type": "code", "execution_count": null, - "id": "e55f7af1", + "id": "d45ceeb8", "metadata": { "hide-output": false }, @@ -1006,7 +1006,7 @@ { "cell_type": "code", "execution_count": null, - "id": "96b6eafa", + "id": "62df88c4", "metadata": { "hide-output": false }, @@ -1017,7 +1017,7 @@ }, { "cell_type": "markdown", - "id": "c692e97f", + "id": "575bcc4c", "metadata": {}, "source": [ "1. $ \\beta_{i, R^m} $ and $ \\sigma_i $ " @@ -1026,7 +1026,7 @@ { "cell_type": "code", "execution_count": null, - "id": "1b1f80aa", + "id": "8d205eaa", "metadata": { "hide-output": false }, @@ -1042,7 +1042,7 @@ { "cell_type": "code", "execution_count": null, - "id": "28d9e314", + "id": "b4090775", "metadata": { "hide-output": false }, @@ -1054,7 +1054,7 @@ { "cell_type": "code", "execution_count": null, - "id": "935c4f77", + "id": "9a325d07", "metadata": { "hide-output": false }, @@ -1065,7 +1065,7 @@ }, { "cell_type": "markdown", - "id": "55ce6872", + "id": "e20119af", "metadata": {}, "source": [ "Q: How close did your estimates come to the parameters we specified?" @@ -1073,7 +1073,7 @@ }, { "cell_type": "markdown", - "id": "1f9402ba", + "id": "afc91dc3", "metadata": {}, "source": [ "## Exercise 35.4\n", @@ -1087,7 +1087,7 @@ }, { "cell_type": "markdown", - "id": "a898a9af", + "id": "342717ae", "metadata": {}, "source": [ "## Solution to[ Exercise 35.4](https://python-advanced.quantecon.org/#apl_ex4)\n", @@ -1105,7 +1105,7 @@ { "cell_type": "code", "execution_count": null, - "id": "9e42eda1", + "id": "34929465", "metadata": { "hide-output": false }, @@ -1128,7 +1128,7 @@ }, { "cell_type": "markdown", - "id": "001ef942", + "id": "5361cf2c", "metadata": {}, "source": [ "Let’s try to solve $ a $ and $ b $ using the actual model parameters." @@ -1137,7 +1137,7 @@ { "cell_type": "code", "execution_count": null, - "id": "a95f74fe", + "id": "5d51c20a", "metadata": { "hide-output": false }, @@ -1149,7 +1149,7 @@ { "cell_type": "code", "execution_count": null, - "id": "71848ba9", + "id": "9b63edb5", "metadata": { "hide-output": false }, @@ -1160,7 +1160,7 @@ }, { "cell_type": "markdown", - "id": "19879c3d", + "id": "f6ffbe41", "metadata": {}, "source": [ "## Exercise 35.5\n", @@ -1170,7 +1170,7 @@ }, { "cell_type": "markdown", - "id": "aa47a2c4", + "id": "686bcf64", "metadata": {}, "source": [ "## Solution to[ Exercise 35.5](https://python-advanced.quantecon.org/#apl_ex5)\n", @@ -1181,7 +1181,7 @@ { "cell_type": "code", "execution_count": null, - "id": "b950dfac", + "id": "b260c5ec", "metadata": { "hide-output": false }, @@ -1193,7 +1193,7 @@ { "cell_type": "code", "execution_count": null, - "id": "f896a923", + "id": "81836c0e", "metadata": { "hide-output": false }, @@ -1204,7 +1204,7 @@ } ], "metadata": { - "date": 1680677523.7622435, + "date": 1685490450.7898748, "filename": "asset_pricing_lph.md", "kernelspec": { "display_name": "Python", diff --git a/black_litterman.ipynb b/black_litterman.ipynb index c5c6938..0c1acdc 100644 --- a/black_litterman.ipynb +++ b/black_litterman.ipynb @@ -2,7 +2,7 @@ "cells": [ { "cell_type": "markdown", - "id": "e35057b3", + "id": "385f0969", "metadata": {}, "source": [ "\n", @@ -13,7 +13,7 @@ }, { "cell_type": "markdown", - "id": "82c1a2ad", + "id": "37f74e22", "metadata": {}, "source": [ "# Two Modifications of Mean-Variance Portfolio Theory" @@ -21,7 +21,7 @@ }, { "cell_type": "markdown", - "id": "d35ce060", + "id": "b105a619", "metadata": {}, "source": [ "## Contents\n", @@ -46,7 +46,7 @@ }, { "cell_type": "markdown", - "id": "f5b923f0", + "id": "2ea5fd71", "metadata": {}, "source": [ "## Overview\n", @@ -106,7 +106,7 @@ { "cell_type": "code", "execution_count": null, - "id": "c08f8f07", + "id": "886c4ba0", "metadata": { "hide-output": false }, @@ -122,7 +122,7 @@ }, { "cell_type": "markdown", - "id": "59061c91", + "id": "79868deb", "metadata": {}, "source": [ "## Mean-Variance Portfolio Choice\n", @@ -185,7 +185,7 @@ }, { "cell_type": "markdown", - "id": "56f75a15", + "id": "66890846", "metadata": {}, "source": [ "## Estimating Mean and Variance\n", @@ -205,7 +205,7 @@ }, { "cell_type": "markdown", - "id": "d7a40f62", + "id": "d35b44e4", "metadata": {}, "source": [ "## Black-Litterman Starting Point\n", @@ -223,7 +223,7 @@ { "cell_type": "code", "execution_count": null, - "id": "236a09f8", + "id": "f1eac687", "metadata": { "hide-output": false }, @@ -276,7 +276,7 @@ }, { "cell_type": "markdown", - "id": "6608f12b", + "id": "e6b053a7", "metadata": {}, "source": [ "Black and Litterman’s responded to this situation in the following way:\n", @@ -304,7 +304,7 @@ }, { "cell_type": "markdown", - "id": "158e40e2", + "id": "f3ef8f5e", "metadata": {}, "source": [ "## Details\n", @@ -376,7 +376,7 @@ { "cell_type": "code", "execution_count": null, - "id": "398962ac", + "id": "0a872402", "metadata": { "hide-output": false }, @@ -411,7 +411,7 @@ }, { "cell_type": "markdown", - "id": "3eb440ab", + "id": "c033d4f6", "metadata": {}, "source": [ "## Adding Views\n", @@ -474,7 +474,7 @@ { "cell_type": "code", "execution_count": null, - "id": "737fd5dd", + "id": "63ac1653", "metadata": { "hide-output": false }, @@ -538,7 +538,7 @@ }, { "cell_type": "markdown", - "id": "e221c994", + "id": "ffe4b373", "metadata": {}, "source": [ "## Bayesian Interpretation\n", @@ -588,7 +588,7 @@ }, { "cell_type": "markdown", - "id": "861bf601", + "id": "12fc553a", "metadata": {}, "source": [ "## Curve Decolletage\n", @@ -718,7 +718,7 @@ { "cell_type": "code", "execution_count": null, - "id": "ac094d0a", + "id": "f6404904", "metadata": { "hide-output": false }, @@ -796,7 +796,7 @@ }, { "cell_type": "markdown", - "id": "dc215344", + "id": "90cf7d6f", "metadata": {}, "source": [ "Note that the line that connects the two points\n", @@ -817,7 +817,7 @@ { "cell_type": "code", "execution_count": null, - "id": "d37e33e9", + "id": "0765f90d", "metadata": { "hide-output": false }, @@ -867,7 +867,7 @@ }, { "cell_type": "markdown", - "id": "2addce5d", + "id": "4ae94103", "metadata": {}, "source": [ "## Black-Litterman Recommendation as Regularization\n", @@ -1023,7 +1023,7 @@ }, { "cell_type": "markdown", - "id": "c0269209", + "id": "76dce325", "metadata": {}, "source": [ "## A Robust Control Operator\n", @@ -1163,7 +1163,7 @@ }, { "cell_type": "markdown", - "id": "510c397d", + "id": "e7340952", "metadata": {}, "source": [ "## A Robust Mean-Variance Portfolio Model\n", @@ -1234,7 +1234,7 @@ }, { "cell_type": "markdown", - "id": "b896688f", + "id": "e4d3415c", "metadata": {}, "source": [ "## Appendix\n", @@ -1310,7 +1310,7 @@ }, { "cell_type": "markdown", - "id": "56db4922", + "id": "7185307d", "metadata": {}, "source": [ "## Special Case – IID Sample\n", @@ -1353,7 +1353,7 @@ }, { "cell_type": "markdown", - "id": "9353a4b3", + "id": "094dc26a", "metadata": {}, "source": [ "## Dependence and Sampling Frequency\n", @@ -1418,7 +1418,7 @@ { "cell_type": "code", "execution_count": null, - "id": "79cb2388", + "id": "f21e80d6", "metadata": { "hide-output": false }, @@ -1449,7 +1449,7 @@ }, { "cell_type": "markdown", - "id": "27afbc27", + "id": "2ee5d755", "metadata": {}, "source": [ "## Frequency and the Mean Estimator\n", @@ -1531,7 +1531,7 @@ { "cell_type": "code", "execution_count": null, - "id": "e268e534", + "id": "3ea371a1", "metadata": { "hide-output": false }, @@ -1559,7 +1559,7 @@ { "cell_type": "code", "execution_count": null, - "id": "6e210ef2", + "id": "0d916246", "metadata": { "hide-output": false }, @@ -1605,7 +1605,7 @@ }, { "cell_type": "markdown", - "id": "075d6f7a", + "id": "00946a8b", "metadata": {}, "source": [ "The above figure illustrates the relationship between the asymptotic\n", @@ -1623,7 +1623,7 @@ } ], "metadata": { - "date": 1680677524.0314505, + "date": 1685490450.8584445, "filename": "black_litterman.md", "kernelspec": { "display_name": "Python", diff --git a/calvo.ipynb b/calvo.ipynb index d9df109..b9f0c00 100644 --- a/calvo.ipynb +++ b/calvo.ipynb @@ -2,7 +2,7 @@ "cells": [ { "cell_type": "markdown", - "id": "9be97fb2", + "id": "cddd368b", "metadata": {}, "source": [ "\n", @@ -11,7 +11,7 @@ }, { "cell_type": "markdown", - "id": "7953459f", + "id": "6fd5accc", "metadata": {}, "source": [ "# Ramsey Plans, Time Inconsistency, Sustainable Plans\n", @@ -22,7 +22,7 @@ }, { "cell_type": "markdown", - "id": "139fc8ea", + "id": "9a1afa18", "metadata": {}, "source": [ "## Contents\n", @@ -46,7 +46,7 @@ }, { "cell_type": "markdown", - "id": "2e5e418e", + "id": "67c9f50d", "metadata": {}, "source": [ "In addition to what’s in Anaconda, this lecture will need the following libraries:" @@ -55,7 +55,7 @@ { "cell_type": "code", "execution_count": null, - "id": "d250ef6e", + "id": "fe1fb658", "metadata": { "hide-output": false }, @@ -66,7 +66,7 @@ }, { "cell_type": "markdown", - "id": "e3556983", + "id": "86f8b4ce", "metadata": {}, "source": [ "## Overview\n", @@ -116,7 +116,7 @@ { "cell_type": "code", "execution_count": null, - "id": "244b1fef", + "id": "71456c9a", "metadata": { "hide-output": false }, @@ -130,7 +130,7 @@ }, { "cell_type": "markdown", - "id": "a00325ee", + "id": "b444874e", "metadata": {}, "source": [ "## The Model\n", @@ -181,11 +181,11 @@ "\n", "Because $ \\alpha > 0 $, $ 0 < \\frac{\\alpha}{1+\\alpha} < 1 $.\n", "\n", - "**Definition:** For a scalar $ x_t $, let $ L^2 $ be the space of sequences\n", - "$ \\{x_t\\}_{t=0}^\\infty $ satisfying\n", + "**Definition:** For a scalar $ b_t $, let $ L^2 $ be the space of sequences\n", + "$ \\{b_t\\}_{t=0}^\\infty $ satisfying\n", "\n", "$$\n", - "\\sum_{t=0}^\\infty x_t^2 < +\\infty\n", + "\\sum_{t=0}^\\infty b_t^2 < +\\infty\n", "$$\n", "\n", "We say that a sequence that belongs to $ L^2 $ is **square summable**.\n", @@ -312,7 +312,7 @@ }, { "cell_type": "markdown", - "id": "7c5c5aae", + "id": "321f1f64", "metadata": {}, "source": [ "## Structure\n", @@ -347,7 +347,7 @@ }, { "cell_type": "markdown", - "id": "6fdccead", + "id": "823e3bf2", "metadata": {}, "source": [ "## Intertemporal Structure\n", @@ -372,7 +372,7 @@ }, { "cell_type": "markdown", - "id": "36207cc9", + "id": "eceafdd3", "metadata": {}, "source": [ "## Four Models of Government Policy\n", @@ -427,7 +427,7 @@ }, { "cell_type": "markdown", - "id": "9ea5d1bc", + "id": "35eebc3f", "metadata": {}, "source": [ "## A Ramsey Planner\n", @@ -454,7 +454,7 @@ }, { "cell_type": "markdown", - "id": "9b73b187", + "id": "a60fc44c", "metadata": {}, "source": [ "### Subproblem 1\n", @@ -505,7 +505,7 @@ }, { "cell_type": "markdown", - "id": "0412aa61", + "id": "749acd42", "metadata": {}, "source": [ "### Subproblem 2\n", @@ -539,7 +539,7 @@ }, { "cell_type": "markdown", - "id": "1e58da40", + "id": "ad6d8326", "metadata": {}, "source": [ "### Representation of Ramsey Plan\n", @@ -578,7 +578,7 @@ }, { "cell_type": "markdown", - "id": "5f85166d", + "id": "2d415afa", "metadata": {}, "source": [ "### Multiple roles of $ \\theta_t $\n", @@ -600,7 +600,7 @@ }, { "cell_type": "markdown", - "id": "26676f63", + "id": "ed4dfe37", "metadata": {}, "source": [ "### Time Inconsistency\n", @@ -618,7 +618,7 @@ }, { "cell_type": "markdown", - "id": "61b06221", + "id": "7481f6a1", "metadata": {}, "source": [ "## A Constrained-to-a-Constant-Growth-Rate Ramsey Government\n", @@ -654,7 +654,7 @@ }, { "cell_type": "markdown", - "id": "3afec3c1", + "id": "084559d6", "metadata": {}, "source": [ "## Markov Perfect Governments\n", @@ -721,7 +721,7 @@ }, { "cell_type": "markdown", - "id": "6add7480", + "id": "46d41641", "metadata": {}, "source": [ "## Outcomes under Three Timing Protocols\n", @@ -743,7 +743,7 @@ { "cell_type": "code", "execution_count": null, - "id": "0098a878", + "id": "9ca09fb1", "metadata": { "hide-output": false }, @@ -850,7 +850,7 @@ }, { "cell_type": "markdown", - "id": "cc8d78b2", + "id": "c5fff618", "metadata": {}, "source": [ "We will create an instance of ChangLQ with the following parameters" @@ -859,7 +859,7 @@ { "cell_type": "code", "execution_count": null, - "id": "4d280404", + "id": "1788236b", "metadata": { "hide-output": false }, @@ -871,7 +871,7 @@ }, { "cell_type": "markdown", - "id": "40c893f1", + "id": "5188cf28", "metadata": {}, "source": [ "The following code generates a figure that plots the value function from the Ramsey Planner’s\n", @@ -883,7 +883,7 @@ { "cell_type": "code", "execution_count": null, - "id": "39a33d71", + "id": "0cf0d65b", "metadata": { "hide-output": false }, @@ -928,7 +928,7 @@ }, { "cell_type": "markdown", - "id": "402e1079", + "id": "202d6510", "metadata": {}, "source": [ "The next code generates a figure that plots the value function from the Ramsey Planner’s\n", @@ -939,7 +939,7 @@ { "cell_type": "code", "execution_count": null, - "id": "396f47b9", + "id": "bd53b865", "metadata": { "hide-output": false }, @@ -985,7 +985,7 @@ }, { "cell_type": "markdown", - "id": "918dbc76", + "id": "12d8de32", "metadata": {}, "source": [ "The next code generates figures that plot the policy functions for a continuation Ramsey\n", @@ -1001,7 +1001,7 @@ { "cell_type": "code", "execution_count": null, - "id": "38859a12", + "id": "87825a90", "metadata": { "hide-output": false }, @@ -1062,7 +1062,7 @@ }, { "cell_type": "markdown", - "id": "074fc2ca", + "id": "83768c45", "metadata": {}, "source": [ "The following code generates a figure that plots sequences of $ \\mu $ and $ \\theta $\n", @@ -1074,7 +1074,7 @@ { "cell_type": "code", "execution_count": null, - "id": "466a3825", + "id": "d8c9ae46", "metadata": { "hide-output": false }, @@ -1110,7 +1110,7 @@ }, { "cell_type": "markdown", - "id": "3cd3d0f6", + "id": "e01d5e75", "metadata": {}, "source": [ "### Time Inconsistency of Ramsey Plan\n", @@ -1135,7 +1135,7 @@ }, { "cell_type": "markdown", - "id": "8985ef85", + "id": "b20060c4", "metadata": {}, "source": [ "### Meaning of Time Inconsistency\n", @@ -1159,7 +1159,7 @@ }, { "cell_type": "markdown", - "id": "892bdaf0", + "id": "17a5c186", "metadata": {}, "source": [ "### Ramsey Plans Strike Back\n", @@ -1176,7 +1176,7 @@ }, { "cell_type": "markdown", - "id": "9451d01d", + "id": "64dc9582", "metadata": {}, "source": [ "## A Fourth Model of Government Decision Making\n", @@ -1198,7 +1198,7 @@ }, { "cell_type": "markdown", - "id": "5e8a5569", + "id": "8beae558", "metadata": {}, "source": [ "### A Theory of Government Decision Making\n", @@ -1234,7 +1234,7 @@ }, { "cell_type": "markdown", - "id": "69c856b4", + "id": "1c319124", "metadata": {}, "source": [ "### Temptation to Deviate from Plan\n", @@ -1266,7 +1266,7 @@ }, { "cell_type": "markdown", - "id": "46d08c02", + "id": "a9ce3bba", "metadata": {}, "source": [ "## Sustainable or Credible Plan\n", @@ -1309,7 +1309,7 @@ }, { "cell_type": "markdown", - "id": "3b4be6b9", + "id": "ca5aefac", "metadata": {}, "source": [ "### Abreu’s Self-Enforcing Plan\n", @@ -1381,7 +1381,7 @@ }, { "cell_type": "markdown", - "id": "cf6e4572", + "id": "7b34eff2", "metadata": {}, "source": [ "### Abreu Carrot-Stick Plan\n", @@ -1423,7 +1423,7 @@ }, { "cell_type": "markdown", - "id": "d70775bc", + "id": "43bd2b53", "metadata": {}, "source": [ "### Example of Self-Enforcing Plan\n", @@ -1452,7 +1452,7 @@ { "cell_type": "code", "execution_count": null, - "id": "b979acbb", + "id": "3f6fb9e2", "metadata": { "hide-output": false }, @@ -1509,7 +1509,7 @@ }, { "cell_type": "markdown", - "id": "00f0a063", + "id": "c0cf464f", "metadata": {}, "source": [ "To confirm that the plan $ \\vec \\mu^A $ is **self-enforcing**, we\n", @@ -1532,7 +1532,7 @@ { "cell_type": "code", "execution_count": null, - "id": "34ed43ac", + "id": "0546b2c7", "metadata": { "hide-output": false }, @@ -1543,7 +1543,7 @@ }, { "cell_type": "markdown", - "id": "f5c9a142", + "id": "04e99dd3", "metadata": {}, "source": [ "Given that plan $ \\vec \\mu^A $ is self-enforcing, we can check that\n", @@ -1557,7 +1557,7 @@ { "cell_type": "code", "execution_count": null, - "id": "f066a30d", + "id": "848932c9", "metadata": { "hide-output": false }, @@ -1578,7 +1578,7 @@ }, { "cell_type": "markdown", - "id": "ab84323c", + "id": "f851ac77", "metadata": {}, "source": [ "### Recursive Representation of a Sustainable Plan\n", @@ -1615,7 +1615,7 @@ }, { "cell_type": "markdown", - "id": "cc69ce92", + "id": "55722179", "metadata": {}, "source": [ "## Whose Credible Plan is it?\n", @@ -1638,7 +1638,7 @@ }, { "cell_type": "markdown", - "id": "da7760f6", + "id": "3910163c", "metadata": {}, "source": [ "## Comparison of Equilibrium Values\n", @@ -1663,7 +1663,7 @@ { "cell_type": "code", "execution_count": null, - "id": "075b3e9b", + "id": "ca60845d", "metadata": { "hide-output": false }, @@ -1675,7 +1675,7 @@ { "cell_type": "code", "execution_count": null, - "id": "1dc55f72", + "id": "d0a38ecf", "metadata": { "hide-output": false }, @@ -1687,7 +1687,7 @@ { "cell_type": "code", "execution_count": null, - "id": "83e1b190", + "id": "3148d0fb", "metadata": { "hide-output": false }, @@ -1698,7 +1698,7 @@ }, { "cell_type": "markdown", - "id": "1b4f8c68", + "id": "fd415b24", "metadata": {}, "source": [ "We have also computed **credible plans** for a government or sequence\n", @@ -1713,7 +1713,7 @@ }, { "cell_type": "markdown", - "id": "1de07cff", + "id": "6f6030c5", "metadata": {}, "source": [ "## Note on Dynamic Programming Squared\n", @@ -1735,7 +1735,7 @@ } ], "metadata": { - "date": 1680677524.1368499, + "date": 1685490451.1258068, "filename": "calvo.md", "kernelspec": { "display_name": "Python", diff --git a/cattle_cycles.ipynb b/cattle_cycles.ipynb index 232b8c5..769b5c7 100644 --- a/cattle_cycles.ipynb +++ b/cattle_cycles.ipynb @@ -2,7 +2,7 @@ "cells": [ { "cell_type": "markdown", - "id": "efcb2a46", + "id": "2f2e8748", "metadata": {}, "source": [ "\n", @@ -13,7 +13,7 @@ }, { "cell_type": "markdown", - "id": "e4eeef3f", + "id": "2bec4a7e", "metadata": {}, "source": [ "# Cattle Cycles" @@ -21,7 +21,7 @@ }, { "cell_type": "markdown", - "id": "8e93f3c0", + "id": "e16a43c3", "metadata": {}, "source": [ "## Contents\n", @@ -33,7 +33,7 @@ }, { "cell_type": "markdown", - "id": "4b07071c", + "id": "3a65f24f", "metadata": {}, "source": [ "This is another member of a suite of lectures that use the quantecon DLE class to instantiate models within the\n", @@ -45,7 +45,7 @@ { "cell_type": "code", "execution_count": null, - "id": "61e497a6", + "id": "a218abc2", "metadata": { "hide-output": false }, @@ -56,7 +56,7 @@ }, { "cell_type": "markdown", - "id": "bfdef01a", + "id": "3b4ddfc3", "metadata": {}, "source": [ "This lecture uses the DLE class to construct instances of the “Cattle Cycles” model\n", @@ -71,7 +71,7 @@ { "cell_type": "code", "execution_count": null, - "id": "9b83a067", + "id": "580b231f", "metadata": { "hide-output": false }, @@ -88,7 +88,7 @@ }, { "cell_type": "markdown", - "id": "c254f1f0", + "id": "92687121", "metadata": {}, "source": [ "## The Model\n", @@ -150,7 +150,7 @@ }, { "cell_type": "markdown", - "id": "1ff0888b", + "id": "e3047b8d", "metadata": {}, "source": [ "## Mapping into HS2013 Framework" @@ -158,7 +158,7 @@ }, { "cell_type": "markdown", - "id": "d1387e6c", + "id": "7afe05ab", "metadata": {}, "source": [ "### Preferences\n", @@ -173,7 +173,7 @@ }, { "cell_type": "markdown", - "id": "3031323b", + "id": "1cda90eb", "metadata": {}, "source": [ "### Technology\n", @@ -223,7 +223,7 @@ }, { "cell_type": "markdown", - "id": "9c996c79", + "id": "e2858367", "metadata": {}, "source": [ "### Information\n", @@ -262,7 +262,7 @@ { "cell_type": "code", "execution_count": null, - "id": "764867af", + "id": "7612f189", "metadata": { "hide-output": false }, @@ -278,7 +278,7 @@ }, { "cell_type": "markdown", - "id": "6b61996a", + "id": "61054bbf", "metadata": {}, "source": [ "We set parameters to those used by [[RMS94](https://python-advanced.quantecon.org/zreferences.html#id70)]" @@ -287,7 +287,7 @@ { "cell_type": "code", "execution_count": null, - "id": "7e8e116c", + "id": "fa916352", "metadata": { "hide-output": false }, @@ -361,7 +361,7 @@ }, { "cell_type": "markdown", - "id": "efa44727", + "id": "f39a6f98", "metadata": {}, "source": [ "Notice that we have set $ \\rho_1 = \\rho_2 = 0 $, so $ h_t $ and\n", @@ -378,7 +378,7 @@ { "cell_type": "code", "execution_count": null, - "id": "a1907261", + "id": "c5231265", "metadata": { "hide-output": false }, @@ -411,7 +411,7 @@ { "cell_type": "code", "execution_count": null, - "id": "8ea5b5ba", + "id": "0e57b0ca", "metadata": { "hide-output": false }, @@ -430,7 +430,7 @@ { "cell_type": "code", "execution_count": null, - "id": "94d5cd23", + "id": "190ea7a7", "metadata": { "hide-output": false }, @@ -441,7 +441,7 @@ }, { "cell_type": "markdown", - "id": "f9978496", + "id": "d32c4131", "metadata": {}, "source": [ "[[RMS94](https://python-advanced.quantecon.org/zreferences.html#id70)] use the model to understand the\n", @@ -454,7 +454,7 @@ { "cell_type": "code", "execution_count": null, - "id": "a27784e0", + "id": "5febc460", "metadata": { "hide-output": false }, @@ -471,7 +471,7 @@ }, { "cell_type": "markdown", - "id": "378f2f38", + "id": "2b000a06", "metadata": {}, "source": [ "In their Figure 3, [[RMS94](https://python-advanced.quantecon.org/zreferences.html#id70)] plot the impulse response functions\n", @@ -484,7 +484,7 @@ { "cell_type": "code", "execution_count": null, - "id": "2e4c1f90", + "id": "98faf3e7", "metadata": { "hide-output": false }, @@ -513,7 +513,7 @@ }, { "cell_type": "markdown", - "id": "cb7e0ee5", + "id": "b75df70e", "metadata": {}, "source": [ "The above figures show how consumption patterns differ markedly,\n", @@ -536,7 +536,7 @@ { "cell_type": "code", "execution_count": null, - "id": "7c97bbe1", + "id": "cc3685e8", "metadata": { "hide-output": false }, @@ -558,7 +558,7 @@ }, { "cell_type": "markdown", - "id": "afb0164d", + "id": "09567f32", "metadata": {}, "source": [ "The fact that $ y_t $ is a weighted moving average of $ x_t $\n", @@ -569,7 +569,7 @@ } ], "metadata": { - "date": 1680677524.1644647, + "date": 1685490451.1539695, "filename": "cattle_cycles.md", "kernelspec": { "display_name": "Python", diff --git a/chang_credible.ipynb b/chang_credible.ipynb index cecf1de..383e043 100644 --- a/chang_credible.ipynb +++ b/chang_credible.ipynb @@ -2,7 +2,7 @@ "cells": [ { "cell_type": "markdown", - "id": "2316a8fe", + "id": "90531a2d", "metadata": {}, "source": [ "\n", @@ -11,7 +11,7 @@ }, { "cell_type": "markdown", - "id": "cf90adf0", + "id": "fa4aa109", "metadata": {}, "source": [ "# Credible Government Policies in a Model of Chang" @@ -19,7 +19,7 @@ }, { "cell_type": "markdown", - "id": "af26a123", + "id": "7fbf2757", "metadata": {}, "source": [ "## Contents\n", @@ -32,7 +32,7 @@ }, { "cell_type": "markdown", - "id": "bc1149d1", + "id": "241a791b", "metadata": {}, "source": [ "In addition to what’s in Anaconda, this lecture will need the following libraries:" @@ -41,7 +41,7 @@ { "cell_type": "code", "execution_count": null, - "id": "994182fd", + "id": "75791d42", "metadata": { "hide-output": false }, @@ -52,7 +52,7 @@ }, { "cell_type": "markdown", - "id": "2f1107b5", + "id": "a91197c0", "metadata": {}, "source": [ "## Overview\n", @@ -111,7 +111,7 @@ { "cell_type": "code", "execution_count": null, - "id": "9ff880e6", + "id": "576a3d3c", "metadata": { "hide-output": false }, @@ -126,7 +126,7 @@ }, { "cell_type": "markdown", - "id": "9e8a83fc", + "id": "daeb6a4b", "metadata": {}, "source": [ "## The Setting\n", @@ -181,7 +181,7 @@ }, { "cell_type": "markdown", - "id": "ed9b60cb", + "id": "43b36636", "metadata": {}, "source": [ "### The Household’s Problem\n", @@ -242,7 +242,7 @@ }, { "cell_type": "markdown", - "id": "7d9b69ce", + "id": "bf5ebfb3", "metadata": {}, "source": [ "### Government\n", @@ -301,7 +301,7 @@ }, { "cell_type": "markdown", - "id": "6d7da1f7", + "id": "71852d87", "metadata": {}, "source": [ "### Within-period Timing Protocol\n", @@ -331,7 +331,7 @@ }, { "cell_type": "markdown", - "id": "8e1667bb", + "id": "a4fb3b32", "metadata": {}, "source": [ "### Household’s Problem\n", @@ -398,7 +398,7 @@ }, { "cell_type": "markdown", - "id": "cb5530f5", + "id": "372dff0a", "metadata": {}, "source": [ "### Competitive Equilibrium\n", @@ -424,7 +424,7 @@ }, { "cell_type": "markdown", - "id": "d39ae8fa", + "id": "87c35a02", "metadata": {}, "source": [ "### A Credible Government Policy\n", @@ -507,7 +507,7 @@ }, { "cell_type": "markdown", - "id": "11d420b5", + "id": "a3e3370f", "metadata": {}, "source": [ "### Sustainable Plans\n", @@ -684,7 +684,7 @@ }, { "cell_type": "markdown", - "id": "32f7ee76", + "id": "88d3cacd", "metadata": {}, "source": [ "## Calculating the Set of Sustainable Promise-Value Pairs\n", @@ -900,7 +900,7 @@ { "cell_type": "code", "execution_count": null, - "id": "9f335d5e", + "id": "8b2d9678", "metadata": { "hide-output": false }, @@ -1408,7 +1408,7 @@ }, { "cell_type": "markdown", - "id": "61bf3c17", + "id": "8c959e9f", "metadata": {}, "source": [ "### Comparison of Sets\n", @@ -1423,7 +1423,7 @@ { "cell_type": "code", "execution_count": null, - "id": "da8eb921", + "id": "42b0562d", "metadata": { "hide-output": false }, @@ -1435,7 +1435,7 @@ { "cell_type": "code", "execution_count": null, - "id": "6946afa5", + "id": "3b25bc7f", "metadata": { "hide-output": false }, @@ -1446,7 +1446,7 @@ }, { "cell_type": "markdown", - "id": "9e124b8e", + "id": "53097b74", "metadata": {}, "source": [ "The following plot shows both the set of $ w,\\theta $ pairs associated with competitive equilibria (in red)\n", @@ -1456,7 +1456,7 @@ { "cell_type": "code", "execution_count": null, - "id": "f45ad2e5", + "id": "eecaebb4", "metadata": { "hide-output": false }, @@ -1498,7 +1498,7 @@ }, { "cell_type": "markdown", - "id": "3589e8a9", + "id": "acc1ef86", "metadata": {}, "source": [ "Evidently, the Ramsey plan, denoted by the $ R $, is not sustainable.\n", @@ -1509,7 +1509,7 @@ { "cell_type": "code", "execution_count": null, - "id": "e586100b", + "id": "95a623cb", "metadata": { "hide-output": false }, @@ -1522,7 +1522,7 @@ { "cell_type": "code", "execution_count": null, - "id": "af15a272", + "id": "1ad1210e", "metadata": { "hide-output": false }, @@ -1533,7 +1533,7 @@ }, { "cell_type": "markdown", - "id": "520e5503", + "id": "e4f12369", "metadata": {}, "source": [ "Let’s plot both sets" @@ -1542,7 +1542,7 @@ { "cell_type": "code", "execution_count": null, - "id": "d85ba50b", + "id": "fab78dc2", "metadata": { "hide-output": false }, @@ -1553,7 +1553,7 @@ }, { "cell_type": "markdown", - "id": "8234d147", + "id": "50ce7803", "metadata": {}, "source": [ "Evidently, the Ramsey plan is now sustainable." @@ -1561,7 +1561,7 @@ } ], "metadata": { - "date": 1680677524.22787, + "date": 1685490451.2194736, "filename": "chang_credible.md", "kernelspec": { "display_name": "Python", diff --git a/chang_ramsey.ipynb b/chang_ramsey.ipynb index 2265b14..82f10d2 100644 --- a/chang_ramsey.ipynb +++ b/chang_ramsey.ipynb @@ -2,7 +2,7 @@ "cells": [ { "cell_type": "markdown", - "id": "792cd219", + "id": "c637b47d", "metadata": {}, "source": [ "\n", @@ -11,7 +11,7 @@ }, { "cell_type": "markdown", - "id": "a111da10", + "id": "448b3ffc", "metadata": {}, "source": [ "# Competitive Equilibria of a Model of Chang" @@ -19,7 +19,7 @@ }, { "cell_type": "markdown", - "id": "4ff4af78", + "id": "5a2d2f70", "metadata": {}, "source": [ "## Contents\n", @@ -36,7 +36,7 @@ }, { "cell_type": "markdown", - "id": "f19138a5", + "id": "ebf224f3", "metadata": {}, "source": [ "In addition to what’s in Anaconda, this lecture will need the following libraries:" @@ -45,7 +45,7 @@ { "cell_type": "code", "execution_count": null, - "id": "ccd27e1d", + "id": "c9f8cbfa", "metadata": { "hide-output": false }, @@ -56,7 +56,7 @@ }, { "cell_type": "markdown", - "id": "1c516bfd", + "id": "1e4a1a34", "metadata": {}, "source": [ "## Overview\n", @@ -104,7 +104,7 @@ { "cell_type": "code", "execution_count": null, - "id": "e56ec5f6", + "id": "4d2cc741", "metadata": { "hide-output": false }, @@ -119,7 +119,7 @@ }, { "cell_type": "markdown", - "id": "f931f500", + "id": "7b5493d1", "metadata": {}, "source": [ "### The Setting\n", @@ -177,7 +177,7 @@ }, { "cell_type": "markdown", - "id": "3e9d06eb", + "id": "3a1a4535", "metadata": {}, "source": [ "## Setting" @@ -185,7 +185,7 @@ }, { "cell_type": "markdown", - "id": "33002c3a", + "id": "cd0acad7", "metadata": {}, "source": [ "### The Household’s Problem\n", @@ -246,7 +246,7 @@ }, { "cell_type": "markdown", - "id": "bb739c2f", + "id": "b7ce87a0", "metadata": {}, "source": [ "### Government\n", @@ -338,7 +338,7 @@ }, { "cell_type": "markdown", - "id": "7dfc5301", + "id": "5fc6bc80", "metadata": {}, "source": [ "### Household’s Problem\n", @@ -410,7 +410,7 @@ }, { "cell_type": "markdown", - "id": "2321e225", + "id": "e5f4cc21", "metadata": {}, "source": [ "## Competitive Equilibrium\n", @@ -436,7 +436,7 @@ }, { "cell_type": "markdown", - "id": "32433359", + "id": "0c247e15", "metadata": {}, "source": [ "## Inventory of Objects in Play\n", @@ -495,7 +495,7 @@ }, { "cell_type": "markdown", - "id": "4d1eaa93", + "id": "679f7715", "metadata": {}, "source": [ "## Analysis\n", @@ -669,7 +669,7 @@ }, { "cell_type": "markdown", - "id": "f23949c9", + "id": "6f9181b3", "metadata": {}, "source": [ "### Some Useful Notation\n", @@ -736,7 +736,7 @@ }, { "cell_type": "markdown", - "id": "36ba2cba", + "id": "0d892ad8", "metadata": {}, "source": [ "### Another Operator\n", @@ -838,7 +838,7 @@ }, { "cell_type": "markdown", - "id": "c016c1b5", + "id": "c6d70401", "metadata": {}, "source": [ "## Calculating all Promise-Value Pairs in CE\n", @@ -991,7 +991,7 @@ { "cell_type": "code", "execution_count": null, - "id": "ad89930a", + "id": "3a862904", "metadata": { "hide-output": false }, @@ -1500,7 +1500,7 @@ { "cell_type": "code", "execution_count": null, - "id": "ec101f87", + "id": "0673e558", "metadata": { "hide-output": false }, @@ -1513,7 +1513,7 @@ { "cell_type": "code", "execution_count": null, - "id": "60b6542c", + "id": "1f7b6335", "metadata": { "hide-output": false }, @@ -1554,7 +1554,7 @@ { "cell_type": "code", "execution_count": null, - "id": "ea719b89", + "id": "110f1b15", "metadata": { "hide-output": false }, @@ -1568,7 +1568,7 @@ { "cell_type": "code", "execution_count": null, - "id": "b8fa9721", + "id": "c80109f4", "metadata": { "hide-output": false }, @@ -1579,7 +1579,7 @@ }, { "cell_type": "markdown", - "id": "5d8d2132", + "id": "6cc65e37", "metadata": {}, "source": [ "## Solving a Continuation Ramsey Planner’s Bellman Equation\n", @@ -1640,7 +1640,7 @@ { "cell_type": "code", "execution_count": null, - "id": "f0b3ce8b", + "id": "a6ced0c7", "metadata": { "hide-output": false }, @@ -1655,7 +1655,7 @@ { "cell_type": "code", "execution_count": null, - "id": "b44bcfa0", + "id": "720bf017", "metadata": { "hide-output": false }, @@ -1667,7 +1667,7 @@ }, { "cell_type": "markdown", - "id": "22a347d6", + "id": "f6be9744", "metadata": {}, "source": [ "First, a quick check that our approximations of the value functions are\n", @@ -1679,7 +1679,7 @@ { "cell_type": "code", "execution_count": null, - "id": "d2fe693d", + "id": "abe5993d", "metadata": { "hide-output": false }, @@ -1690,7 +1690,7 @@ }, { "cell_type": "markdown", - "id": "96226e7c", + "id": "78ae241d", "metadata": {}, "source": [ "The value functions plotted below trace out the right edges of the sets\n", @@ -1700,7 +1700,7 @@ { "cell_type": "code", "execution_count": null, - "id": "fd022afd", + "id": "b06389ce", "metadata": { "hide-output": false }, @@ -1719,7 +1719,7 @@ }, { "cell_type": "markdown", - "id": "d3f4bea8", + "id": "18536c4e", "metadata": {}, "source": [ "The next figure plots the optimal policy functions; values of\n", @@ -1729,7 +1729,7 @@ { "cell_type": "code", "execution_count": null, - "id": "63f314e4", + "id": "838a7f5d", "metadata": { "hide-output": false }, @@ -1754,7 +1754,7 @@ }, { "cell_type": "markdown", - "id": "5f28af12", + "id": "de833d91", "metadata": {}, "source": [ "With the first set of parameter values, the value of $ \\theta' $ chosen by the Ramsey\n", @@ -1775,7 +1775,7 @@ { "cell_type": "code", "execution_count": null, - "id": "479b0f34", + "id": "c5613b2b", "metadata": { "hide-output": false }, @@ -1794,7 +1794,7 @@ }, { "cell_type": "markdown", - "id": "3cce09a7", + "id": "4e970ea5", "metadata": {}, "source": [ "Subproblem 2 is equivalent to the planner choosing the initial value of\n", @@ -1810,7 +1810,7 @@ { "cell_type": "code", "execution_count": null, - "id": "8d96e53f", + "id": "c1b7f2da", "metadata": { "hide-output": false }, @@ -1833,7 +1833,7 @@ }, { "cell_type": "markdown", - "id": "1703c3e5", + "id": "6d2fd339", "metadata": {}, "source": [ "### Next Steps\n", @@ -1849,7 +1849,7 @@ } ], "metadata": { - "date": 1680677524.3144863, + "date": 1685490451.3060262, "filename": "chang_ramsey.md", "kernelspec": { "display_name": "Python", diff --git a/classical_filtering.ipynb b/classical_filtering.ipynb index bcca85a..ed07b2c 100644 --- a/classical_filtering.ipynb +++ b/classical_filtering.ipynb @@ -2,7 +2,7 @@ "cells": [ { "cell_type": "markdown", - "id": "eb8b41f4", + "id": "a19345bd", "metadata": {}, "source": [ "\n", @@ -11,7 +11,7 @@ }, { "cell_type": "markdown", - "id": "fde30b06", + "id": "f919c9c3", "metadata": {}, "source": [ "# Classical Prediction and Filtering With Linear Algebra" @@ -19,7 +19,7 @@ }, { "cell_type": "markdown", - "id": "9adb48cb", + "id": "7e60d61c", "metadata": {}, "source": [ "## Contents\n", @@ -34,7 +34,7 @@ }, { "cell_type": "markdown", - "id": "547fa1db", + "id": "01ca56f6", "metadata": {}, "source": [ "## Overview\n", @@ -87,7 +87,7 @@ { "cell_type": "code", "execution_count": null, - "id": "d9197e1f", + "id": "2c03bb06", "metadata": { "hide-output": false }, @@ -98,7 +98,7 @@ }, { "cell_type": "markdown", - "id": "b29752ba", + "id": "1c36e6e2", "metadata": {}, "source": [ "### References\n", @@ -108,7 +108,7 @@ }, { "cell_type": "markdown", - "id": "af12fcef", + "id": "8e86fa27", "metadata": {}, "source": [ "## Finite Dimensional Prediction\n", @@ -260,7 +260,7 @@ }, { "cell_type": "markdown", - "id": "76eeddc9", + "id": "bc89ab56", "metadata": {}, "source": [ "### Implementation\n", @@ -271,7 +271,7 @@ { "cell_type": "code", "execution_count": null, - "id": "203e5d07", + "id": "0e7837f4", "metadata": { "hide-output": false }, @@ -587,7 +587,7 @@ }, { "cell_type": "markdown", - "id": "bf200a20", + "id": "b39ecf17", "metadata": {}, "source": [ "Let’s use this code to tackle two interesting examples." @@ -595,7 +595,7 @@ }, { "cell_type": "markdown", - "id": "3e750646", + "id": "585cf286", "metadata": {}, "source": [ "### Example 1\n", @@ -618,7 +618,7 @@ { "cell_type": "code", "execution_count": null, - "id": "83cc393d", + "id": "0558bd1a", "metadata": { "hide-output": false }, @@ -634,7 +634,7 @@ }, { "cell_type": "markdown", - "id": "371ea6e6", + "id": "45862974", "metadata": {}, "source": [ "The Wold representation is computed by `example.coeffs_of_c()`.\n", @@ -645,7 +645,7 @@ { "cell_type": "code", "execution_count": null, - "id": "bbf52187", + "id": "3eb357cc", "metadata": { "hide-output": false }, @@ -657,7 +657,7 @@ { "cell_type": "code", "execution_count": null, - "id": "8b256f79", + "id": "7f60b34c", "metadata": { "hide-output": false }, @@ -668,7 +668,7 @@ }, { "cell_type": "markdown", - "id": "5c75500d", + "id": "d7b5a9ac", "metadata": {}, "source": [ "Now let’s form the covariance matrix of a time series vector of length $ N $\n", @@ -681,7 +681,7 @@ { "cell_type": "code", "execution_count": null, - "id": "ab3277bb", + "id": "502e2ed6", "metadata": { "hide-output": false }, @@ -693,7 +693,7 @@ }, { "cell_type": "markdown", - "id": "4e373c21", + "id": "1c89ceb4", "metadata": {}, "source": [ "Notice how the lower rows of the “moving average representations” are converging to the appropriate infinite history Wold representation\n", @@ -703,7 +703,7 @@ { "cell_type": "code", "execution_count": null, - "id": "39ef1abc", + "id": "a571d60b", "metadata": { "hide-output": false }, @@ -715,7 +715,7 @@ }, { "cell_type": "markdown", - "id": "02b059f0", + "id": "ad388524", "metadata": {}, "source": [ "Notice how the lower rows of the “autoregressive representations” are converging to the appropriate infinite-history\n", @@ -725,7 +725,7 @@ { "cell_type": "code", "execution_count": null, - "id": "7999e4e4", + "id": "ec300abe", "metadata": { "hide-output": false }, @@ -737,7 +737,7 @@ }, { "cell_type": "markdown", - "id": "e9ecb0ae", + "id": "a3b98313", "metadata": {}, "source": [ "### Example 2\n", @@ -764,7 +764,7 @@ { "cell_type": "code", "execution_count": null, - "id": "8c371256", + "id": "d0110d79", "metadata": { "hide-output": false }, @@ -782,7 +782,7 @@ { "cell_type": "code", "execution_count": null, - "id": "0c4401a8", + "id": "35c53ccd", "metadata": { "hide-output": false }, @@ -794,7 +794,7 @@ { "cell_type": "code", "execution_count": null, - "id": "d48632df", + "id": "634fe24d", "metadata": { "hide-output": false }, @@ -807,7 +807,7 @@ { "cell_type": "code", "execution_count": null, - "id": "dc93af90", + "id": "b36a9485", "metadata": { "hide-output": false }, @@ -820,7 +820,7 @@ { "cell_type": "code", "execution_count": null, - "id": "4757671e", + "id": "2cffa0be", "metadata": { "hide-output": false }, @@ -832,7 +832,7 @@ }, { "cell_type": "markdown", - "id": "f5798b1e", + "id": "4f49c18f", "metadata": {}, "source": [ "### Prediction\n", @@ -914,7 +914,7 @@ }, { "cell_type": "markdown", - "id": "a386b15f", + "id": "b0332d6e", "metadata": {}, "source": [ "## Combined Finite Dimensional Control and Prediction\n", @@ -1002,7 +1002,7 @@ }, { "cell_type": "markdown", - "id": "0c3e275b", + "id": "8686fc12", "metadata": {}, "source": [ "## Infinite Horizon Prediction and Filtering Problems\n", @@ -1068,7 +1068,7 @@ }, { "cell_type": "markdown", - "id": "421fe385", + "id": "3b70ce7e", "metadata": {}, "source": [ "### Problem Formulation\n", @@ -1448,7 +1448,7 @@ }, { "cell_type": "markdown", - "id": "f4dff48c", + "id": "79b03efa", "metadata": {}, "source": [ "## Exercises" @@ -1456,7 +1456,7 @@ }, { "cell_type": "markdown", - "id": "4996d988", + "id": "ab7fa290", "metadata": {}, "source": [ "## Exercise 32.1\n", @@ -1491,7 +1491,7 @@ }, { "cell_type": "markdown", - "id": "16b38e80", + "id": "a99c6b35", "metadata": {}, "source": [ "## Exercise 32.2\n", @@ -1571,7 +1571,7 @@ } ], "metadata": { - "date": 1680677524.3873453, + "date": 1685490451.3799813, "filename": "classical_filtering.md", "kernelspec": { "display_name": "Python", diff --git a/coase.ipynb b/coase.ipynb index 7ab0c5f..9cfec24 100644 --- a/coase.ipynb +++ b/coase.ipynb @@ -2,7 +2,7 @@ "cells": [ { "cell_type": "markdown", - "id": "06430654", + "id": "521486eb", "metadata": {}, "source": [ "\n", @@ -11,7 +11,7 @@ }, { "cell_type": "markdown", - "id": "5f04c55d", + "id": "9270a698", "metadata": {}, "source": [ "# Coase’s Theory of the Firm" @@ -19,7 +19,7 @@ }, { "cell_type": "markdown", - "id": "df4038c9", + "id": "f640c0b4", "metadata": {}, "source": [ "## Contents\n", @@ -35,7 +35,7 @@ }, { "cell_type": "markdown", - "id": "8cab7335", + "id": "cdfbdde1", "metadata": {}, "source": [ "In addition to what’s in Anaconda, this lecture will need the following libraries:" @@ -44,7 +44,7 @@ { "cell_type": "code", "execution_count": null, - "id": "f662a2b8", + "id": "61653ff7", "metadata": { "hide-output": false }, @@ -55,7 +55,7 @@ }, { "cell_type": "markdown", - "id": "5c8a5bb9", + "id": "6a899475", "metadata": {}, "source": [ "## Overview\n", @@ -86,7 +86,7 @@ { "cell_type": "code", "execution_count": null, - "id": "691359dd", + "id": "683ea44d", "metadata": { "hide-output": false }, @@ -101,7 +101,7 @@ }, { "cell_type": "markdown", - "id": "069da296", + "id": "850266ce", "metadata": {}, "source": [ "### Why Firms Exist\n", @@ -134,7 +134,7 @@ }, { "cell_type": "markdown", - "id": "cabe5aab", + "id": "c1994dd4", "metadata": {}, "source": [ "### A Trade-Off\n", @@ -171,7 +171,7 @@ }, { "cell_type": "markdown", - "id": "43f24908", + "id": "54fa3897", "metadata": {}, "source": [ "### Summary\n", @@ -185,7 +185,7 @@ }, { "cell_type": "markdown", - "id": "a3f86e7d", + "id": "e3fba190", "metadata": {}, "source": [ "### A Quantitative Interpretation\n", @@ -203,7 +203,7 @@ }, { "cell_type": "markdown", - "id": "bb436677", + "id": "3e87e3d4", "metadata": {}, "source": [ "## The Model\n", @@ -219,7 +219,7 @@ }, { "cell_type": "markdown", - "id": "f2f7218d", + "id": "8ba4eabe", "metadata": {}, "source": [ "### Subcontracting\n", @@ -262,7 +262,7 @@ }, { "cell_type": "markdown", - "id": "4d293fe9", + "id": "508c3fbe", "metadata": {}, "source": [ "### Costs\n", @@ -292,7 +292,7 @@ }, { "cell_type": "markdown", - "id": "63f15c7e", + "id": "9dc833a6", "metadata": {}, "source": [ "## Equilibrium\n", @@ -315,7 +315,7 @@ }, { "cell_type": "markdown", - "id": "c5dd6906", + "id": "e6108741", "metadata": {}, "source": [ "### Informal Definition of Equilibrium\n", @@ -329,7 +329,7 @@ }, { "cell_type": "markdown", - "id": "9090fb84", + "id": "434f26f2", "metadata": {}, "source": [ "### Formal Definition of Equilibrium\n", @@ -387,7 +387,7 @@ }, { "cell_type": "markdown", - "id": "efc50ef8", + "id": "812f9b05", "metadata": {}, "source": [ "## Existence, Uniqueness and Computation of Equilibria\n", @@ -397,7 +397,7 @@ }, { "cell_type": "markdown", - "id": "068affb4", + "id": "d599fdd1", "metadata": {}, "source": [ "### A Fixed Point Method\n", @@ -498,7 +498,7 @@ }, { "cell_type": "markdown", - "id": "1b9698f6", + "id": "03ea9470", "metadata": {}, "source": [ "### Marginal Conditions\n", @@ -552,7 +552,7 @@ }, { "cell_type": "markdown", - "id": "012e5410", + "id": "ecde43b3", "metadata": {}, "source": [ "## Implementation\n", @@ -577,7 +577,7 @@ { "cell_type": "code", "execution_count": null, - "id": "fcfeb4ba", + "id": "e78ec140", "metadata": { "hide-output": false }, @@ -596,7 +596,7 @@ }, { "cell_type": "markdown", - "id": "82d718e5", + "id": "cf8eebaa", "metadata": {}, "source": [ "Now let’s implement and iterate with $ T $ until convergence.\n", @@ -608,7 +608,7 @@ { "cell_type": "code", "execution_count": null, - "id": "e49cdb99", + "id": "2b92d778", "metadata": { "hide-output": false }, @@ -647,7 +647,7 @@ }, { "cell_type": "markdown", - "id": "d76ab843", + "id": "cd44aa5e", "metadata": {}, "source": [ "The next function computes optimal choice of upstream boundary and range of\n", @@ -657,7 +657,7 @@ { "cell_type": "code", "execution_count": null, - "id": "1a8c14f0", + "id": "f5226363", "metadata": { "hide-output": false }, @@ -684,7 +684,7 @@ }, { "cell_type": "markdown", - "id": "1b83bb67", + "id": "b2cbea1c", "metadata": {}, "source": [ "The allocation of firms can be computed by recursively stepping through firms’ choices of\n", @@ -696,7 +696,7 @@ { "cell_type": "code", "execution_count": null, - "id": "f8488a7f", + "id": "27f75dac", "metadata": { "hide-output": false }, @@ -713,7 +713,7 @@ }, { "cell_type": "markdown", - "id": "31788601", + "id": "ee6aa211", "metadata": {}, "source": [ "Let’s try this at the default parameters.\n", @@ -725,7 +725,7 @@ { "cell_type": "code", "execution_count": null, - "id": "c47cd315", + "id": "42925147", "metadata": { "hide-output": false }, @@ -748,7 +748,7 @@ }, { "cell_type": "markdown", - "id": "53fbaf3f", + "id": "1a063ce5", "metadata": {}, "source": [ "Here’s the function $ \\ell^* $, which shows how large a firm with\n", @@ -758,7 +758,7 @@ { "cell_type": "code", "execution_count": null, - "id": "93116a69", + "id": "9ce3882f", "metadata": { "hide-output": false }, @@ -777,7 +777,7 @@ }, { "cell_type": "markdown", - "id": "ae1c7030", + "id": "70425f63", "metadata": {}, "source": [ "Note that downstream firms choose to be larger, a point we return to below." @@ -785,7 +785,7 @@ }, { "cell_type": "markdown", - "id": "60eba7b3", + "id": "361d8648", "metadata": {}, "source": [ "## Exercises\n", @@ -796,7 +796,7 @@ }, { "cell_type": "markdown", - "id": "c33539e1", + "id": "b5cde36a", "metadata": {}, "source": [ "## Exercise 15.1\n", @@ -810,7 +810,7 @@ }, { "cell_type": "markdown", - "id": "3e8ffacd", + "id": "43cb9600", "metadata": {}, "source": [ "## Solution to[ Exercise 15.1](https://python-advanced.quantecon.org/#coa_ex1)\n", @@ -821,7 +821,7 @@ { "cell_type": "code", "execution_count": null, - "id": "3020cfaf", + "id": "65faefbc", "metadata": { "hide-output": false }, @@ -838,7 +838,7 @@ }, { "cell_type": "markdown", - "id": "1ebabe80", + "id": "7599518b", "metadata": {}, "source": [ "## Exercise 15.2\n", @@ -854,7 +854,7 @@ }, { "cell_type": "markdown", - "id": "727bb2aa", + "id": "d9fc26dd", "metadata": {}, "source": [ "## Solution to[ Exercise 15.2](https://python-advanced.quantecon.org/#coa_ex2)\n", @@ -877,7 +877,7 @@ { "cell_type": "code", "execution_count": null, - "id": "9940bcad", + "id": "277bc311", "metadata": { "hide-output": false }, @@ -901,7 +901,7 @@ } ], "metadata": { - "date": 1680677524.641318, + "date": 1685490451.4266462, "filename": "coase.md", "kernelspec": { "display_name": "Python", diff --git a/cons_news.ipynb b/cons_news.ipynb index c8ffe4a..4468ae8 100644 --- a/cons_news.ipynb +++ b/cons_news.ipynb @@ -2,7 +2,7 @@ "cells": [ { "cell_type": "markdown", - "id": "0fa2560a", + "id": "ed7e4a51", "metadata": {}, "source": [ "\n", @@ -11,7 +11,7 @@ }, { "cell_type": "markdown", - "id": "0e5e186f", + "id": "e029c301", "metadata": {}, "source": [ "# Information and Consumption Smoothing" @@ -19,7 +19,7 @@ }, { "cell_type": "markdown", - "id": "be29e05d", + "id": "3f7a6c5e", "metadata": {}, "source": [ "## Contents\n", @@ -41,7 +41,7 @@ }, { "cell_type": "markdown", - "id": "364a4fb1", + "id": "a9f07d4f", "metadata": {}, "source": [ "In addition to what’s in Anaconda, this lecture employs the following libraries:" @@ -50,7 +50,7 @@ { "cell_type": "code", "execution_count": null, - "id": "ec845999", + "id": "6f616004", "metadata": { "hide-output": false }, @@ -61,7 +61,7 @@ }, { "cell_type": "markdown", - "id": "92ae8676", + "id": "731e2515", "metadata": {}, "source": [ "## Overview\n", @@ -87,7 +87,7 @@ }, { "cell_type": "markdown", - "id": "687d8574", + "id": "04845219", "metadata": {}, "source": [ "### Same non-financial incomes, different information\n", @@ -148,7 +148,7 @@ }, { "cell_type": "markdown", - "id": "5461bbcd", + "id": "4a64a0f6", "metadata": {}, "source": [ "## Two Representations of One Nonfinancial Income Process\n", @@ -279,7 +279,7 @@ }, { "cell_type": "markdown", - "id": "60a9f1f7", + "id": "734beec1", "metadata": {}, "source": [ "## Application of Kalman filter\n", @@ -327,7 +327,7 @@ }, { "cell_type": "markdown", - "id": "d33630b8", + "id": "b217153a", "metadata": {}, "source": [ "## News Shocks and Less Informative Shocks\n", @@ -426,7 +426,7 @@ }, { "cell_type": "markdown", - "id": "662d1cd6", + "id": "c0c096ab", "metadata": {}, "source": [ "## Representation of $ \\epsilon_t $ Shock in Terms of Future $ y_t $\n", @@ -458,7 +458,7 @@ }, { "cell_type": "markdown", - "id": "4a121221", + "id": "c53c7ea2", "metadata": {}, "source": [ "## Representation in Terms of $ a_t $ Shocks\n", @@ -487,7 +487,7 @@ }, { "cell_type": "markdown", - "id": "e11c36d0", + "id": "1445ff41", "metadata": {}, "source": [ "## Permanent Income Consumption-Smoothing Model\n", @@ -543,7 +543,7 @@ }, { "cell_type": "markdown", - "id": "217cde9f", + "id": "91fbc26f", "metadata": {}, "source": [ "## State Space Representations\n", @@ -585,7 +585,7 @@ }, { "cell_type": "markdown", - "id": "f928964c", + "id": "0ba16f4a", "metadata": {}, "source": [ "## Computations\n", @@ -706,7 +706,7 @@ { "cell_type": "code", "execution_count": null, - "id": "8e6742a0", + "id": "c68b0e7e", "metadata": { "hide-output": false }, @@ -721,7 +721,7 @@ { "cell_type": "code", "execution_count": null, - "id": "b88e1ab9", + "id": "6f7d4f12", "metadata": { "hide-output": false }, @@ -743,7 +743,7 @@ { "cell_type": "code", "execution_count": null, - "id": "1bd74142", + "id": "f9f3868e", "metadata": { "hide-output": false }, @@ -764,7 +764,7 @@ { "cell_type": "code", "execution_count": null, - "id": "92565541", + "id": "eea6d47d", "metadata": { "hide-output": false }, @@ -776,7 +776,7 @@ }, { "cell_type": "markdown", - "id": "18183521", + "id": "a204a390", "metadata": {}, "source": [ "Evidently, optimal consumption and debt decision rules for the consumer\n", @@ -795,7 +795,7 @@ { "cell_type": "code", "execution_count": null, - "id": "d576d6e7", + "id": "1fd04c01", "metadata": { "hide-output": false }, @@ -815,7 +815,7 @@ { "cell_type": "code", "execution_count": null, - "id": "efbf4c93", + "id": "ec9a10e6", "metadata": { "hide-output": false }, @@ -826,7 +826,7 @@ }, { "cell_type": "markdown", - "id": "bf47605b", + "id": "ec7f03a9", "metadata": {}, "source": [ "For a consumer having access only to the information associated with the\n", @@ -879,7 +879,7 @@ { "cell_type": "code", "execution_count": null, - "id": "e39adb23", + "id": "6869f287", "metadata": { "hide-output": false }, @@ -899,7 +899,7 @@ }, { "cell_type": "markdown", - "id": "dff2e121", + "id": "6f0434c4", "metadata": {}, "source": [ "The following code computes impulse response functions of\n", @@ -909,7 +909,7 @@ { "cell_type": "code", "execution_count": null, - "id": "3177355f", + "id": "f83dcabb", "metadata": { "hide-output": false }, @@ -929,7 +929,7 @@ { "cell_type": "code", "execution_count": null, - "id": "9bc0ccf8", + "id": "537688d7", "metadata": { "hide-output": false }, @@ -941,7 +941,7 @@ { "cell_type": "code", "execution_count": null, - "id": "bd08aa7b", + "id": "0e337ab2", "metadata": { "hide-output": false }, @@ -955,7 +955,7 @@ }, { "cell_type": "markdown", - "id": "0dce3fbe", + "id": "d78c0711", "metadata": {}, "source": [ "The above two impulse response functions show that when the consumer has\n", @@ -971,7 +971,7 @@ { "cell_type": "code", "execution_count": null, - "id": "f73a3fbd", + "id": "b3e999f9", "metadata": { "hide-output": false }, @@ -983,7 +983,7 @@ { "cell_type": "code", "execution_count": null, - "id": "f9fe4908", + "id": "5a321d1b", "metadata": { "hide-output": false }, @@ -998,7 +998,7 @@ }, { "cell_type": "markdown", - "id": "ab7e1a8a", + "id": "1c8fda5a", "metadata": {}, "source": [ "The above impulse responses show that when the consumer has only the\n", @@ -1022,7 +1022,7 @@ { "cell_type": "code", "execution_count": null, - "id": "89cba0aa", + "id": "eb03de54", "metadata": { "hide-output": false }, @@ -1035,7 +1035,7 @@ { "cell_type": "code", "execution_count": null, - "id": "8e62dd7f", + "id": "450eed60", "metadata": { "hide-output": false }, @@ -1052,7 +1052,7 @@ { "cell_type": "code", "execution_count": null, - "id": "0fa044a9", + "id": "17150bea", "metadata": { "hide-output": false }, @@ -1068,7 +1068,7 @@ }, { "cell_type": "markdown", - "id": "f1444a94", + "id": "8307df15", "metadata": {}, "source": [ "## Simulating Income Process and Two Associated Shock Processes\n", @@ -1107,7 +1107,7 @@ }, { "cell_type": "markdown", - "id": "24bffa3b", + "id": "51316c93", "metadata": {}, "source": [ "## Calculating Innovations in Another Way\n", @@ -1135,7 +1135,7 @@ }, { "cell_type": "markdown", - "id": "39cf95cd", + "id": "cebfe6bf", "metadata": {}, "source": [ "## Another Invertibility Issue\n", @@ -1149,7 +1149,7 @@ } ], "metadata": { - "date": 1680677524.7046556, + "date": 1685490451.6691341, "filename": "cons_news.md", "kernelspec": { "display_name": "Python", diff --git a/discrete_dp.ipynb b/discrete_dp.ipynb index 9fa3dc4..5bb722c 100644 --- a/discrete_dp.ipynb +++ b/discrete_dp.ipynb @@ -2,7 +2,7 @@ "cells": [ { "cell_type": "markdown", - "id": "bd86db13", + "id": "006a938b", "metadata": {}, "source": [ "\n", @@ -11,7 +11,7 @@ }, { "cell_type": "markdown", - "id": "df75ba7d", + "id": "98f777c3", "metadata": {}, "source": [ "# Discrete State Dynamic Programming" @@ -19,7 +19,7 @@ }, { "cell_type": "markdown", - "id": "992feaa2", + "id": "611a4e20", "metadata": {}, "source": [ "## Contents\n", @@ -36,7 +36,7 @@ }, { "cell_type": "markdown", - "id": "041c11e3", + "id": "e79b250a", "metadata": {}, "source": [ "In addition to what’s in Anaconda, this lecture will need the following libraries:" @@ -45,7 +45,7 @@ { "cell_type": "code", "execution_count": null, - "id": "ecfcbb1d", + "id": "cf27f9c2", "metadata": { "hide-output": false }, @@ -56,7 +56,7 @@ }, { "cell_type": "markdown", - "id": "7097e091", + "id": "57e908b8", "metadata": {}, "source": [ "## Overview\n", @@ -96,7 +96,7 @@ { "cell_type": "code", "execution_count": null, - "id": "f46aac84", + "id": "344ff064", "metadata": { "hide-output": false }, @@ -113,7 +113,7 @@ }, { "cell_type": "markdown", - "id": "744f2fdb", + "id": "87444033", "metadata": {}, "source": [ "### How to Read this Lecture\n", @@ -129,7 +129,7 @@ }, { "cell_type": "markdown", - "id": "161ffe8d", + "id": "772c466e", "metadata": {}, "source": [ "### Code\n", @@ -148,7 +148,7 @@ }, { "cell_type": "markdown", - "id": "d1a73aca", + "id": "aaa98f18", "metadata": {}, "source": [ "### References\n", @@ -170,7 +170,7 @@ }, { "cell_type": "markdown", - "id": "b185f569", + "id": "44ab312f", "metadata": {}, "source": [ "## Discrete DPs\n", @@ -209,7 +209,7 @@ }, { "cell_type": "markdown", - "id": "2d37e062", + "id": "134d7826", "metadata": {}, "source": [ "### Policies\n", @@ -240,7 +240,7 @@ }, { "cell_type": "markdown", - "id": "ea3e887d", + "id": "ca81a694", "metadata": {}, "source": [ "### Formal Definition\n", @@ -303,7 +303,7 @@ }, { "cell_type": "markdown", - "id": "3f235818", + "id": "2100e08b", "metadata": {}, "source": [ "### Value and Optimality\n", @@ -348,7 +348,7 @@ }, { "cell_type": "markdown", - "id": "db693437", + "id": "4b10c2bb", "metadata": {}, "source": [ "### Two Operators\n", @@ -400,7 +400,7 @@ }, { "cell_type": "markdown", - "id": "a5a3dfff", + "id": "b6b3c02e", "metadata": {}, "source": [ "### The Bellman Equation and the Principle of Optimality\n", @@ -436,7 +436,7 @@ }, { "cell_type": "markdown", - "id": "c6186716", + "id": "418b7a97", "metadata": {}, "source": [ "## Solving Discrete DPs\n", @@ -457,7 +457,7 @@ }, { "cell_type": "markdown", - "id": "8aa98054", + "id": "27cacff3", "metadata": {}, "source": [ "### Value Function Iteration\n", @@ -473,7 +473,7 @@ }, { "cell_type": "markdown", - "id": "920c7091", + "id": "b0e01981", "metadata": {}, "source": [ "### Policy Function Iteration\n", @@ -496,7 +496,7 @@ }, { "cell_type": "markdown", - "id": "67ed4911", + "id": "ec74361e", "metadata": {}, "source": [ "### Modified Policy Function Iteration\n", @@ -515,7 +515,7 @@ }, { "cell_type": "markdown", - "id": "3b8a5782", + "id": "8f00e64d", "metadata": {}, "source": [ "## Example: A Growth Model\n", @@ -547,7 +547,7 @@ }, { "cell_type": "markdown", - "id": "c3ae3497", + "id": "0344b219", "metadata": {}, "source": [ "### Discrete DP Representation\n", @@ -580,7 +580,7 @@ }, { "cell_type": "markdown", - "id": "73f851b8", + "id": "3afc51ba", "metadata": {}, "source": [ "### Defining a DiscreteDP Instance\n", @@ -609,7 +609,7 @@ { "cell_type": "code", "execution_count": null, - "id": "4a019cf0", + "id": "42bad1d8", "metadata": { "hide-output": false }, @@ -660,7 +660,7 @@ }, { "cell_type": "markdown", - "id": "a963ba81", + "id": "d11dc571", "metadata": {}, "source": [ "Let’s run this code and create an instance of `SimpleOG`." @@ -669,7 +669,7 @@ { "cell_type": "code", "execution_count": null, - "id": "8184f663", + "id": "0d9a08e9", "metadata": { "hide-output": false }, @@ -680,7 +680,7 @@ }, { "cell_type": "markdown", - "id": "e624d140", + "id": "08dc111d", "metadata": {}, "source": [ "Instances of `DiscreteDP` are created using the signature `DiscreteDP(R, Q, β)`.\n", @@ -691,7 +691,7 @@ { "cell_type": "code", "execution_count": null, - "id": "6849dd17", + "id": "9b1f8d96", "metadata": { "hide-output": false }, @@ -702,7 +702,7 @@ }, { "cell_type": "markdown", - "id": "6a00a5d2", + "id": "c676844a", "metadata": {}, "source": [ "Now that we have an instance `ddp` of `DiscreteDP` we can solve it as follows" @@ -711,7 +711,7 @@ { "cell_type": "code", "execution_count": null, - "id": "1c4815bf", + "id": "4158b402", "metadata": { "hide-output": false }, @@ -722,7 +722,7 @@ }, { "cell_type": "markdown", - "id": "ee1d3faf", + "id": "94cd2029", "metadata": {}, "source": [ "Let’s see what we’ve got here" @@ -731,7 +731,7 @@ { "cell_type": "code", "execution_count": null, - "id": "ecfddaf2", + "id": "2b5ca6d3", "metadata": { "hide-output": false }, @@ -742,7 +742,7 @@ }, { "cell_type": "markdown", - "id": "8953edf7", + "id": "00784c5a", "metadata": {}, "source": [ "(In IPython version 4.0 and above you can also type `results.` and hit the tab key)\n", @@ -753,7 +753,7 @@ { "cell_type": "code", "execution_count": null, - "id": "6d2ab426", + "id": "3d9c7e43", "metadata": { "hide-output": false }, @@ -765,7 +765,7 @@ { "cell_type": "code", "execution_count": null, - "id": "d68249db", + "id": "5cb36e1c", "metadata": { "hide-output": false }, @@ -776,7 +776,7 @@ }, { "cell_type": "markdown", - "id": "5815e967", + "id": "ebb5ceb3", "metadata": {}, "source": [ "Since we’ve used policy iteration, these results will be exact unless we hit the iteration bound `max_iter`.\n", @@ -787,7 +787,7 @@ { "cell_type": "code", "execution_count": null, - "id": "76925df9", + "id": "1c299fe0", "metadata": { "hide-output": false }, @@ -799,7 +799,7 @@ { "cell_type": "code", "execution_count": null, - "id": "fa1b5bfc", + "id": "499c3321", "metadata": { "hide-output": false }, @@ -810,7 +810,7 @@ }, { "cell_type": "markdown", - "id": "7ce24cbb", + "id": "735428e0", "metadata": {}, "source": [ "Another interesting object is `results.mc`, which is the controlled chain defined by $ Q_{\\sigma^*} $, where $ \\sigma^* $ is the optimal policy.\n", @@ -824,7 +824,7 @@ { "cell_type": "code", "execution_count": null, - "id": "06d7d13f", + "id": "acacd57c", "metadata": { "hide-output": false }, @@ -835,7 +835,7 @@ }, { "cell_type": "markdown", - "id": "2a24d2a6", + "id": "f26ba5ce", "metadata": {}, "source": [ "Here’s the same information in a bar graph\n", @@ -849,7 +849,7 @@ { "cell_type": "code", "execution_count": null, - "id": "0b4e9d51", + "id": "f43fa59e", "metadata": { "hide-output": false }, @@ -862,7 +862,7 @@ }, { "cell_type": "markdown", - "id": "00d7355d", + "id": "17648230", "metadata": {}, "source": [ "If we look at the bar graph we can see the rightward shift in probability mass\n", @@ -872,7 +872,7 @@ }, { "cell_type": "markdown", - "id": "84cad36e", + "id": "7677e8d7", "metadata": {}, "source": [ "### State-Action Pair Formulation\n", @@ -896,7 +896,7 @@ { "cell_type": "code", "execution_count": null, - "id": "11a7e6b9", + "id": "325fd438", "metadata": { "hide-output": false }, @@ -929,7 +929,7 @@ }, { "cell_type": "markdown", - "id": "e002d5fa", + "id": "eba6d9ba", "metadata": {}, "source": [ "For larger problems, you might need to write this code more efficiently by vectorizing or using Numba." @@ -937,7 +937,7 @@ }, { "cell_type": "markdown", - "id": "5909bd84", + "id": "cf67a3f2", "metadata": {}, "source": [ "## Exercises\n", @@ -949,7 +949,7 @@ }, { "cell_type": "markdown", - "id": "74446860", + "id": "208f504a", "metadata": {}, "source": [ "## Solutions" @@ -957,7 +957,7 @@ }, { "cell_type": "markdown", - "id": "025db164", + "id": "962adce1", "metadata": {}, "source": [ "### Setup\n", @@ -971,7 +971,7 @@ { "cell_type": "code", "execution_count": null, - "id": "9ea62af6", + "id": "60570bde", "metadata": { "hide-output": false }, @@ -985,7 +985,7 @@ }, { "cell_type": "markdown", - "id": "00be9a58", + "id": "37a0cbaa", "metadata": {}, "source": [ "Here we want to solve a finite state version of the continuous state model above.\n", @@ -996,7 +996,7 @@ { "cell_type": "code", "execution_count": null, - "id": "30ee87d3", + "id": "2d5b8eb1", "metadata": { "hide-output": false }, @@ -1009,7 +1009,7 @@ }, { "cell_type": "markdown", - "id": "badd9a2e", + "id": "1370623f", "metadata": {}, "source": [ "We choose the action to be the amount of capital to save for the next\n", @@ -1038,7 +1038,7 @@ { "cell_type": "code", "execution_count": null, - "id": "1b428f09", + "id": "7c3b00eb", "metadata": { "hide-output": false }, @@ -1060,7 +1060,7 @@ }, { "cell_type": "markdown", - "id": "69e90492", + "id": "76b19962", "metadata": {}, "source": [ "Reward vector `R` (of length `L`):" @@ -1069,7 +1069,7 @@ { "cell_type": "code", "execution_count": null, - "id": "5a7676ac", + "id": "198fd001", "metadata": { "hide-output": false }, @@ -1080,7 +1080,7 @@ }, { "cell_type": "markdown", - "id": "85c5c9d0", + "id": "3f2e5180", "metadata": {}, "source": [ "(Degenerate) transition probability matrix `Q` (of shape `(L, grid_size)`), where we choose the [scipy.sparse.lil_matrix](http://docs.scipy.org/doc/scipy/reference/generated/scipy.sparse.lil_matrix.html) format, while any format will do (internally it will be converted to the csr format):" @@ -1089,7 +1089,7 @@ { "cell_type": "code", "execution_count": null, - "id": "ca753f6c", + "id": "b7b5ebf3", "metadata": { "hide-output": false }, @@ -1101,7 +1101,7 @@ }, { "cell_type": "markdown", - "id": "7e290c03", + "id": "ab46e714", "metadata": {}, "source": [ "(If you are familiar with the data structure of [scipy.sparse.csr_matrix](http://docs.scipy.org/doc/scipy/reference/generated/scipy.sparse.csr_matrix.html), the following is the most efficient way to create the `Q` matrix in\n", @@ -1111,7 +1111,7 @@ { "cell_type": "code", "execution_count": null, - "id": "6d7fa525", + "id": "31e93f26", "metadata": { "hide-output": false }, @@ -1124,7 +1124,7 @@ }, { "cell_type": "markdown", - "id": "f6bdc351", + "id": "ad268f96", "metadata": {}, "source": [ "Discrete growth model:" @@ -1133,7 +1133,7 @@ { "cell_type": "code", "execution_count": null, - "id": "623cc5fd", + "id": "f43c1d08", "metadata": { "hide-output": false }, @@ -1144,7 +1144,7 @@ }, { "cell_type": "markdown", - "id": "a93ef971", + "id": "886aecaa", "metadata": {}, "source": [ "**Notes**\n", @@ -1156,7 +1156,7 @@ }, { "cell_type": "markdown", - "id": "21fe435d", + "id": "3bec432a", "metadata": {}, "source": [ "### Solving the Model\n", @@ -1167,7 +1167,7 @@ { "cell_type": "code", "execution_count": null, - "id": "ff5ede70", + "id": "456035f3", "metadata": { "hide-output": false }, @@ -1180,7 +1180,7 @@ }, { "cell_type": "markdown", - "id": "23a9e835", + "id": "20c9bba5", "metadata": {}, "source": [ "Note that `sigma` contains the *indices* of the optimal *capital\n", @@ -1191,7 +1191,7 @@ { "cell_type": "code", "execution_count": null, - "id": "022a949f", + "id": "934349e1", "metadata": { "hide-output": false }, @@ -1214,7 +1214,7 @@ }, { "cell_type": "markdown", - "id": "daa68d84", + "id": "a7100d9b", "metadata": {}, "source": [ "Let us compare the solution of the discrete model with that of the\n", @@ -1224,7 +1224,7 @@ { "cell_type": "code", "execution_count": null, - "id": "d0a666a2", + "id": "8d733ee7", "metadata": { "hide-output": false }, @@ -1253,7 +1253,7 @@ }, { "cell_type": "markdown", - "id": "8cef2341", + "id": "7546d532", "metadata": {}, "source": [ "The outcomes appear very close to those of the continuous version.\n", @@ -1264,7 +1264,7 @@ { "cell_type": "code", "execution_count": null, - "id": "53b0621b", + "id": "122f674d", "metadata": { "hide-output": false }, @@ -1276,7 +1276,7 @@ { "cell_type": "code", "execution_count": null, - "id": "3fb3764f", + "id": "30d7f438", "metadata": { "hide-output": false }, @@ -1287,7 +1287,7 @@ }, { "cell_type": "markdown", - "id": "02ff845f", + "id": "eb7761e6", "metadata": {}, "source": [ "The optimal consumption functions are close as well:" @@ -1296,7 +1296,7 @@ { "cell_type": "code", "execution_count": null, - "id": "74a921bb", + "id": "8e52f084", "metadata": { "hide-output": false }, @@ -1307,7 +1307,7 @@ }, { "cell_type": "markdown", - "id": "ad5b9e19", + "id": "9ec2e711", "metadata": {}, "source": [ "In fact, the optimal consumption obtained in the discrete version is not\n", @@ -1317,7 +1317,7 @@ { "cell_type": "code", "execution_count": null, - "id": "b6029edf", + "id": "8bb0e52b", "metadata": { "hide-output": false }, @@ -1330,7 +1330,7 @@ { "cell_type": "code", "execution_count": null, - "id": "6d054fc6", + "id": "80ab9e6a", "metadata": { "hide-output": false }, @@ -1343,7 +1343,7 @@ { "cell_type": "code", "execution_count": null, - "id": "f6f41ea0", + "id": "92675670", "metadata": { "hide-output": false }, @@ -1354,7 +1354,7 @@ }, { "cell_type": "markdown", - "id": "8c248576", + "id": "21ca03d6", "metadata": {}, "source": [ "The value function is monotone:" @@ -1363,7 +1363,7 @@ { "cell_type": "code", "execution_count": null, - "id": "3e7a088a", + "id": "7b521d1d", "metadata": { "hide-output": false }, @@ -1374,7 +1374,7 @@ }, { "cell_type": "markdown", - "id": "fa2ebbdd", + "id": "b982a748", "metadata": {}, "source": [ "### Comparison of the Solution Methods\n", @@ -1384,7 +1384,7 @@ }, { "cell_type": "markdown", - "id": "996ad702", + "id": "c4b56897", "metadata": {}, "source": [ "#### Value Iteration" @@ -1393,7 +1393,7 @@ { "cell_type": "code", "execution_count": null, - "id": "d09837cd", + "id": "7ebb67b3", "metadata": { "hide-output": false }, @@ -1408,7 +1408,7 @@ { "cell_type": "code", "execution_count": null, - "id": "e50bbc23", + "id": "f46e3cd4", "metadata": { "hide-output": false }, @@ -1419,7 +1419,7 @@ }, { "cell_type": "markdown", - "id": "859d1c96", + "id": "9472e42c", "metadata": {}, "source": [ "#### Modified Policy Iteration" @@ -1428,7 +1428,7 @@ { "cell_type": "code", "execution_count": null, - "id": "46f34f9c", + "id": "1526c163", "metadata": { "hide-output": false }, @@ -1441,7 +1441,7 @@ { "cell_type": "code", "execution_count": null, - "id": "3e055e9a", + "id": "1343b9b7", "metadata": { "hide-output": false }, @@ -1452,7 +1452,7 @@ }, { "cell_type": "markdown", - "id": "ddaffb3d", + "id": "ebdcbb2c", "metadata": {}, "source": [ "#### Speed Comparison" @@ -1461,7 +1461,7 @@ { "cell_type": "code", "execution_count": null, - "id": "9a5028fe", + "id": "64c426fd", "metadata": { "hide-output": false }, @@ -1474,7 +1474,7 @@ }, { "cell_type": "markdown", - "id": "c55b7197", + "id": "5c5c56cd", "metadata": {}, "source": [ "As is often the case, policy iteration and modified policy iteration are\n", @@ -1483,7 +1483,7 @@ }, { "cell_type": "markdown", - "id": "68336c11", + "id": "661d0eed", "metadata": {}, "source": [ "### Replication of the Figures\n", @@ -1493,7 +1493,7 @@ }, { "cell_type": "markdown", - "id": "36f0988e", + "id": "15188091", "metadata": {}, "source": [ "#### Convergence of Value Iteration\n", @@ -1506,7 +1506,7 @@ { "cell_type": "code", "execution_count": null, - "id": "ada282a6", + "id": "80f6cdbe", "metadata": { "hide-output": false }, @@ -1531,7 +1531,7 @@ }, { "cell_type": "markdown", - "id": "f0ac695e", + "id": "50fd49d3", "metadata": {}, "source": [ "We next plot the consumption policies along with the value iteration" @@ -1540,7 +1540,7 @@ { "cell_type": "code", "execution_count": null, - "id": "711c7794", + "id": "9748a8bf", "metadata": { "hide-output": false }, @@ -1573,7 +1573,7 @@ }, { "cell_type": "markdown", - "id": "745f354e", + "id": "3f36b189", "metadata": {}, "source": [ "#### Dynamics of the Capital Stock\n", @@ -1588,7 +1588,7 @@ { "cell_type": "code", "execution_count": null, - "id": "7f56b000", + "id": "ece646fc", "metadata": { "hide-output": false }, @@ -1623,7 +1623,7 @@ }, { "cell_type": "markdown", - "id": "055fc0b4", + "id": "24895af9", "metadata": {}, "source": [ "\n", @@ -1632,7 +1632,7 @@ }, { "cell_type": "markdown", - "id": "12b441e1", + "id": "464515fa", "metadata": {}, "source": [ "## Appendix: Algorithms\n", @@ -1647,7 +1647,7 @@ }, { "cell_type": "markdown", - "id": "ef0bc3aa", + "id": "34f659cc", "metadata": {}, "source": [ "### Value Iteration\n", @@ -1674,7 +1674,7 @@ }, { "cell_type": "markdown", - "id": "4fa6590d", + "id": "5a75c822", "metadata": {}, "source": [ "### Policy Iteration\n", @@ -1700,7 +1700,7 @@ }, { "cell_type": "markdown", - "id": "c2b14057", + "id": "3bfb0ac2", "metadata": {}, "source": [ "### Modified Policy Iteration\n", @@ -1726,7 +1726,7 @@ } ], "metadata": { - "date": 1680677524.7917743, + "date": 1685490451.7548275, "filename": "discrete_dp.md", "kernelspec": { "display_name": "Python", diff --git a/dyn_stack.ipynb b/dyn_stack.ipynb index 10188c5..61599dd 100644 --- a/dyn_stack.ipynb +++ b/dyn_stack.ipynb @@ -2,7 +2,7 @@ "cells": [ { "cell_type": "markdown", - "id": "3432f1c5", + "id": "27257cd4", "metadata": {}, "source": [ "\n", @@ -11,7 +11,7 @@ }, { "cell_type": "markdown", - "id": "fd64e3c6", + "id": "71eaeb53", "metadata": {}, "source": [ "# Stackelberg Plans" @@ -19,7 +19,7 @@ }, { "cell_type": "markdown", - "id": "87f8acb9", + "id": "cc713f02", "metadata": {}, "source": [ "## Contents\n", @@ -29,7 +29,7 @@ " - [Duopoly](#Duopoly) \n", " - [Stackelberg Problem](#Stackelberg-Problem) \n", " - [Two Bellman Equations](#Two-Bellman-Equations) \n", - " - [Stackelberg Plan](#Stackelberg-Plan) \n", + " - [Stackelberg Plan for Duopoly](#Stackelberg-Plan-for-Duopoly) \n", " - [Recursive Representation of Stackelberg Plan](#Recursive-Representation-of-Stackelberg-Plan) \n", " - [Dynamic Programming and Time Consistency of Follower’s Problem](#Dynamic-Programming-and-Time-Consistency-of-Follower’s-Problem) \n", " - [Computing Stackelberg Plan](#Computing--Stackelberg-Plan) \n", @@ -42,7 +42,7 @@ }, { "cell_type": "markdown", - "id": "e6fa2805", + "id": "d319e9db", "metadata": {}, "source": [ "In addition to what’s in Anaconda, this lecture will need the following libraries:" @@ -51,7 +51,7 @@ { "cell_type": "code", "execution_count": null, - "id": "57e5eddb", + "id": "ac6956c7", "metadata": { "hide-output": false }, @@ -62,7 +62,7 @@ }, { "cell_type": "markdown", - "id": "2cfdf6e2", + "id": "e9b10d87", "metadata": {}, "source": [ "## Overview\n", @@ -87,7 +87,7 @@ { "cell_type": "code", "execution_count": null, - "id": "7b42f9c0", + "id": "12b85034", "metadata": { "hide-output": false }, @@ -103,7 +103,7 @@ }, { "cell_type": "markdown", - "id": "7f50ad13", + "id": "0924cdb3", "metadata": {}, "source": [ "## Duopoly\n", @@ -153,7 +153,7 @@ }, { "cell_type": "markdown", - "id": "c7b45cec", + "id": "4d99c396", "metadata": {}, "source": [ "### Stackelberg Leader and Follower\n", @@ -179,7 +179,7 @@ }, { "cell_type": "markdown", - "id": "74226b18", + "id": "12ad6002", "metadata": {}, "source": [ "### Statement of Leader’s and Follower’s Problems\n", @@ -231,7 +231,7 @@ }, { "cell_type": "markdown", - "id": "c4b148b5", + "id": "62e64474", "metadata": {}, "source": [ "### Firms’ Problems\n", @@ -287,7 +287,7 @@ "\n", "\n", "$$\n", - "q_{1t} + (1+\\beta + c_1) q_{1t+1} - \\beta q_{1t+2} = c_0 - c_2 q_{2t+1} \\tag{40.1}\n", + "- q_{1t} + (1+\\beta + c_1) q_{1t+1} - \\beta q_{1t+2} = c_0 - c_2 q_{2t+1} \\tag{40.1}\n", "$$\n", "\n", "Equation [(40.1)](#equation-sstack1) is a second-order difference equation in the sequence\n", @@ -372,23 +372,23 @@ "**Remarks:** We have formulated the Stackelberg problem in a space of\n", "sequences.\n", "\n", - "The max-min problem associated with Lagrangian\n", + "The max-min problem associated with firm 2’s Lagrangian\n", "[(40.4)](#equation-sstack4) is unpleasant because the time $ t $\n", - "component of firm $ 1 $’s payoff function depends on the entire\n", - "future of its choices of $ \\{q_{1t+j}\\}_{j=0}^\\infty $.\n", + "component of firm $ 2 $’s payoff function depends on the entire\n", + "future of its choices of $ \\{q_{2t+j}\\}_{j=0}^\\infty $.\n", "\n", - "This renders a direct attack on the problem cumbersome.\n", + "This renders a direct attack on the problem in the space of sequences cumbersome.\n", "\n", - "Therefore, below we will formulate the Stackelberg leader’s problem\n", + "Therefore, below we will formulate the Stackelberg leader’s problem\n", "recursively.\n", "\n", - "We’ll put our little duopoly model into a broader class of models with\n", - "the same structure." + "We’ll proceed by putting our duopoly model into a broader class of models with\n", + "the same general structure." ] }, { "cell_type": "markdown", - "id": "7af80acd", + "id": "182d0182", "metadata": {}, "source": [ "## Stackelberg Problem\n", @@ -475,7 +475,7 @@ }, { "cell_type": "markdown", - "id": "59aaa26f", + "id": "ed29db75", "metadata": {}, "source": [ "### Interpretation of Second Block of Equations\n", @@ -510,7 +510,7 @@ }, { "cell_type": "markdown", - "id": "7495ba77", + "id": "6822a700", "metadata": {}, "source": [ "### More Mechanical Details\n", @@ -524,20 +524,20 @@ "\\Omega(y_0) = \\left\\{ (\\vec y_1, \\vec u_0) : y_{t+1} = A y_t + B u_t, \\forall t \\geq 0 \\right\\}\n", "$$\n", "\n", - "Please remember that the follower’s Euler equation is embedded in the\n", + "Please remember that the follower’s system of Euler equations is embedded in the\n", "system of dynamic equations $ y_{t+1} = A y_t + B u_t $.\n", "\n", - "Note that in the definition of $ \\Omega(y_0) $, $ y_0 $\n", - "is taken as given.\n", + "Note that the definition of $ \\Omega(y_0) $ treats $ y_0 $\n", + "as given.\n", "\n", "Although it is taken as given in $ \\Omega(y_0) $,\n", - "eventually, the $ x_0 $ component of $ y_0 $ will be chosen by the\n", + "eventually, the $ x_0 $ component of $ y_0 $ is to be chosen by the\n", "Stackelberg leader." ] }, { "cell_type": "markdown", - "id": "bcd88b9e", + "id": "359c1573", "metadata": {}, "source": [ "### Two Subproblems\n", @@ -581,13 +581,12 @@ "Subproblem 2 optimizes over $ x_0 $.\n", "\n", "The value function $ w(z_0) $ tells the value of the Stackelberg plan\n", - "as a function of the vector of natural state variables at time $ 0 $,\n", - "$ z_0 $." + "as a function of the vector of natural state variables $ z_0 $ at time $ 0 $." ] }, { "cell_type": "markdown", - "id": "30a47a19", + "id": "b550a63b", "metadata": {}, "source": [ "## Two Bellman Equations\n", @@ -649,33 +648,61 @@ "\n", "which implies that\n", "\n", + "\n", + "\n", "$$\n", - "x_0 = - P_{22}^{-1} P_{21} z_0\n", + "x_0 = - P_{22}^{-1} P_{21} z_0 \\tag{40.10}\n", "$$" ] }, { "cell_type": "markdown", - "id": "16ae2aab", + "id": "aa20cdc7", "metadata": {}, "source": [ - "## Stackelberg Plan\n", + "## Stackelberg Plan for Duopoly\n", "\n", "Now let’s map our duopoly model into the above setup.\n", "\n", - "We will formulate a state space system\n", + "We formulate a state vector\n", "\n", "$$\n", "y_t = \\begin{bmatrix} z_t \\cr x_t \\end{bmatrix}\n", "$$\n", "\n", - "where in this instance $ x_t = v_{1t} $, the time $ t $ decision\n", - "of the follower firm 1." + "where for our duopoly model\n", + "\n", + "$$\n", + "z_t = \\begin{bmatrix} 1 \\cr q_{2t} \\cr q_{1t} \\end{bmatrix} , \\quad x_t = v_{1t},\n", + "$$\n", + "\n", + "where $ x_t = v_{1t} $ is the time $ t $ decision\n", + "of the follower firm 1, $ u_t $ is the time $ t $ decision of the leader firm 2 and\n", + "\n", + "$$\n", + "v_{1t} = q_{1t+1} - q_{1t}, \\quad u_t = q_{2t+1} - q_{2t} .\n", + "$$\n", + "\n", + "For our duopoly model, initial conditions for the natural state variables in $ z_t $ are\n", + "\n", + "$$\n", + "z_0 = \\begin{bmatrix} 1 \\cr q_{20} \\cr q_{10} \\end{bmatrix}\n", + "$$\n", + "\n", + "while $ x_0 = v_{10} = q_{11} - q_{10} $ is a choice variable for the Stackelberg leader firm 2, one that will ultimately be chosen according an optimal rule prescribed by [(40.10)](#equation-eq-subprob2x0)\n", + "for subproblem 2 above.\n", + "\n", + "That the Stackelberg leader firm 2 chooses $ x_0 = v_{10} $ is subtle.\n", + "\n", + "Of course, $ x_0 = v_{10} $ emerges from the feedback-feedforward solution [(40.3)](#equation-sstack3) of firm 1’s system of Euler equations, so that it is actually\n", + "firm 1 that sets $ x_0 $.\n", + "\n", + "But firm 2 manipulates firm 1’s choice through firm 2’s choice of the sequence $ \\vec q_{2,1} = \\{q_{2t+1}\\}_{t=0}^\\infty $." ] }, { "cell_type": "markdown", - "id": "fe8fbea0", + "id": "e2663267", "metadata": {}, "source": [ "### Calculations to Prepare Duopoly Model\n", @@ -693,7 +720,7 @@ }, { "cell_type": "markdown", - "id": "dee17734", + "id": "3d5eb84b", "metadata": {}, "source": [ "### Firm 1’s Problem\n", @@ -791,7 +818,7 @@ }, { "cell_type": "markdown", - "id": "fe93f77a", + "id": "287689e2", "metadata": {}, "source": [ "## Recursive Representation of Stackelberg Plan\n", @@ -845,7 +872,7 @@ "imply that for $ t \\geq 1 $\n", "\n", "$$\n", - "x_t = \\sum_{j=1}^t H_j^t \\check z_{t-j}\n", + "\\check x_t = \\sum_{j=1}^t H_j^t \\check z_{t-j}\n", "$$\n", "\n", "where\n", @@ -870,10 +897,10 @@ "\n", "\n", "$$\n", - "u_t = - F_z \\check z_t - F_x \\sum_{j=1}^t H^t_j z_{t-j} = \\sigma_t(\\check z^t) \\tag{40.10}\n", + "u_t = - F_z \\check z_t - F_x \\sum_{j=1}^t H^t_j z_{t-j} = \\sigma_t(\\check z^t) \\tag{40.11}\n", "$$\n", "\n", - "Representation [(40.10)](#equation-finalrule) confirms that whenever\n", + "Representation [(40.11)](#equation-finalrule) confirms that whenever\n", "$ F_x \\neq 0 $, the typical situation, the time $ t $ component\n", "$ \\sigma_t $ of a Stackelberg plan is **history-dependent**, meaning\n", "that the Stackelberg leader’s choice $ u_t $ depends not just on\n", @@ -882,7 +909,7 @@ }, { "cell_type": "markdown", - "id": "77bfbdd1", + "id": "b899fce8", "metadata": {}, "source": [ "### Comments and Interpretations\n", @@ -895,14 +922,14 @@ "The answer is that if we want to present to the Stackelberg **follower**\n", "a history-dependent representation of the Stackelberg **leader’s**\n", "sequence $ \\vec q_2 $, we must use representation\n", - "[(40.10)](#equation-finalrule) cast in terms of the history\n", + "[(40.11)](#equation-finalrule) cast in terms of the history\n", "$ \\check z^t $ and **not** a corresponding representation cast in\n", "terms of $ z^t $." ] }, { "cell_type": "markdown", - "id": "5a175dd0", + "id": "0cc9422d", "metadata": {}, "source": [ "## Dynamic Programming and Time Consistency of Follower’s Problem\n", @@ -921,7 +948,7 @@ }, { "cell_type": "markdown", - "id": "321954ff", + "id": "5a3400f3", "metadata": {}, "source": [ "### Recursive Formulation of a Follower’s Problem\n", @@ -986,7 +1013,7 @@ "\\begin{bmatrix} \\tilde y_{t+1} \\\\\n", "q_{1t+1} \\end{bmatrix} = \\begin{bmatrix} A - BF & 0 \\\\\n", "0 & 1 \\end{bmatrix} \\begin{bmatrix} \\tilde y_{t} \\\\\n", - "q_{1t} \\end{bmatrix} + \\begin{bmatrix} 0 \\cr 1 \\end{bmatrix} x_t \\tag{40.11}\n", + "q_{1t} \\end{bmatrix} + \\begin{bmatrix} 0 \\cr 1 \\end{bmatrix} x_t \\tag{40.12}\n", "$$\n", "\n", "This specification assures that from the point of the view of firm 1,\n", @@ -1044,17 +1071,17 @@ }, { "cell_type": "markdown", - "id": "51987c9f", + "id": "4016d2d7", "metadata": {}, "source": [ "### Time Consistency of Follower’s Plan\n", "\n", "The follower can solve its problem using dynamic programming because its\n", - "problem is recursive in **natural state variables**,\n", + "problem is recursive in what for it are the **natural state variables**,\n", "namely\n", "\n", "$$\n", - "\\begin{bmatrix} 1 \\cr q_{2t} \\cr \\tilde q_{10} \\cr \\tilde x_0 \\end{bmatrix}\n", + "\\begin{bmatrix} 1 \\cr q_{2t} \\cr \\tilde q_{1t} \\cr \\tilde x_t \\end{bmatrix}\n", "$$\n", "\n", "It follows that the follower’s plan is time consistent." @@ -1062,19 +1089,21 @@ }, { "cell_type": "markdown", - "id": "fb3ed664", + "id": "13a49827", "metadata": {}, "source": [ "## Computing Stackelberg Plan\n", "\n", "Here is our code to compute a Stackelberg plan via the linear-quadratic\n", - "dynamic program describe above" + "dynamic program describe above.\n", + "\n", + "Let’s use it to compute the Stackelberg plan." ] }, { "cell_type": "code", "execution_count": null, - "id": "be12316f", + "id": "6a5b35f5", "metadata": { "hide-output": false }, @@ -1098,7 +1127,7 @@ { "cell_type": "code", "execution_count": null, - "id": "b52d89a8", + "id": "5b26e363", "metadata": { "hide-output": false }, @@ -1152,24 +1181,26 @@ " π_leader[t] = -(yt[:, t].T @ π_matrix @ yt[:, t])\n", "\n", "# Display policies\n", - "print(\"Computed policy for Stackelberg leader\\n\")\n", + "print(\"Computed policy for Continuation Stackelberg leader\\n\")\n", "print(f\"F = {F}\")" ] }, { "cell_type": "markdown", - "id": "2e59cc02", + "id": "b6558404", "metadata": {}, "source": [ "## Time Series for Price and Quantities\n", "\n", - "The following code plots the price and quantities produced by the Stackelberg leader and follower." + "Now let’s use the code to compute and display outcomes as a Stackelberg plan unfolds.\n", + "\n", + "The following code plots quantities chosen by the Stackelberg leader and follower, together with the equilibrium output price." ] }, { "cell_type": "code", "execution_count": null, - "id": "bc36323d", + "id": "bcc8cb79", "metadata": { "hide-output": false }, @@ -1192,12 +1223,12 @@ }, { "cell_type": "markdown", - "id": "532743c1", + "id": "90b26d0e", "metadata": {}, "source": [ "### Value of Stackelberg Leader\n", "\n", - "We’ll compute the present value earned by the Stackelberg leader.\n", + "We’ll compute the value $ w(x_0) $ attained by the Stackelberg leader, where $ x_0 $ is given by the maximizer [(40.10)](#equation-eq-subprob2x0) of subproblem 2.\n", "\n", "We’ll compute it two ways and get the same answer.\n", "\n", @@ -1207,7 +1238,7 @@ { "cell_type": "code", "execution_count": null, - "id": "b3ec0f50", + "id": "a19e88ce", "metadata": { "hide-output": false }, @@ -1225,7 +1256,7 @@ { "cell_type": "code", "execution_count": null, - "id": "3163a385", + "id": "f39fe896", "metadata": { "hide-output": false }, @@ -1239,7 +1270,7 @@ { "cell_type": "code", "execution_count": null, - "id": "1e6065e0", + "id": "6306a8bb", "metadata": { "hide-output": false }, @@ -1254,17 +1285,17 @@ }, { "cell_type": "markdown", - "id": "0a6d579e", + "id": "3dd76c38", "metadata": {}, "source": [ "## Time Inconsistency of Stackelberg Plan\n", "\n", "In the code below we compare two values\n", "\n", - "- the continuation value $ - y_t P y_t $ earned by a continuation\n", - " Stackelberg leader who inherits state $ y_t $ at $ t $ \n", - "- the value of a **reborn Stackelberg leader** who inherits state\n", - " $ z_t $ at $ t $ and sets $ x_t = - P_{22}^{-1} P_{21} $ \n", + "- the continuation value $ v(y_t) = - y_t' P y_t $ earned by a **continuation\n", + " Stackelberg leader** who inherits state $ y_t $ at $ t $ \n", + "- the value $ w(\\hat x_t) $ of a **reborn Stackelberg leader** who, at date $ t $ along the Stackelberg plan, inherits state\n", + " $ z_t $ at $ t $ but who discards $ x_t $ from the time $ t $ continuation of the original Stackelberg plan and **resets** it to $ \\hat x_t = - P_{22}^{-1} P_{21} z_t $ \n", "\n", "\n", "The difference between these two values is a tell-tale sign of the time\n", @@ -1274,7 +1305,7 @@ { "cell_type": "code", "execution_count": null, - "id": "a82753b1", + "id": "eff34d9a", "metadata": { "hide-output": false }, @@ -1295,7 +1326,7 @@ { "cell_type": "code", "execution_count": null, - "id": "37cb6e4f", + "id": "35ac014c", "metadata": { "hide-output": false }, @@ -1306,17 +1337,17 @@ "axes[0].plot(range(n+1), (- F @ yt).flatten(), 'bo',\n", " label='Stackelberg leader', ms=2)\n", "axes[0].plot(range(n+1), (- F @ yt_reset).flatten(), 'ro',\n", - " label='continuation leader at t', ms=2)\n", - "axes[0].set(title=r'Leader control variable $u_{t}$', xlabel='t')\n", + " label='reborn at t Stackelberg leader', ms=2)\n", + "axes[0].set(title=r' $u_{t} = q_{2t+1} - q_t$', xlabel='t')\n", "axes[0].legend()\n", "\n", "axes[1].plot(range(n+1), yt[3, :], 'bo', ms=2)\n", "axes[1].plot(range(n+1), yt_reset[3, :], 'ro', ms=2)\n", - "axes[1].set(title=r'Follower control variable $x_{t}$', xlabel='t')\n", + "axes[1].set(title=r' $x_{t} = q_{1t+1} - q_{1t}$', xlabel='t')\n", "\n", "axes[2].plot(range(n), vt_leader, 'bo', ms=2)\n", "axes[2].plot(range(n), vt_reset_leader, 'ro', ms=2)\n", - "axes[2].set(title=r'Leader value $v(y_{t})$', xlabel='t')\n", + "axes[2].set(title=r'$v(y_{t})$ and $w(\\hat x_t)$', xlabel='t')\n", "\n", "plt.tight_layout()\n", "plt.show()" @@ -1324,7 +1355,22 @@ }, { "cell_type": "markdown", - "id": "89bb564c", + "id": "51f3c995", + "metadata": {}, + "source": [ + "The figure above shows\n", + "\n", + "- in the third panel that for $ t \\geq 1 $ the **reborn at $ t $** Stackelberg leader’s’s value $ w(\\hat x_0) $ exceeds the continuation value $ v(y_t) $ of the time $ 0 $ Stackelberg leader \n", + "- in the first panel that for $ t \\geq 1 $ the **reborn at $ t $** Stackelberg leader wants to reduce his output below that prescribed by the time $ 0 $ Stackelberg leader \n", + "- in the second panel that for $ t \\geq 1 $ the **reborn at $ t $** Stackelberg leader wants to increase the output of the follower firm 2 below that prescribed by the time $ 0 $ Stackelberg leader \n", + "\n", + "\n", + "Taken together, these outcomes express the time inconsistency of the original time $ 0 $ Stackelberg leaders’s plan." + ] + }, + { + "cell_type": "markdown", + "id": "31db2b15", "metadata": {}, "source": [ "## Recursive Formulation of Follower’s Problem\n", @@ -1339,7 +1385,7 @@ { "cell_type": "code", "execution_count": null, - "id": "f8e3db15", + "id": "e23ada14", "metadata": { "hide-output": false }, @@ -1367,7 +1413,7 @@ { "cell_type": "code", "execution_count": null, - "id": "bd487882", + "id": "3627f949", "metadata": { "hide-output": false }, @@ -1384,7 +1430,7 @@ }, { "cell_type": "markdown", - "id": "6a121477", + "id": "829c5496", "metadata": {}, "source": [ "Note: Variables with `_tilde` are obtained from solving the follower’s\n", @@ -1394,7 +1440,7 @@ { "cell_type": "code", "execution_count": null, - "id": "d73c6d01", + "id": "968a9921", "metadata": { "hide-output": false }, @@ -1408,7 +1454,7 @@ { "cell_type": "code", "execution_count": null, - "id": "bcbdd51d", + "id": "5a128df5", "metadata": { "hide-output": false }, @@ -1420,7 +1466,7 @@ }, { "cell_type": "markdown", - "id": "38335a11", + "id": "6e11161e", "metadata": {}, "source": [ "### Explanation of Alignment\n", @@ -1438,7 +1484,7 @@ { "cell_type": "code", "execution_count": null, - "id": "f82ba84a", + "id": "17fa0237", "metadata": { "hide-output": false }, @@ -1451,7 +1497,7 @@ { "cell_type": "code", "execution_count": null, - "id": "2e13e8be", + "id": "477bff65", "metadata": { "hide-output": false }, @@ -1464,7 +1510,7 @@ { "cell_type": "code", "execution_count": null, - "id": "58e1fb4f", + "id": "8a58fe77", "metadata": { "hide-output": false }, @@ -1477,7 +1523,7 @@ { "cell_type": "code", "execution_count": null, - "id": "ee1c2488", + "id": "904c36fb", "metadata": { "hide-output": false }, @@ -1490,7 +1536,7 @@ { "cell_type": "code", "execution_count": null, - "id": "4bef7d34", + "id": "f9124ec6", "metadata": { "hide-output": false }, @@ -1509,7 +1555,7 @@ { "cell_type": "code", "execution_count": null, - "id": "2b936654", + "id": "9d3d4a1b", "metadata": { "hide-output": false }, @@ -1522,7 +1568,7 @@ { "cell_type": "code", "execution_count": null, - "id": "b3c21cb9", + "id": "88753b58", "metadata": { "hide-output": false }, @@ -1535,7 +1581,7 @@ { "cell_type": "code", "execution_count": null, - "id": "391cd78f", + "id": "d32c8af2", "metadata": { "hide-output": false }, @@ -1578,7 +1624,7 @@ { "cell_type": "code", "execution_count": null, - "id": "3aa641ea", + "id": "1e9e9992", "metadata": { "hide-output": false }, @@ -1604,7 +1650,7 @@ { "cell_type": "code", "execution_count": null, - "id": "2e96324e", + "id": "a0186e50", "metadata": { "hide-output": false }, @@ -1616,7 +1662,7 @@ }, { "cell_type": "markdown", - "id": "638254b1", + "id": "e9c69414", "metadata": {}, "source": [ "## Markov Perfect Equilibrium\n", @@ -1656,7 +1702,7 @@ { "cell_type": "code", "execution_count": null, - "id": "c389c006", + "id": "3291b459", "metadata": { "hide-output": false }, @@ -1699,7 +1745,7 @@ { "cell_type": "code", "execution_count": null, - "id": "a9a4fc5e", + "id": "9db6ffef", "metadata": { "hide-output": false }, @@ -1722,7 +1768,7 @@ { "cell_type": "code", "execution_count": null, - "id": "42306365", + "id": "05b25b49", "metadata": { "hide-output": false }, @@ -1735,7 +1781,7 @@ { "cell_type": "code", "execution_count": null, - "id": "8ea52585", + "id": "3757bcef", "metadata": { "hide-output": false }, @@ -1763,7 +1809,7 @@ { "cell_type": "code", "execution_count": null, - "id": "00d8f5fb", + "id": "9f106646", "metadata": { "hide-output": false }, @@ -1781,7 +1827,7 @@ }, { "cell_type": "markdown", - "id": "c61697f9", + "id": "a91cec67", "metadata": {}, "source": [ "## Comparing Markov Perfect Equilibrium and Stackelberg Outcome\n", @@ -1799,7 +1845,7 @@ { "cell_type": "code", "execution_count": null, - "id": "c6a5d4c2", + "id": "a0da9901", "metadata": { "hide-output": false }, @@ -1825,7 +1871,7 @@ { "cell_type": "code", "execution_count": null, - "id": "2eab678e", + "id": "1bac3e29", "metadata": { "hide-output": false }, @@ -1841,7 +1887,7 @@ { "cell_type": "code", "execution_count": null, - "id": "5c6d3c45", + "id": "c3eda7c4", "metadata": { "hide-output": false }, @@ -1853,7 +1899,7 @@ } ], "metadata": { - "date": 1680677524.868336, + "date": 1685490451.8366625, "filename": "dyn_stack.md", "kernelspec": { "display_name": "Python", diff --git a/entropy.ipynb b/entropy.ipynb index 86f3608..595f485 100644 --- a/entropy.ipynb +++ b/entropy.ipynb @@ -2,7 +2,7 @@ "cells": [ { "cell_type": "markdown", - "id": "0c42aefc", + "id": "6740351d", "metadata": {}, "source": [ "# Etymology of Entropy\n", @@ -26,7 +26,7 @@ }, { "cell_type": "markdown", - "id": "17a64e86", + "id": "28f7bbb2", "metadata": {}, "source": [ "## Information Theory\n", @@ -65,7 +65,7 @@ }, { "cell_type": "markdown", - "id": "fc516a4c", + "id": "4121b01d", "metadata": {}, "source": [ "## A Measure of Unpredictability\n", @@ -85,7 +85,7 @@ }, { "cell_type": "markdown", - "id": "a11d9a54", + "id": "e6e89f91", "metadata": {}, "source": [ "### Example\n", @@ -119,7 +119,7 @@ }, { "cell_type": "markdown", - "id": "8db7f28b", + "id": "83d00dee", "metadata": {}, "source": [ "### Example\n", @@ -142,7 +142,7 @@ }, { "cell_type": "markdown", - "id": "c753b51b", + "id": "a7a053df", "metadata": {}, "source": [ "## Mathematical Properties of Entropy\n", @@ -160,7 +160,7 @@ }, { "cell_type": "markdown", - "id": "673a9ec9", + "id": "0f27cd5c", "metadata": {}, "source": [ "## Conditional Entropy\n", @@ -182,7 +182,7 @@ }, { "cell_type": "markdown", - "id": "515a801a", + "id": "0d067555", "metadata": {}, "source": [ "## Independence as Maximum Conditional Entropy\n", @@ -212,7 +212,7 @@ }, { "cell_type": "markdown", - "id": "d2f368c9", + "id": "e360d5f0", "metadata": {}, "source": [ "## Thermodynamics\n", @@ -235,7 +235,7 @@ }, { "cell_type": "markdown", - "id": "ada9df62", + "id": "5529af46", "metadata": {}, "source": [ "## Statistical Divergence\n", @@ -270,7 +270,7 @@ }, { "cell_type": "markdown", - "id": "60ae4cf2", + "id": "e02fd806", "metadata": {}, "source": [ "## Continuous distributions\n", @@ -284,7 +284,7 @@ }, { "cell_type": "markdown", - "id": "6795405d", + "id": "f6664621", "metadata": {}, "source": [ "## Relative entropy and Gaussian distributions\n", @@ -375,7 +375,7 @@ }, { "cell_type": "markdown", - "id": "860615c1", + "id": "e7b533bd", "metadata": {}, "source": [ "## Von Neumann Entropy\n", @@ -401,7 +401,7 @@ }, { "cell_type": "markdown", - "id": "313e713f", + "id": "b5275607", "metadata": {}, "source": [ "## Backus-Chernov-Zin Entropy\n", @@ -453,7 +453,7 @@ }, { "cell_type": "markdown", - "id": "a395ad49", + "id": "857601ed", "metadata": {}, "source": [ "## Wiener-Kolmogorov Prediction Error Formula as Entropy\n", @@ -500,7 +500,7 @@ }, { "cell_type": "markdown", - "id": "34191ade", + "id": "f23baeb8", "metadata": {}, "source": [ "## Multivariate Processes\n", @@ -537,7 +537,7 @@ }, { "cell_type": "markdown", - "id": "4815cbd4", + "id": "fb25a180", "metadata": {}, "source": [ "## Frequency Domain Robust Control\n", @@ -570,7 +570,7 @@ }, { "cell_type": "markdown", - "id": "b4c68ceb", + "id": "8e1782e7", "metadata": {}, "source": [ "## Relative Entropy for a Continuous Random Variable\n", @@ -610,7 +610,7 @@ } ], "metadata": { - "date": 1680677525.1504977, + "date": 1685490452.078611, "filename": "entropy.md", "kernelspec": { "display_name": "Python", diff --git a/estspec.ipynb b/estspec.ipynb index 3897e1f..1d99da4 100644 --- a/estspec.ipynb +++ b/estspec.ipynb @@ -2,7 +2,7 @@ "cells": [ { "cell_type": "markdown", - "id": "88cca633", + "id": "099f6198", "metadata": {}, "source": [ "\n", @@ -11,7 +11,7 @@ }, { "cell_type": "markdown", - "id": "b1af8463", + "id": "030e13c2", "metadata": {}, "source": [ "# Estimation of Spectra\n", @@ -22,7 +22,7 @@ }, { "cell_type": "markdown", - "id": "ff1e4fb7", + "id": "42a0532c", "metadata": {}, "source": [ "## Contents\n", @@ -36,7 +36,7 @@ }, { "cell_type": "markdown", - "id": "f6f72eb4", + "id": "69686122", "metadata": {}, "source": [ "In addition to what’s in Anaconda, this lecture will need the following libraries:" @@ -45,7 +45,7 @@ { "cell_type": "code", "execution_count": null, - "id": "fd6b5600", + "id": "013e9984", "metadata": { "hide-output": false }, @@ -56,7 +56,7 @@ }, { "cell_type": "markdown", - "id": "f6c84fe3", + "id": "cd5af652", "metadata": {}, "source": [ "## Overview\n", @@ -82,7 +82,7 @@ { "cell_type": "code", "execution_count": null, - "id": "a1ced6a8", + "id": "5fe07755", "metadata": { "hide-output": false }, @@ -96,7 +96,7 @@ }, { "cell_type": "markdown", - "id": "c339a8af", + "id": "cc68b2fb", "metadata": {}, "source": [ "\n", @@ -105,7 +105,7 @@ }, { "cell_type": "markdown", - "id": "4a44d03c", + "id": "a0cd541e", "metadata": {}, "source": [ "## Periodograms\n", @@ -158,7 +158,7 @@ }, { "cell_type": "markdown", - "id": "0a09df9b", + "id": "a390ad6e", "metadata": {}, "source": [ "### Interpretation\n", @@ -225,7 +225,7 @@ }, { "cell_type": "markdown", - "id": "18e1e2e8", + "id": "2b342c9b", "metadata": {}, "source": [ "### Calculation\n", @@ -283,7 +283,7 @@ { "cell_type": "code", "execution_count": null, - "id": "cf04dd14", + "id": "8bd9626a", "metadata": { "hide-output": false }, @@ -305,7 +305,7 @@ }, { "cell_type": "markdown", - "id": "099f8bfd", + "id": "d43778a7", "metadata": {}, "source": [ "This estimate looks rather disappointing, but the data size is only 40, so\n", @@ -323,7 +323,7 @@ }, { "cell_type": "markdown", - "id": "e3a89dd9", + "id": "50f16896", "metadata": {}, "source": [ "## Smoothing\n", @@ -376,7 +376,7 @@ { "cell_type": "code", "execution_count": null, - "id": "434674e5", + "id": "0fac24b7", "metadata": { "hide-output": false }, @@ -398,7 +398,7 @@ }, { "cell_type": "markdown", - "id": "ef8e95ad", + "id": "828630a4", "metadata": {}, "source": [ "### Estimation with Smoothing\n", @@ -444,7 +444,7 @@ }, { "cell_type": "markdown", - "id": "94deed92", + "id": "f01ea3e2", "metadata": {}, "source": [ "### Pre-Filtering and Smoothing\n", @@ -494,7 +494,7 @@ }, { "cell_type": "markdown", - "id": "1d13dc89", + "id": "c270c318", "metadata": {}, "source": [ "### The AR(1) Setting\n", @@ -570,7 +570,7 @@ }, { "cell_type": "markdown", - "id": "19f67091", + "id": "319d0842", "metadata": {}, "source": [ "## Exercises\n", @@ -581,7 +581,7 @@ }, { "cell_type": "markdown", - "id": "e161929a", + "id": "3da4bd3b", "metadata": {}, "source": [ "## Exercise 29.1\n", @@ -595,7 +595,7 @@ }, { "cell_type": "markdown", - "id": "6431b9fd", + "id": "c9d1fa99", "metadata": {}, "source": [ "## Solution to[ Exercise 29.1](https://python-advanced.quantecon.org/#est_ex1)" @@ -604,7 +604,7 @@ { "cell_type": "code", "execution_count": null, - "id": "dc01d4d9", + "id": "1dbcec6e", "metadata": { "hide-output": false }, @@ -637,7 +637,7 @@ }, { "cell_type": "markdown", - "id": "b26178ba", + "id": "fed02665", "metadata": {}, "source": [ "\n", @@ -646,7 +646,7 @@ }, { "cell_type": "markdown", - "id": "9c454112", + "id": "331bf63b", "metadata": {}, "source": [ "## Exercise 29.2\n", @@ -661,7 +661,7 @@ }, { "cell_type": "markdown", - "id": "4a88b8e6", + "id": "aec47807", "metadata": {}, "source": [ "## Solution to[ Exercise 29.2](https://python-advanced.quantecon.org/#est_ex2)" @@ -670,7 +670,7 @@ { "cell_type": "code", "execution_count": null, - "id": "fd16f40f", + "id": "b04ba510", "metadata": { "hide-output": false }, @@ -704,7 +704,7 @@ } ], "metadata": { - "date": 1680677525.1859257, + "date": 1685490452.115035, "filename": "estspec.md", "kernelspec": { "display_name": "Python", diff --git a/five_preferences.ipynb b/five_preferences.ipynb index 4f102e6..c9db2b1 100644 --- a/five_preferences.ipynb +++ b/five_preferences.ipynb @@ -2,7 +2,7 @@ "cells": [ { "cell_type": "markdown", - "id": "0f64f514", + "id": "a1900f13", "metadata": {}, "source": [ "# Risk and Model Uncertainty" @@ -10,7 +10,7 @@ }, { "cell_type": "markdown", - "id": "c7a8df78", + "id": "c7c44a35", "metadata": {}, "source": [ "## Overview\n", @@ -56,7 +56,7 @@ { "cell_type": "code", "execution_count": null, - "id": "74ce7d69", + "id": "04e5fa2e", "metadata": { "hide-output": false }, @@ -79,7 +79,7 @@ { "cell_type": "code", "execution_count": null, - "id": "25851880", + "id": "b23c5325", "metadata": { "hide-output": false }, @@ -108,7 +108,7 @@ { "cell_type": "code", "execution_count": null, - "id": "31ce09c5", + "id": "e91f4d77", "metadata": { "hide-output": false }, @@ -166,7 +166,7 @@ }, { "cell_type": "markdown", - "id": "027a8813", + "id": "e370a5d3", "metadata": {}, "source": [ "## Basic objects\n", @@ -231,7 +231,7 @@ { "cell_type": "code", "execution_count": null, - "id": "4bce4c12", + "id": "556d3664", "metadata": { "hide-output": false }, @@ -263,7 +263,7 @@ { "cell_type": "code", "execution_count": null, - "id": "8a83cf41", + "id": "8bab41a5", "metadata": { "hide-output": false }, @@ -278,7 +278,7 @@ }, { "cell_type": "markdown", - "id": "d849ef61", + "id": "bb1ba4d6", "metadata": {}, "source": [ "The heat maps in the next two figures vary both $ \\hat{\\pi}_1 $ and $ \\pi_1 $.\n", @@ -289,7 +289,7 @@ { "cell_type": "code", "execution_count": null, - "id": "8a55f938", + "id": "4d1f514a", "metadata": { "hide-output": false }, @@ -318,7 +318,7 @@ { "cell_type": "code", "execution_count": null, - "id": "26e04cc7", + "id": "4eac57cd", "metadata": { "hide-output": false }, @@ -336,7 +336,7 @@ }, { "cell_type": "markdown", - "id": "79182ed7", + "id": "cc2b5256", "metadata": {}, "source": [ "The next figure plots the logarithm of entropy." @@ -345,7 +345,7 @@ { "cell_type": "code", "execution_count": null, - "id": "63f4bab3", + "id": "2a61fdfd", "metadata": { "hide-output": false }, @@ -360,7 +360,7 @@ { "cell_type": "code", "execution_count": null, - "id": "b067a5e3", + "id": "69c0d43e", "metadata": { "hide-output": false }, @@ -377,7 +377,7 @@ }, { "cell_type": "markdown", - "id": "95601179", + "id": "eab46434", "metadata": {}, "source": [ "## Five preference specifications\n", @@ -402,7 +402,7 @@ }, { "cell_type": "markdown", - "id": "e42ca232", + "id": "e26cdaff", "metadata": {}, "source": [ "## Expected utility\n", @@ -424,7 +424,7 @@ }, { "cell_type": "markdown", - "id": "e4c5c7ba", + "id": "0df69aa5", "metadata": {}, "source": [ "## Constraint preferences\n", @@ -549,7 +549,7 @@ }, { "cell_type": "markdown", - "id": "718147ef", + "id": "97acf2fd", "metadata": {}, "source": [ "## Multiplier preferences\n", @@ -612,7 +612,7 @@ }, { "cell_type": "markdown", - "id": "d8ec9c4a", + "id": "0716df8d", "metadata": {}, "source": [ "## Risk-sensitive preferences\n", @@ -641,7 +641,7 @@ { "cell_type": "code", "execution_count": null, - "id": "de8c6569", + "id": "6ec78799", "metadata": { "hide-output": false }, @@ -673,7 +673,7 @@ { "cell_type": "code", "execution_count": null, - "id": "924701dc", + "id": "d7d4906e", "metadata": { "hide-output": false }, @@ -689,7 +689,7 @@ }, { "cell_type": "markdown", - "id": "e88926dd", + "id": "690ed81c", "metadata": {}, "source": [ "For large values of $ \\theta $, $ {\\sf T} u(c) $ is approximately linear in the probability $ \\pi_1 $, but for lower values of $ \\theta $, $ {\\sf T} u(c) $ has considerable curvature as a function of $ \\pi_1 $.\n", @@ -704,7 +704,7 @@ { "cell_type": "code", "execution_count": null, - "id": "d1c538df", + "id": "0d3fe69c", "metadata": { "hide-output": false }, @@ -747,7 +747,7 @@ { "cell_type": "code", "execution_count": null, - "id": "d7d814eb", + "id": "0dbf4947", "metadata": { "hide-output": false }, @@ -790,7 +790,7 @@ }, { "cell_type": "markdown", - "id": "92045baf", + "id": "a3d2498b", "metadata": {}, "source": [ "The panel on the right portrays how the transformation $ \\exp\\left(\\frac{-u\\left(c\\right)}{\\theta}\\right) $ sends $ u\\left(c\\right) $ to a new function by (i) flipping the sign, and (ii) increasing curvature in proportion to $ \\theta $.\n", @@ -811,7 +811,7 @@ }, { "cell_type": "markdown", - "id": "b784166c", + "id": "3c4de2ac", "metadata": {}, "source": [ "### Digression on moment generating functions\n", @@ -863,7 +863,7 @@ }, { "cell_type": "markdown", - "id": "b0f8e088", + "id": "cbdca20f", "metadata": {}, "source": [ "## Ex post Bayesian preferences\n", @@ -883,7 +883,7 @@ }, { "cell_type": "markdown", - "id": "7c50b95c", + "id": "40b6c238", "metadata": {}, "source": [ "## Comparing preferences\n", @@ -908,7 +908,7 @@ { "cell_type": "code", "execution_count": null, - "id": "c7f75a6f", + "id": "491f209e", "metadata": { "hide-output": false }, @@ -938,7 +938,7 @@ { "cell_type": "code", "execution_count": null, - "id": "3901f6ec", + "id": "2c2b05b3", "metadata": { "hide-output": false }, @@ -957,7 +957,7 @@ }, { "cell_type": "markdown", - "id": "5369cf9d", + "id": "8ed0d2a7", "metadata": {}, "source": [ "The next figure shows the function $ \\sum_{i=1}^I \\pi_i m_i [ u(c_i) + \\theta \\log m_i ] $ that is to be\n", @@ -969,7 +969,7 @@ { "cell_type": "code", "execution_count": null, - "id": "f9ba8c7a", + "id": "9f3fba75", "metadata": { "hide-output": false }, @@ -997,7 +997,7 @@ { "cell_type": "code", "execution_count": null, - "id": "140f4c91", + "id": "be9676e7", "metadata": { "hide-output": false }, @@ -1035,7 +1035,7 @@ }, { "cell_type": "markdown", - "id": "a98fe33d", + "id": "ed1f71c2", "metadata": {}, "source": [ "Evidently, from this figure and also from formula [(24.12)](#equation-tom12), lower values of $ \\theta $ lead to lower,\n", @@ -1063,7 +1063,7 @@ }, { "cell_type": "markdown", - "id": "e7d084fd", + "id": "4d50f889", "metadata": {}, "source": [ "## Risk aversion and misspecification aversion\n", @@ -1114,7 +1114,7 @@ }, { "cell_type": "markdown", - "id": "cbb1767c", + "id": "716d1027", "metadata": {}, "source": [ "## Indifference curves\n", @@ -1158,7 +1158,7 @@ { "cell_type": "code", "execution_count": null, - "id": "cd44c428", + "id": "76ef7d46", "metadata": { "hide-output": false }, @@ -1279,7 +1279,7 @@ { "cell_type": "code", "execution_count": null, - "id": "ff3be45a", + "id": "88946318", "metadata": { "hide-output": false }, @@ -1327,7 +1327,7 @@ { "cell_type": "code", "execution_count": null, - "id": "0de7550c", + "id": "13e8d891", "metadata": { "hide-output": false }, @@ -1355,7 +1355,7 @@ }, { "cell_type": "markdown", - "id": "a563f1ef", + "id": "60cbaf2b", "metadata": {}, "source": [ "**Kink at 45 degree line**\n", @@ -1425,7 +1425,7 @@ { "cell_type": "code", "execution_count": null, - "id": "fb742e3e", + "id": "728f055b", "metadata": { "hide-output": false }, @@ -1474,7 +1474,7 @@ { "cell_type": "code", "execution_count": null, - "id": "65d7991f", + "id": "5e681089", "metadata": { "hide-output": false }, @@ -1502,7 +1502,7 @@ }, { "cell_type": "markdown", - "id": "3533b2ab", + "id": "2bb4f6c4", "metadata": {}, "source": [ "Note that all three lines of the left graph intersect at (1, 3). While the intersection at (3, 1) is hard-coded, the intersection at (1,3) arises from the computation, which confirms that the code seems to be\n", @@ -1539,7 +1539,7 @@ }, { "cell_type": "markdown", - "id": "5169d118", + "id": "303534e7", "metadata": {}, "source": [ "## State price deflators\n", @@ -1579,7 +1579,7 @@ { "cell_type": "code", "execution_count": null, - "id": "ea86b34e", + "id": "d87870d0", "metadata": { "hide-output": false }, @@ -1609,7 +1609,7 @@ { "cell_type": "code", "execution_count": null, - "id": "6fc4e8e4", + "id": "881f06c9", "metadata": { "hide-output": false }, @@ -1632,7 +1632,7 @@ }, { "cell_type": "markdown", - "id": "e479b803", + "id": "7d5f3472", "metadata": {}, "source": [ "Because budget constraints are linear, asset prices are identical under\n", @@ -1650,7 +1650,7 @@ }, { "cell_type": "markdown", - "id": "433e188f", + "id": "dbd53527", "metadata": {}, "source": [ "### Consumption-equivalent measures of uncertainty aversion\n", @@ -1665,7 +1665,7 @@ { "cell_type": "code", "execution_count": null, - "id": "27c924d1", + "id": "e86c14ff", "metadata": { "hide-output": false }, @@ -1697,7 +1697,7 @@ { "cell_type": "code", "execution_count": null, - "id": "62f56946", + "id": "d8884ca7", "metadata": { "hide-output": false }, @@ -1734,7 +1734,7 @@ }, { "cell_type": "markdown", - "id": "55ca164a", + "id": "a2f80044", "metadata": {}, "source": [ "The figure indicates that the certainty equivalent\n", @@ -1762,7 +1762,7 @@ }, { "cell_type": "markdown", - "id": "3647225f", + "id": "e3935d14", "metadata": {}, "source": [ "## Iso-utility and iso-entropy curves and expansion paths\n", @@ -1796,7 +1796,7 @@ { "cell_type": "code", "execution_count": null, - "id": "cb7473fd", + "id": "54d0ca2a", "metadata": { "hide-output": false }, @@ -1845,7 +1845,7 @@ { "cell_type": "code", "execution_count": null, - "id": "2a00e7d1", + "id": "97ef5f5a", "metadata": { "hide-output": false }, @@ -1920,7 +1920,7 @@ { "cell_type": "code", "execution_count": null, - "id": "d8a07f61", + "id": "786e04c5", "metadata": { "hide-output": false }, @@ -1934,7 +1934,7 @@ { "cell_type": "code", "execution_count": null, - "id": "45ee3273", + "id": "340b448a", "metadata": { "hide-output": false }, @@ -1947,7 +1947,7 @@ }, { "cell_type": "markdown", - "id": "97e94377", + "id": "a8975520", "metadata": {}, "source": [ "## Bounds on expected utility\n", @@ -2010,7 +2010,7 @@ { "cell_type": "code", "execution_count": null, - "id": "3f138af4", + "id": "18ba7cff", "metadata": { "hide-output": false }, @@ -2076,7 +2076,7 @@ { "cell_type": "code", "execution_count": null, - "id": "db37abbc", + "id": "17f7cc40", "metadata": { "hide-output": false }, @@ -2103,7 +2103,7 @@ { "cell_type": "code", "execution_count": null, - "id": "4637a8dc", + "id": "26a4e4c5", "metadata": { "hide-output": false }, @@ -2119,7 +2119,7 @@ { "cell_type": "code", "execution_count": null, - "id": "ab0e373a", + "id": "593bded3", "metadata": { "hide-output": false }, @@ -2136,7 +2136,7 @@ }, { "cell_type": "markdown", - "id": "7bd805ed", + "id": "27cb829b", "metadata": {}, "source": [ "In this figure, expected utility is on the co-ordinate axis\n", @@ -2186,7 +2186,7 @@ }, { "cell_type": "markdown", - "id": "34ac38d8", + "id": "6fbe977d", "metadata": {}, "source": [ "## Why entropy?\n", @@ -2204,7 +2204,7 @@ }, { "cell_type": "markdown", - "id": "a53030c9", + "id": "2a8ad601", "metadata": {}, "source": [ "### Entropy and statistical detection\n", @@ -2252,7 +2252,7 @@ { "cell_type": "code", "execution_count": null, - "id": "21e62d7e", + "id": "cf62f273", "metadata": { "hide-output": false }, @@ -2270,7 +2270,7 @@ { "cell_type": "code", "execution_count": null, - "id": "530590bd", + "id": "34b0eb83", "metadata": { "hide-output": false }, @@ -2298,7 +2298,7 @@ { "cell_type": "code", "execution_count": null, - "id": "9fe95269", + "id": "8d751e30", "metadata": { "hide-output": false }, @@ -2321,7 +2321,7 @@ { "cell_type": "code", "execution_count": null, - "id": "03fb6f94", + "id": "1401c0de", "metadata": { "hide-output": false }, @@ -2332,7 +2332,7 @@ }, { "cell_type": "markdown", - "id": "727e2922", + "id": "41218b9d", "metadata": {}, "source": [ "The density for the approximating model is\n", @@ -2352,7 +2352,7 @@ }, { "cell_type": "markdown", - "id": "b593e411", + "id": "aac197af", "metadata": {}, "source": [ "### Axiomatic justifications\n", @@ -2368,7 +2368,7 @@ } ], "metadata": { - "date": 1680677525.2940261, + "date": 1685490452.222244, "filename": "five_preferences.md", "kernelspec": { "display_name": "Python", diff --git a/growth_in_dles.ipynb b/growth_in_dles.ipynb index d881ee2..0feef1f 100644 --- a/growth_in_dles.ipynb +++ b/growth_in_dles.ipynb @@ -2,7 +2,7 @@ "cells": [ { "cell_type": "markdown", - "id": "a7451b77", + "id": "bc18d6ec", "metadata": {}, "source": [ "\n", @@ -13,7 +13,7 @@ }, { "cell_type": "markdown", - "id": "57b2dfa9", + "id": "f9ae2aca", "metadata": {}, "source": [ "# Growth in Dynamic Linear Economies" @@ -21,7 +21,7 @@ }, { "cell_type": "markdown", - "id": "b22aa010", + "id": "3328c06e", "metadata": {}, "source": [ "## Contents\n", @@ -34,7 +34,7 @@ }, { "cell_type": "markdown", - "id": "4a561f2d", + "id": "a90e306a", "metadata": {}, "source": [ "This is another member of a suite of lectures that use the quantecon DLE class to instantiate models within the\n", @@ -46,7 +46,7 @@ { "cell_type": "code", "execution_count": null, - "id": "a956759a", + "id": "232eff0e", "metadata": { "hide-output": false }, @@ -57,7 +57,7 @@ }, { "cell_type": "markdown", - "id": "4a2597d2", + "id": "2de9e629", "metadata": {}, "source": [ "This lecture describes several complete market economies having a\n", @@ -74,7 +74,7 @@ { "cell_type": "code", "execution_count": null, - "id": "4bf88eb8", + "id": "9a707e2d", "metadata": { "hide-output": false }, @@ -88,7 +88,7 @@ }, { "cell_type": "markdown", - "id": "e3894c37", + "id": "3b832131", "metadata": {}, "source": [ "## Common Structure\n", @@ -152,7 +152,7 @@ }, { "cell_type": "markdown", - "id": "01353784", + "id": "8fa220cc", "metadata": {}, "source": [ "## A Planning Problem\n", @@ -235,7 +235,7 @@ }, { "cell_type": "markdown", - "id": "e94f9505", + "id": "60a312f4", "metadata": {}, "source": [ "## Example Economies\n", @@ -320,7 +320,7 @@ }, { "cell_type": "markdown", - "id": "9fd16112", + "id": "42403cee", "metadata": {}, "source": [ "### Example 1: Hall (1978)\n", @@ -353,7 +353,7 @@ { "cell_type": "code", "execution_count": null, - "id": "d9cb3215", + "id": "6799122f", "metadata": { "hide-output": false }, @@ -396,7 +396,7 @@ }, { "cell_type": "markdown", - "id": "9a9cc3a5", + "id": "1d667409", "metadata": {}, "source": [ "These parameter values are used to define an economy of the DLE class." @@ -405,7 +405,7 @@ { "cell_type": "code", "execution_count": null, - "id": "6d025786", + "id": "f4545baa", "metadata": { "hide-output": false }, @@ -416,7 +416,7 @@ }, { "cell_type": "markdown", - "id": "a8e3390d", + "id": "3fab3f98", "metadata": {}, "source": [ "We can then simulate the economy for a chosen length of time, from our\n", @@ -426,7 +426,7 @@ { "cell_type": "code", "execution_count": null, - "id": "64b1258d", + "id": "8fa825a0", "metadata": { "hide-output": false }, @@ -437,7 +437,7 @@ }, { "cell_type": "markdown", - "id": "08ebae9c", + "id": "c4a68e91", "metadata": {}, "source": [ "The economy stores the simulated values for each variable. Below we plot\n", @@ -447,7 +447,7 @@ { "cell_type": "code", "execution_count": null, - "id": "c7c6e1a9", + "id": "5c3af0be", "metadata": { "hide-output": false }, @@ -462,7 +462,7 @@ }, { "cell_type": "markdown", - "id": "d3230535", + "id": "8ec1e147", "metadata": {}, "source": [ "Inspection of the plot shows that the sample paths of consumption and\n", @@ -475,7 +475,7 @@ { "cell_type": "code", "execution_count": null, - "id": "1cf00d4d", + "id": "df154fb3", "metadata": { "hide-output": false }, @@ -486,7 +486,7 @@ }, { "cell_type": "markdown", - "id": "f4d9005d", + "id": "0356d636", "metadata": {}, "source": [ "The endogenous eigenvalue that appears to be unity reflects the random\n", @@ -499,7 +499,7 @@ { "cell_type": "code", "execution_count": null, - "id": "65744c75", + "id": "0859d018", "metadata": { "hide-output": false }, @@ -510,7 +510,7 @@ }, { "cell_type": "markdown", - "id": "6a6af4f3", + "id": "ce990e66", "metadata": {}, "source": [ "The fact that the largest endogenous eigenvalue is strictly less than\n", @@ -521,7 +521,7 @@ { "cell_type": "code", "execution_count": null, - "id": "55b15af1", + "id": "9acf7fc4", "metadata": { "hide-output": false }, @@ -534,7 +534,7 @@ }, { "cell_type": "markdown", - "id": "7b01caec", + "id": "8cb2ad48", "metadata": {}, "source": [ "However, the near-unity endogenous eigenvalue means that these steady\n", @@ -543,7 +543,7 @@ }, { "cell_type": "markdown", - "id": "fc58b286", + "id": "1dd35a15", "metadata": {}, "source": [ "### Example 2: Altered Growth Condition\n", @@ -577,7 +577,7 @@ { "cell_type": "code", "execution_count": null, - "id": "69bb9179", + "id": "88addd52", "metadata": { "hide-output": false }, @@ -596,7 +596,7 @@ }, { "cell_type": "markdown", - "id": "141dd3c5", + "id": "4ab355c3", "metadata": {}, "source": [ "Creating the DLE class and then simulating gives the following plot for\n", @@ -606,7 +606,7 @@ { "cell_type": "code", "execution_count": null, - "id": "df4a1b6a", + "id": "43ba55db", "metadata": { "hide-output": false }, @@ -624,7 +624,7 @@ }, { "cell_type": "markdown", - "id": "b965b513", + "id": "406f0b83", "metadata": {}, "source": [ "Simulating our new economy shows that consumption grows quickly in the\n", @@ -637,7 +637,7 @@ { "cell_type": "code", "execution_count": null, - "id": "3b97faa7", + "id": "5659a624", "metadata": { "hide-output": false }, @@ -649,7 +649,7 @@ }, { "cell_type": "markdown", - "id": "e7f656f3", + "id": "fafaa8c8", "metadata": {}, "source": [ "The economy converges faster to this level than in Example 1 because the\n", @@ -660,7 +660,7 @@ { "cell_type": "code", "execution_count": null, - "id": "715f0666", + "id": "11fc0122", "metadata": { "hide-output": false }, @@ -671,7 +671,7 @@ }, { "cell_type": "markdown", - "id": "edf94274", + "id": "2c8bdc31", "metadata": {}, "source": [ "### Example 3: A Jones-Manuelli (1990) Economy\n", @@ -719,7 +719,7 @@ { "cell_type": "code", "execution_count": null, - "id": "e6a33853", + "id": "e523983a", "metadata": { "hide-output": false }, @@ -732,7 +732,7 @@ { "cell_type": "code", "execution_count": null, - "id": "30f9af47", + "id": "a6164eca", "metadata": { "hide-output": false }, @@ -743,7 +743,7 @@ }, { "cell_type": "markdown", - "id": "0bc8173b", + "id": "8d28d31c", "metadata": {}, "source": [ "We simulate this economy from the original state vector" @@ -752,7 +752,7 @@ { "cell_type": "code", "execution_count": null, - "id": "6a649224", + "id": "0b7d927f", "metadata": { "hide-output": false }, @@ -769,7 +769,7 @@ }, { "cell_type": "markdown", - "id": "88dd62d3", + "id": "b0668323", "metadata": {}, "source": [ "Thus, adding habit persistence to the Hall model of Example 1 is enough\n", @@ -782,7 +782,7 @@ { "cell_type": "code", "execution_count": null, - "id": "8706fb38", + "id": "a0e6b3df", "metadata": { "hide-output": false }, @@ -793,7 +793,7 @@ }, { "cell_type": "markdown", - "id": "31b77028", + "id": "b92de787", "metadata": {}, "source": [ "We now have two unit endogenous eigenvalues. One stems from satisfying\n", @@ -807,7 +807,7 @@ }, { "cell_type": "markdown", - "id": "61906792", + "id": "8c8d05cd", "metadata": {}, "source": [ "### Example 3.1: Varying Sensitivity\n", @@ -818,7 +818,7 @@ { "cell_type": "code", "execution_count": null, - "id": "771837b9", + "id": "5449d687", "metadata": { "hide-output": false }, @@ -839,7 +839,7 @@ }, { "cell_type": "markdown", - "id": "94a811f2", + "id": "ec4759a4", "metadata": {}, "source": [ "We no longer achieve sustained growth if $ \\lambda $ is raised from -1 to -0.7.\n", @@ -851,7 +851,7 @@ { "cell_type": "code", "execution_count": null, - "id": "fcb36797", + "id": "fa02fa57", "metadata": { "hide-output": false }, @@ -862,7 +862,7 @@ }, { "cell_type": "markdown", - "id": "e99f77a6", + "id": "45682701", "metadata": {}, "source": [ "### Example 3.2: More Impatience\n", @@ -873,7 +873,7 @@ { "cell_type": "code", "execution_count": null, - "id": "890c823b", + "id": "d0b44956", "metadata": { "hide-output": false }, @@ -894,7 +894,7 @@ }, { "cell_type": "markdown", - "id": "8fa22448", + "id": "03e2761f", "metadata": {}, "source": [ "Growth also fails if we lower $ \\beta $, since we now have\n", @@ -911,7 +911,7 @@ { "cell_type": "code", "execution_count": null, - "id": "cb1dac22", + "id": "2f05e3e7", "metadata": { "hide-output": false }, @@ -922,7 +922,7 @@ } ], "metadata": { - "date": 1680677525.3327065, + "date": 1685490452.2615921, "filename": "growth_in_dles.md", "kernelspec": { "display_name": "Python", diff --git a/hs_invertibility_example.ipynb b/hs_invertibility_example.ipynb index 332b333..af3636e 100644 --- a/hs_invertibility_example.ipynb +++ b/hs_invertibility_example.ipynb @@ -2,7 +2,7 @@ "cells": [ { "cell_type": "markdown", - "id": "81b0d786", + "id": "e9226c5f", "metadata": {}, "source": [ "\n", @@ -13,7 +13,7 @@ }, { "cell_type": "markdown", - "id": "6e9452e9", + "id": "68293d84", "metadata": {}, "source": [ "# Shock Non Invertibility" @@ -21,7 +21,7 @@ }, { "cell_type": "markdown", - "id": "c6dcd238", + "id": "c77f6622", "metadata": {}, "source": [ "## Contents\n", @@ -34,7 +34,7 @@ }, { "cell_type": "markdown", - "id": "42386cbd", + "id": "23cd2c7a", "metadata": {}, "source": [ "## Overview\n", @@ -48,7 +48,7 @@ { "cell_type": "code", "execution_count": null, - "id": "dfa296cd", + "id": "09037cea", "metadata": { "hide-output": false }, @@ -59,7 +59,7 @@ }, { "cell_type": "markdown", - "id": "0b410ece", + "id": "cddcc522", "metadata": {}, "source": [ "We’ll make these imports:" @@ -68,7 +68,7 @@ { "cell_type": "code", "execution_count": null, - "id": "0b7ced57", + "id": "4d246aee", "metadata": { "hide-output": false }, @@ -85,7 +85,7 @@ }, { "cell_type": "markdown", - "id": "4c6ca13c", + "id": "4ce68373", "metadata": {}, "source": [ "This lecture describes an early contribution to what is now often called\n", @@ -111,7 +111,7 @@ }, { "cell_type": "markdown", - "id": "7928da22", + "id": "4b84c0f5", "metadata": {}, "source": [ "## Model\n", @@ -206,7 +206,7 @@ { "cell_type": "code", "execution_count": null, - "id": "2b40dc1c", + "id": "8f5a9d18", "metadata": { "hide-output": false }, @@ -244,7 +244,7 @@ }, { "cell_type": "markdown", - "id": "948be568", + "id": "04ff2077", "metadata": {}, "source": [ "We define the household’s net of interest deficit as $ c_t - d_t $.\n", @@ -315,7 +315,7 @@ }, { "cell_type": "markdown", - "id": "dd71c168", + "id": "82509cd4", "metadata": {}, "source": [ "## Code\n", @@ -327,7 +327,7 @@ { "cell_type": "code", "execution_count": null, - "id": "18810797", + "id": "c2cdbd18", "metadata": { "hide-output": false }, @@ -355,7 +355,7 @@ }, { "cell_type": "markdown", - "id": "8cb06b5c", + "id": "a4f2e2c4", "metadata": {}, "source": [ "The above figure displays the impulse response of consumption and the\n", @@ -375,7 +375,7 @@ { "cell_type": "code", "execution_count": null, - "id": "4021d8c0", + "id": "a241fa24", "metadata": { "hide-output": false }, @@ -425,7 +425,7 @@ }, { "cell_type": "markdown", - "id": "4a76281b", + "id": "d585f2c1", "metadata": {}, "source": [ "The above figure displays the impulse response of consumption and the\n", @@ -445,7 +445,7 @@ { "cell_type": "code", "execution_count": null, - "id": "6d5c207f", + "id": "dbe2865c", "metadata": { "hide-output": false }, @@ -482,7 +482,7 @@ }, { "cell_type": "markdown", - "id": "3ec53f2d", + "id": "30fe25ce", "metadata": {}, "source": [ "The above figure displays the impulse responses of $ u_t $ to\n", @@ -503,7 +503,7 @@ } ], "metadata": { - "date": 1680677525.3556733, + "date": 1685490452.2856295, "filename": "hs_invertibility_example.md", "kernelspec": { "display_name": "Python", diff --git a/hs_recursive_models.ipynb b/hs_recursive_models.ipynb index 2adf48c..4f98dbb 100644 --- a/hs_recursive_models.ipynb +++ b/hs_recursive_models.ipynb @@ -2,7 +2,7 @@ "cells": [ { "cell_type": "markdown", - "id": "39bd937f", + "id": "16f81822", "metadata": {}, "source": [ "\n", @@ -13,7 +13,7 @@ }, { "cell_type": "markdown", - "id": "1fbbe63a", + "id": "c2939d7c", "metadata": {}, "source": [ "# Recursive Models of Dynamic Linear Economies" @@ -21,7 +21,7 @@ }, { "cell_type": "markdown", - "id": "8479f6d0", + "id": "c10106fc", "metadata": {}, "source": [ "## Contents\n", @@ -43,7 +43,7 @@ }, { "cell_type": "markdown", - "id": "a748b1ba", + "id": "9cc44a80", "metadata": {}, "source": [ "> “Mathematics is the art of giving the same name to different things” – Henri Poincare\n", @@ -57,7 +57,7 @@ }, { "cell_type": "markdown", - "id": "bd50e671", + "id": "f62659a5", "metadata": {}, "source": [ "## A Suite of Models\n", @@ -80,7 +80,7 @@ }, { "cell_type": "markdown", - "id": "1dd8a6b0", + "id": "c9bc4b23", "metadata": {}, "source": [ "### Overview of the Models\n", @@ -151,7 +151,7 @@ }, { "cell_type": "markdown", - "id": "c2991fe6", + "id": "b49e38b1", "metadata": {}, "source": [ "### Forecasting?\n", @@ -168,7 +168,7 @@ }, { "cell_type": "markdown", - "id": "9b0a1f0f", + "id": "9e2556bd", "metadata": {}, "source": [ "### Theory and Econometrics\n", @@ -193,7 +193,7 @@ }, { "cell_type": "markdown", - "id": "05c03084", + "id": "7948796a", "metadata": {}, "source": [ "### More Details\n", @@ -276,7 +276,7 @@ }, { "cell_type": "markdown", - "id": "28d97459", + "id": "65678208", "metadata": {}, "source": [ "### Stochastic Model of Information Flows and Outcomes\n", @@ -318,7 +318,7 @@ }, { "cell_type": "markdown", - "id": "0ef4c2b3", + "id": "ebbeaf04", "metadata": {}, "source": [ "### Information Sets\n", @@ -332,7 +332,7 @@ }, { "cell_type": "markdown", - "id": "ad737c29", + "id": "74576631", "metadata": {}, "source": [ "### Prediction Theory\n", @@ -408,7 +408,7 @@ }, { "cell_type": "markdown", - "id": "4a7ce3a1", + "id": "2ee03fa2", "metadata": {}, "source": [ "### Orthogonal Decomposition\n", @@ -441,7 +441,7 @@ }, { "cell_type": "markdown", - "id": "808ad4f9", + "id": "2c18cb42", "metadata": {}, "source": [ "### Taste and Technology Shocks\n", @@ -482,7 +482,7 @@ }, { "cell_type": "markdown", - "id": "cf2c162f", + "id": "827b3a47", "metadata": {}, "source": [ "### Production Technology\n", @@ -507,7 +507,7 @@ }, { "cell_type": "markdown", - "id": "34fbfd18", + "id": "5a37ec78", "metadata": {}, "source": [ "### Household Technology\n", @@ -534,7 +534,7 @@ }, { "cell_type": "markdown", - "id": "9df5ddf3", + "id": "7d49103e", "metadata": {}, "source": [ "### Preferences\n", @@ -564,7 +564,7 @@ }, { "cell_type": "markdown", - "id": "686e074b", + "id": "f50a5cdc", "metadata": {}, "source": [ "### Endowment Economy\n", @@ -612,7 +612,7 @@ }, { "cell_type": "markdown", - "id": "d9773f28", + "id": "7260daa7", "metadata": {}, "source": [ "### Single-Period Adjustment Costs\n", @@ -926,7 +926,7 @@ }, { "cell_type": "markdown", - "id": "1d02b5bc", + "id": "0223265c", "metadata": {}, "source": [ "### Optimal Resource Allocation\n", @@ -979,7 +979,7 @@ }, { "cell_type": "markdown", - "id": "d65afc27", + "id": "a31386d9", "metadata": {}, "source": [ "### Lagrangian Formulation\n", @@ -1098,7 +1098,7 @@ }, { "cell_type": "markdown", - "id": "cf998d78", + "id": "9c5c2cee", "metadata": {}, "source": [ "### Dynamic Programming\n", @@ -1314,7 +1314,7 @@ }, { "cell_type": "markdown", - "id": "1a67eea5", + "id": "c38313d0", "metadata": {}, "source": [ "### Other mathematical infrastructure\n", @@ -1343,7 +1343,7 @@ }, { "cell_type": "markdown", - "id": "9b7c1737", + "id": "86715c00", "metadata": {}, "source": [ "### Representative Household\n", @@ -1380,7 +1380,7 @@ }, { "cell_type": "markdown", - "id": "ae365f9c", + "id": "69e765ac", "metadata": {}, "source": [ "### Type I Firm\n", @@ -1410,7 +1410,7 @@ }, { "cell_type": "markdown", - "id": "b84719bf", + "id": "c5f02b48", "metadata": {}, "source": [ "### Type II Firm\n", @@ -1438,7 +1438,7 @@ }, { "cell_type": "markdown", - "id": "53aaae84", + "id": "13566fe2", "metadata": {}, "source": [ "### Competitive Equilibrium: Definition\n", @@ -1501,7 +1501,7 @@ }, { "cell_type": "markdown", - "id": "33c11928", + "id": "a69e6b05", "metadata": {}, "source": [ "### Asset pricing\n", @@ -1549,7 +1549,7 @@ }, { "cell_type": "markdown", - "id": "f42836ef", + "id": "519c8026", "metadata": {}, "source": [ "### Re-Opening Markets\n", @@ -1595,7 +1595,7 @@ }, { "cell_type": "markdown", - "id": "15a8f601", + "id": "c99872bb", "metadata": {}, "source": [ "## Econometrics\n", @@ -1708,7 +1708,7 @@ }, { "cell_type": "markdown", - "id": "c95b281d", + "id": "6a8b8d2b", "metadata": {}, "source": [ "### Factorization of Likelihood Function\n", @@ -1735,7 +1735,7 @@ }, { "cell_type": "markdown", - "id": "d693a80d", + "id": "b2304a9d", "metadata": {}, "source": [ "### Covariance Generating Functions\n", @@ -1748,7 +1748,7 @@ }, { "cell_type": "markdown", - "id": "b42d2bc1", + "id": "76d64ba4", "metadata": {}, "source": [ "### Spectral Factorization Identity\n", @@ -1792,7 +1792,7 @@ }, { "cell_type": "markdown", - "id": "20a6cc09", + "id": "281e5176", "metadata": {}, "source": [ "### Wold and Vector Autoregressive Representations\n", @@ -1834,7 +1834,7 @@ }, { "cell_type": "markdown", - "id": "3f33a42d", + "id": "c6301633", "metadata": {}, "source": [ "## Dynamic Demand Curves and Canonical Household Technologies" @@ -1842,7 +1842,7 @@ }, { "cell_type": "markdown", - "id": "43de82bb", + "id": "9db5aa6f", "metadata": {}, "source": [ "### Canonical Household Technologies\n", @@ -1890,7 +1890,7 @@ }, { "cell_type": "markdown", - "id": "869bc500", + "id": "ddd4396e", "metadata": {}, "source": [ "### Dynamic Demand Functions\n", @@ -1943,7 +1943,7 @@ }, { "cell_type": "markdown", - "id": "0d95037b", + "id": "c402cd86", "metadata": {}, "source": [ "## Gorman Aggregation and Engel Curves\n", @@ -1973,7 +1973,7 @@ }, { "cell_type": "markdown", - "id": "d85c9a84", + "id": "c5c2db91", "metadata": {}, "source": [ "### Re-Opened Markets\n", @@ -2017,7 +2017,7 @@ }, { "cell_type": "markdown", - "id": "d576e7ef", + "id": "d3f7b8a1", "metadata": {}, "source": [ "### Dynamic Demand\n", @@ -2045,7 +2045,7 @@ }, { "cell_type": "markdown", - "id": "290e02d8", + "id": "b8c6db0a", "metadata": {}, "source": [ "### Attaining a Canonical Household Technology\n", @@ -2071,7 +2071,7 @@ }, { "cell_type": "markdown", - "id": "643047e5", + "id": "118416e2", "metadata": {}, "source": [ "## Partial Equilibrium\n", @@ -2141,7 +2141,7 @@ }, { "cell_type": "markdown", - "id": "83de9c0d", + "id": "43739d8b", "metadata": {}, "source": [ "## Equilibrium Investment Under Uncertainty\n", @@ -2178,7 +2178,7 @@ }, { "cell_type": "markdown", - "id": "6235c8ed", + "id": "fa7960ad", "metadata": {}, "source": [ "## A Rosen-Topel Housing Model\n", @@ -2227,7 +2227,7 @@ }, { "cell_type": "markdown", - "id": "f7fd9738", + "id": "1f51ad2b", "metadata": {}, "source": [ "## Cattle Cycles\n", @@ -2297,7 +2297,7 @@ }, { "cell_type": "markdown", - "id": "f854f2de", + "id": "ce05f6bc", "metadata": {}, "source": [ "## Models of Occupational Choice and Pay\n", @@ -2310,7 +2310,7 @@ }, { "cell_type": "markdown", - "id": "07152256", + "id": "0ad6ce3d", "metadata": {}, "source": [ "### Market for Engineers\n", @@ -2387,7 +2387,7 @@ }, { "cell_type": "markdown", - "id": "a1030b43", + "id": "d9ba7c09", "metadata": {}, "source": [ "### Skilled and Unskilled Workers\n", @@ -2450,7 +2450,7 @@ }, { "cell_type": "markdown", - "id": "f0799211", + "id": "8276b4d9", "metadata": {}, "source": [ "## Permanent Income Models\n", @@ -2528,7 +2528,7 @@ }, { "cell_type": "markdown", - "id": "663e6b4d", + "id": "33805228", "metadata": {}, "source": [ "## Gorman Heterogeneous Households\n", @@ -2628,7 +2628,7 @@ }, { "cell_type": "markdown", - "id": "17d64129", + "id": "7d230dd0", "metadata": {}, "source": [ "## Non-Gorman Heterogeneous Households\n", @@ -2812,7 +2812,7 @@ } ], "metadata": { - "date": 1680677525.466812, + "date": 1685490452.397977, "filename": "hs_recursive_models.md", "kernelspec": { "display_name": "Python", diff --git a/intro.ipynb b/intro.ipynb index ead805c..c8960f0 100644 --- a/intro.ipynb +++ b/intro.ipynb @@ -2,7 +2,7 @@ "cells": [ { "cell_type": "markdown", - "id": "2049eace", + "id": "2aa86dbd", "metadata": {}, "source": [ "# Advanced Quantitative Economics with Python\n", @@ -15,7 +15,7 @@ }, { "cell_type": "markdown", - "id": "5d735099", + "id": "ef43fb1a", "metadata": {}, "source": [ "# Tools and Techniques\n", @@ -28,7 +28,7 @@ }, { "cell_type": "markdown", - "id": "9744e869", + "id": "379772e3", "metadata": {}, "source": [ "# LQ Control\n", @@ -45,7 +45,7 @@ }, { "cell_type": "markdown", - "id": "d178328d", + "id": "3de6de39", "metadata": {}, "source": [ "# Multiple Agent Models\n", @@ -57,7 +57,7 @@ }, { "cell_type": "markdown", - "id": "f908b742", + "id": "914263ab", "metadata": {}, "source": [ "# Dynamic Linear Economies\n", @@ -74,7 +74,7 @@ }, { "cell_type": "markdown", - "id": "c2b31b24", + "id": "a08a24d5", "metadata": {}, "source": [ "# Risk, Model Uncertainty, and Robustness\n", @@ -87,7 +87,7 @@ }, { "cell_type": "markdown", - "id": "1b8aac43", + "id": "19a967c5", "metadata": {}, "source": [ "# Time Series Models\n", @@ -102,7 +102,7 @@ }, { "cell_type": "markdown", - "id": "affef18a", + "id": "394735b5", "metadata": {}, "source": [ "# Asset Pricing and Finance\n", @@ -116,7 +116,7 @@ }, { "cell_type": "markdown", - "id": "ac262d75", + "id": "3b3fccc2", "metadata": {}, "source": [ "# Dynamic Programming Squared\n", @@ -134,7 +134,7 @@ }, { "cell_type": "markdown", - "id": "b80ca527", + "id": "a0dbfca6", "metadata": {}, "source": [ "# Other\n", @@ -146,7 +146,7 @@ }, { "cell_type": "markdown", - "id": "fa396af7", + "id": "e4814e65", "metadata": {}, "source": [ "# Previous website\n", @@ -156,7 +156,7 @@ } ], "metadata": { - "date": 1680677525.7289388, + "date": 1685490452.4409819, "filename": "intro.md", "kernelspec": { "display_name": "Python", diff --git a/irfs_in_hall_model.ipynb b/irfs_in_hall_model.ipynb index c53c7f6..02d1fb4 100644 --- a/irfs_in_hall_model.ipynb +++ b/irfs_in_hall_model.ipynb @@ -2,7 +2,7 @@ "cells": [ { "cell_type": "markdown", - "id": "52f4f8ff", + "id": "e7ed43a3", "metadata": {}, "source": [ "\n", @@ -13,7 +13,7 @@ }, { "cell_type": "markdown", - "id": "2a49de94", + "id": "a97343c2", "metadata": {}, "source": [ "# IRFs in Hall Models" @@ -21,7 +21,7 @@ }, { "cell_type": "markdown", - "id": "26dd969d", + "id": "71da9dee", "metadata": {}, "source": [ "## Contents\n", @@ -34,7 +34,7 @@ }, { "cell_type": "markdown", - "id": "87228059", + "id": "f73e6f56", "metadata": {}, "source": [ "This is another member of a suite of lectures that use the quantecon DLE class to instantiate models within the\n", @@ -46,7 +46,7 @@ { "cell_type": "code", "execution_count": null, - "id": "e1c08aa2", + "id": "1fe4b423", "metadata": { "hide-output": false }, @@ -57,7 +57,7 @@ }, { "cell_type": "markdown", - "id": "6b6ee7d5", + "id": "9ce62269", "metadata": {}, "source": [ "We’ll make these imports:" @@ -66,7 +66,7 @@ { "cell_type": "code", "execution_count": null, - "id": "3cbec7e2", + "id": "ad69cdc9", "metadata": { "hide-output": false }, @@ -81,7 +81,7 @@ }, { "cell_type": "markdown", - "id": "6bf813cf", + "id": "4b61450e", "metadata": {}, "source": [ "This lecture shows how the DLE class can be used to create impulse\n", @@ -95,7 +95,7 @@ }, { "cell_type": "markdown", - "id": "2bd250d5", + "id": "aed0ae4e", "metadata": {}, "source": [ "## Example 1: Hall (1978)\n", @@ -131,7 +131,7 @@ { "cell_type": "code", "execution_count": null, - "id": "eeabbee6", + "id": "d0798dbf", "metadata": { "hide-output": false }, @@ -168,7 +168,7 @@ }, { "cell_type": "markdown", - "id": "29bdc00f", + "id": "7f89e942", "metadata": {}, "source": [ "These parameter values are used to define an economy of the DLE class.\n", @@ -183,7 +183,7 @@ { "cell_type": "code", "execution_count": null, - "id": "39047dba", + "id": "7799c94f", "metadata": { "hide-output": false }, @@ -201,7 +201,7 @@ }, { "cell_type": "markdown", - "id": "d1c5d2a2", + "id": "b55634b6", "metadata": {}, "source": [ "The DLE class can be used to create impulse response functions for each\n", @@ -218,7 +218,7 @@ { "cell_type": "code", "execution_count": null, - "id": "43ec7f78", + "id": "1babd37f", "metadata": { "hide-output": false }, @@ -234,7 +234,7 @@ }, { "cell_type": "markdown", - "id": "b8c75891", + "id": "6cdbcf7c", "metadata": {}, "source": [ "It can be seen that the endowment shock has permanent effects on the\n", @@ -247,7 +247,7 @@ }, { "cell_type": "markdown", - "id": "d058e28a", + "id": "b0e86a30", "metadata": {}, "source": [ "## Example 2: Higher Adjustment Costs\n", @@ -263,7 +263,7 @@ { "cell_type": "code", "execution_count": null, - "id": "c9425308", + "id": "d7aeac94", "metadata": { "hide-output": false }, @@ -286,7 +286,7 @@ { "cell_type": "code", "execution_count": null, - "id": "57083ba7", + "id": "251c44b3", "metadata": { "hide-output": false }, @@ -303,7 +303,7 @@ { "cell_type": "code", "execution_count": null, - "id": "fdaa019d", + "id": "509d2185", "metadata": { "hide-output": false }, @@ -315,7 +315,7 @@ { "cell_type": "code", "execution_count": null, - "id": "5b0fbf91", + "id": "3a9b56a8", "metadata": { "hide-output": false }, @@ -327,7 +327,7 @@ }, { "cell_type": "markdown", - "id": "4d8c8bb4", + "id": "6d3c07a6", "metadata": {}, "source": [ "The first graph shows that there seems to be a downward trend in both\n", @@ -350,7 +350,7 @@ }, { "cell_type": "markdown", - "id": "1204295a", + "id": "0607da14", "metadata": {}, "source": [ "## Example 3: Durable Consumption Goods\n", @@ -391,7 +391,7 @@ { "cell_type": "code", "execution_count": null, - "id": "4e8c2ad3", + "id": "e3f0368f", "metadata": { "hide-output": false }, @@ -423,7 +423,7 @@ }, { "cell_type": "markdown", - "id": "65b47c26", + "id": "ecf0283f", "metadata": {}, "source": [ "In contrast to Hall’s original model of Example 1, it is now investment\n", @@ -436,7 +436,7 @@ { "cell_type": "code", "execution_count": null, - "id": "2dd368f7", + "id": "1739c0ee", "metadata": { "hide-output": false }, @@ -452,7 +452,7 @@ }, { "cell_type": "markdown", - "id": "6230b742", + "id": "4975d198", "metadata": {}, "source": [ "The impulse response functions confirm that consumption is now much more\n", @@ -465,7 +465,7 @@ } ], "metadata": { - "date": 1680677525.7492938, + "date": 1685490452.4590886, "filename": "irfs_in_hall_model.md", "kernelspec": { "display_name": "Python", diff --git a/knowing_forecasts_of_others.ipynb b/knowing_forecasts_of_others.ipynb index c2280f1..4c7e307 100644 --- a/knowing_forecasts_of_others.ipynb +++ b/knowing_forecasts_of_others.ipynb @@ -2,7 +2,7 @@ "cells": [ { "cell_type": "markdown", - "id": "98940788", + "id": "20394933", "metadata": {}, "source": [ "\n", @@ -11,7 +11,7 @@ }, { "cell_type": "markdown", - "id": "1130ce10", + "id": "1424ce1f", "metadata": {}, "source": [ "# Knowing the Forecasts of Others" @@ -19,7 +19,7 @@ }, { "cell_type": "markdown", - "id": "b24460ac", + "id": "6f4b87d0", "metadata": {}, "source": [ "## Contents\n", @@ -41,7 +41,7 @@ }, { "cell_type": "markdown", - "id": "bc7e94a3", + "id": "1f9d0e0d", "metadata": {}, "source": [ "In addition to what’s in Anaconda, this lecture will need the following libraries:" @@ -50,7 +50,7 @@ { "cell_type": "code", "execution_count": null, - "id": "4ecb0850", + "id": "259b5656", "metadata": { "hide-output": false }, @@ -62,7 +62,7 @@ }, { "cell_type": "markdown", - "id": "b6c0aea2", + "id": "64587d36", "metadata": {}, "source": [ "## Introduction\n", @@ -130,7 +130,7 @@ }, { "cell_type": "markdown", - "id": "fff05a99", + "id": "83518c5e", "metadata": {}, "source": [ "### A Sequence of Models\n", @@ -163,7 +163,7 @@ }, { "cell_type": "markdown", - "id": "a960d84f", + "id": "9bc046e1", "metadata": {}, "source": [ "## The Setting\n", @@ -250,7 +250,7 @@ }, { "cell_type": "markdown", - "id": "d7175111", + "id": "d976099c", "metadata": {}, "source": [ "## Tactics\n", @@ -350,7 +350,7 @@ }, { "cell_type": "markdown", - "id": "445d588a", + "id": "f191f533", "metadata": {}, "source": [ "## Equilibrium Conditions\n", @@ -445,7 +445,7 @@ }, { "cell_type": "markdown", - "id": "7e34f916", + "id": "8f8fa5c1", "metadata": {}, "source": [ "### Equilibrium under perfect foresight\n", @@ -525,7 +525,7 @@ }, { "cell_type": "markdown", - "id": "9f5e8e17", + "id": "17745926", "metadata": {}, "source": [ "## Equilibrium with $ \\theta_t $ stochastic but observed at $ t $\n", @@ -590,7 +590,7 @@ }, { "cell_type": "markdown", - "id": "011d6ce5", + "id": "464b7963", "metadata": {}, "source": [ "### Filtering" @@ -598,7 +598,7 @@ }, { "cell_type": "markdown", - "id": "7ef670a0", + "id": "a8fccd05", "metadata": {}, "source": [ "#### One noisy signal\n", @@ -670,7 +670,7 @@ }, { "cell_type": "markdown", - "id": "d13bb0ba", + "id": "40c62be7", "metadata": {}, "source": [ "#### State-reconstruction error\n", @@ -749,7 +749,7 @@ }, { "cell_type": "markdown", - "id": "33d89ff4", + "id": "0ae1c337", "metadata": {}, "source": [ "### A new state variable\n", @@ -788,7 +788,7 @@ }, { "cell_type": "markdown", - "id": "e65544e5", + "id": "c53802f4", "metadata": {}, "source": [ "### Two Noisy Signals\n", @@ -881,7 +881,7 @@ }, { "cell_type": "markdown", - "id": "e8b728b8", + "id": "af35969b", "metadata": {}, "source": [ "## Guess-and-Verify Tactic\n", @@ -912,7 +912,7 @@ }, { "cell_type": "markdown", - "id": "c4edd778", + "id": "86cdc192", "metadata": {}, "source": [ "## Equilibrium with One Noisy Signal on $ \\theta_t $" @@ -920,7 +920,7 @@ }, { "cell_type": "markdown", - "id": "5efc247e", + "id": "0032f199", "metadata": {}, "source": [ "### Step 1: Solve for $ \\tilde{\\lambda} $ and $ \\lambda $\n", @@ -939,7 +939,7 @@ }, { "cell_type": "markdown", - "id": "91e0cb87", + "id": "64de5b95", "metadata": {}, "source": [ "### Step 2: Solve for $ p $\n", @@ -972,7 +972,7 @@ }, { "cell_type": "markdown", - "id": "9a4aef6a", + "id": "c7673e33", "metadata": {}, "source": [ "### Step 3: Represent the system using `quantecon.LinearStateSpace`\n", @@ -1054,7 +1054,7 @@ { "cell_type": "code", "execution_count": null, - "id": "8a536b6b", + "id": "604aa1be", "metadata": { "hide-output": false }, @@ -1075,7 +1075,7 @@ { "cell_type": "code", "execution_count": null, - "id": "e8d1100f", + "id": "5ed2c693", "metadata": { "hide-output": false }, @@ -1091,7 +1091,7 @@ { "cell_type": "code", "execution_count": null, - "id": "c73f26b0", + "id": "741ea819", "metadata": { "hide-output": false }, @@ -1107,7 +1107,7 @@ { "cell_type": "code", "execution_count": null, - "id": "660fdee4", + "id": "4cec76d5", "metadata": { "hide-output": false }, @@ -1121,7 +1121,7 @@ { "cell_type": "code", "execution_count": null, - "id": "397c39bd", + "id": "42ea6389", "metadata": { "hide-output": false }, @@ -1140,7 +1140,7 @@ { "cell_type": "code", "execution_count": null, - "id": "8bdc6b4a", + "id": "0055ae81", "metadata": { "hide-output": false }, @@ -1154,7 +1154,7 @@ { "cell_type": "code", "execution_count": null, - "id": "cf96b14d", + "id": "66069181", "metadata": { "hide-output": false }, @@ -1187,7 +1187,7 @@ { "cell_type": "code", "execution_count": null, - "id": "1738d291", + "id": "4e557f24", "metadata": { "hide-output": false }, @@ -1201,7 +1201,7 @@ { "cell_type": "code", "execution_count": null, - "id": "902b4a91", + "id": "f56b9191", "metadata": { "hide-output": false }, @@ -1214,7 +1214,7 @@ { "cell_type": "code", "execution_count": null, - "id": "cbd28052", + "id": "e5a42eac", "metadata": { "hide-output": false }, @@ -1226,7 +1226,7 @@ }, { "cell_type": "markdown", - "id": "2eadd981", + "id": "e8ef77bc", "metadata": {}, "source": [ "### Step 4: Compute impulse response functions\n", @@ -1238,7 +1238,7 @@ { "cell_type": "code", "execution_count": null, - "id": "e07e8d64", + "id": "56d01cdb", "metadata": { "hide-output": false }, @@ -1261,7 +1261,7 @@ }, { "cell_type": "markdown", - "id": "70d4f43e", + "id": "84edd865", "metadata": {}, "source": [ "### Step 5: Compute stationary covariance matrices and population regressions\n", @@ -1295,7 +1295,7 @@ { "cell_type": "code", "execution_count": null, - "id": "15e6669d", + "id": "74c9adcd", "metadata": { "hide-output": false }, @@ -1320,7 +1320,7 @@ { "cell_type": "code", "execution_count": null, - "id": "98c7f1e4", + "id": "c3eacd12", "metadata": { "hide-output": false }, @@ -1334,7 +1334,7 @@ { "cell_type": "code", "execution_count": null, - "id": "297d5f62", + "id": "df856fb7", "metadata": { "hide-output": false }, @@ -1349,7 +1349,7 @@ { "cell_type": "code", "execution_count": null, - "id": "5bd2ed8d", + "id": "efb1cfe9", "metadata": { "hide-output": false }, @@ -1362,7 +1362,7 @@ { "cell_type": "code", "execution_count": null, - "id": "bd51168e", + "id": "65bc6546", "metadata": { "hide-output": false }, @@ -1376,7 +1376,7 @@ }, { "cell_type": "markdown", - "id": "5935a8ab", + "id": "e0ff4c64", "metadata": {}, "source": [ "## Equilibrium with Two Noisy Signals on $ \\theta_t $\n", @@ -1480,7 +1480,7 @@ { "cell_type": "code", "execution_count": null, - "id": "6325e4e1", + "id": "10300e15", "metadata": { "hide-output": false }, @@ -1499,7 +1499,7 @@ { "cell_type": "code", "execution_count": null, - "id": "36a08cf6", + "id": "f6984f8f", "metadata": { "hide-output": false }, @@ -1513,7 +1513,7 @@ { "cell_type": "code", "execution_count": null, - "id": "6a630be0", + "id": "c5731754", "metadata": { "hide-output": false }, @@ -1553,7 +1553,7 @@ { "cell_type": "code", "execution_count": null, - "id": "b11ce96c", + "id": "857897cf", "metadata": { "hide-output": false }, @@ -1567,7 +1567,7 @@ { "cell_type": "code", "execution_count": null, - "id": "147e3447", + "id": "698d1a38", "metadata": { "hide-output": false }, @@ -1580,7 +1580,7 @@ { "cell_type": "code", "execution_count": null, - "id": "4631e3c1", + "id": "8d751d74", "metadata": { "hide-output": false }, @@ -1592,7 +1592,7 @@ { "cell_type": "code", "execution_count": null, - "id": "85f32fed", + "id": "b1752de9", "metadata": { "hide-output": false }, @@ -1616,7 +1616,7 @@ { "cell_type": "code", "execution_count": null, - "id": "f579f1ef", + "id": "11fd3e73", "metadata": { "hide-output": false }, @@ -1641,7 +1641,7 @@ { "cell_type": "code", "execution_count": null, - "id": "08830b18", + "id": "21f81265", "metadata": { "hide-output": false }, @@ -1655,7 +1655,7 @@ { "cell_type": "code", "execution_count": null, - "id": "b68fc56f", + "id": "56c2f256", "metadata": { "hide-output": false }, @@ -1670,7 +1670,7 @@ { "cell_type": "code", "execution_count": null, - "id": "36e56c75", + "id": "d6ba53bb", "metadata": { "hide-output": false }, @@ -1683,7 +1683,7 @@ { "cell_type": "code", "execution_count": null, - "id": "d4feb1ef", + "id": "2e05276c", "metadata": { "hide-output": false }, @@ -1709,7 +1709,7 @@ { "cell_type": "code", "execution_count": null, - "id": "85619352", + "id": "c5f46472", "metadata": { "hide-output": false }, @@ -1722,7 +1722,7 @@ }, { "cell_type": "markdown", - "id": "4648daa1", + "id": "6f18412f", "metadata": {}, "source": [ "## Key Step\n", @@ -1740,7 +1740,7 @@ { "cell_type": "code", "execution_count": null, - "id": "7da8175a", + "id": "c6049124", "metadata": { "hide-output": false }, @@ -1759,7 +1759,7 @@ { "cell_type": "code", "execution_count": null, - "id": "132acf6d", + "id": "33fda223", "metadata": { "hide-output": false }, @@ -1770,7 +1770,7 @@ }, { "cell_type": "markdown", - "id": "4213b414", + "id": "89125d80", "metadata": {}, "source": [ "The $ R^2 $ in this regression equals $ 1 $.\n", @@ -1783,7 +1783,7 @@ }, { "cell_type": "markdown", - "id": "04d4e6bb", + "id": "f7c6cde9", "metadata": {}, "source": [ "## An observed common shock benchmark\n", @@ -1846,7 +1846,7 @@ { "cell_type": "code", "execution_count": null, - "id": "0bb70042", + "id": "401d758e", "metadata": { "hide-output": false }, @@ -1863,7 +1863,7 @@ { "cell_type": "code", "execution_count": null, - "id": "01ff252d", + "id": "23796dbc", "metadata": { "hide-output": false }, @@ -1876,7 +1876,7 @@ }, { "cell_type": "markdown", - "id": "09b79948", + "id": "df44024a", "metadata": {}, "source": [ "Now let’s form and plot an impulse response function of $ k_t^i $ to shocks $ v_t $ to $ \\theta_{t+1} $" @@ -1885,7 +1885,7 @@ { "cell_type": "code", "execution_count": null, - "id": "96017c69", + "id": "2366afe5", "metadata": { "hide-output": false }, @@ -1907,7 +1907,7 @@ }, { "cell_type": "markdown", - "id": "8bebdaaf", + "id": "e809a7ce", "metadata": {}, "source": [ "## Comparison of All Signal Structures\n", @@ -1922,7 +1922,7 @@ { "cell_type": "code", "execution_count": null, - "id": "dbd9d9ba", + "id": "3ceeeaf4", "metadata": { "hide-output": false }, @@ -1946,7 +1946,7 @@ }, { "cell_type": "markdown", - "id": "1652d2c7", + "id": "d8765646", "metadata": {}, "source": [ "The three panels in the graph above show that\n", @@ -1973,7 +1973,7 @@ { "cell_type": "code", "execution_count": null, - "id": "4bb512bc", + "id": "76f84f0c", "metadata": { "hide-output": false }, @@ -1986,7 +1986,7 @@ }, { "cell_type": "markdown", - "id": "635383e3", + "id": "0b3e0762", "metadata": {}, "source": [ "Kalman gains for the two\n", @@ -1996,7 +1996,7 @@ { "cell_type": "code", "execution_count": null, - "id": "04bc2b78", + "id": "c8ffbc3a", "metadata": { "hide-output": false }, @@ -2009,7 +2009,7 @@ }, { "cell_type": "markdown", - "id": "417f3a22", + "id": "57bfdfa1", "metadata": {}, "source": [ "Another lesson that comes from the preceding three-panel graph is that the presence of iid noise\n", @@ -2018,7 +2018,7 @@ }, { "cell_type": "markdown", - "id": "6fdf9251", + "id": "4938d950", "metadata": {}, "source": [ "## Notes on History of the Problem\n", @@ -2078,7 +2078,7 @@ }, { "cell_type": "markdown", - "id": "8641b86b", + "id": "6e8a9a2e", "metadata": {}, "source": [ "### Further historical remarks\n", @@ -2146,7 +2146,7 @@ } ], "metadata": { - "date": 1680677525.869328, + "date": 1685490452.7577474, "filename": "knowing_forecasts_of_others.md", "kernelspec": { "display_name": "Python", diff --git a/lqramsey.ipynb b/lqramsey.ipynb index 0a3499b..997c0a5 100644 --- a/lqramsey.ipynb +++ b/lqramsey.ipynb @@ -2,7 +2,7 @@ "cells": [ { "cell_type": "markdown", - "id": "ec1003e2", + "id": "5220738b", "metadata": {}, "source": [ "\n", @@ -11,7 +11,7 @@ }, { "cell_type": "markdown", - "id": "ef517dc2", + "id": "3d2ca9e8", "metadata": {}, "source": [ "# Optimal Taxation in an LQ Economy\n", @@ -22,7 +22,7 @@ }, { "cell_type": "markdown", - "id": "7ae9d07a", + "id": "e7dc2471", "metadata": {}, "source": [ "## Contents\n", @@ -37,7 +37,7 @@ }, { "cell_type": "markdown", - "id": "b3b0f236", + "id": "6a448cb7", "metadata": {}, "source": [ "In addition to what’s in Anaconda, this lecture will need the following libraries:" @@ -46,7 +46,7 @@ { "cell_type": "code", "execution_count": null, - "id": "dcd27d46", + "id": "ea9d842a", "metadata": { "hide-output": false }, @@ -57,7 +57,7 @@ }, { "cell_type": "markdown", - "id": "3e608b3b", + "id": "a39e8e84", "metadata": {}, "source": [ "## Overview\n", @@ -95,7 +95,7 @@ { "cell_type": "code", "execution_count": null, - "id": "5a0157fe", + "id": "d29f82d6", "metadata": { "hide-output": false }, @@ -114,7 +114,7 @@ }, { "cell_type": "markdown", - "id": "85b7ee45", + "id": "3023b0fa", "metadata": {}, "source": [ "### Model Features\n", @@ -127,7 +127,7 @@ }, { "cell_type": "markdown", - "id": "0107c57a", + "id": "5e9f9f18", "metadata": {}, "source": [ "## The Ramsey Problem\n", @@ -137,7 +137,7 @@ }, { "cell_type": "markdown", - "id": "307228f1", + "id": "9be3cdde", "metadata": {}, "source": [ "### Technology\n", @@ -153,7 +153,7 @@ }, { "cell_type": "markdown", - "id": "d7c643bb", + "id": "9a060f92", "metadata": {}, "source": [ "### Households\n", @@ -209,7 +209,7 @@ }, { "cell_type": "markdown", - "id": "13fcdee9", + "id": "db9aa0ac", "metadata": {}, "source": [ "### Government\n", @@ -225,7 +225,7 @@ }, { "cell_type": "markdown", - "id": "657e10a7", + "id": "627187e8", "metadata": {}, "source": [ "### Exogenous Variables\n", @@ -252,7 +252,7 @@ }, { "cell_type": "markdown", - "id": "ff976a54", + "id": "bbf8719f", "metadata": {}, "source": [ "### Feasibility\n", @@ -270,7 +270,7 @@ }, { "cell_type": "markdown", - "id": "a83b0c2e", + "id": "14caccba", "metadata": {}, "source": [ "### Government Budget Constraint\n", @@ -287,7 +287,7 @@ }, { "cell_type": "markdown", - "id": "3aae5db5", + "id": "0fd6900e", "metadata": {}, "source": [ "### Equilibrium\n", @@ -321,7 +321,7 @@ }, { "cell_type": "markdown", - "id": "4462e82f", + "id": "2867e6fe", "metadata": {}, "source": [ "### Solution\n", @@ -442,7 +442,7 @@ }, { "cell_type": "markdown", - "id": "269f0aaa", + "id": "b0f367fd", "metadata": {}, "source": [ "### Computing the Quadratic Term\n", @@ -515,7 +515,7 @@ }, { "cell_type": "markdown", - "id": "1b646198", + "id": "f4c8c2e8", "metadata": {}, "source": [ "### Finite State Markov Case\n", @@ -557,7 +557,7 @@ }, { "cell_type": "markdown", - "id": "9a0801c9", + "id": "4dce5a59", "metadata": {}, "source": [ "### Other Variables\n", @@ -631,7 +631,7 @@ }, { "cell_type": "markdown", - "id": "28503d09", + "id": "6051ac69", "metadata": {}, "source": [ "### A Martingale\n", @@ -695,7 +695,7 @@ }, { "cell_type": "markdown", - "id": "5685984d", + "id": "7f3ec3fa", "metadata": {}, "source": [ "## Implementation\n", @@ -712,7 +712,7 @@ { "cell_type": "code", "execution_count": null, - "id": "69ef26b7", + "id": "bacd58d4", "metadata": { "hide-output": false }, @@ -980,7 +980,7 @@ }, { "cell_type": "markdown", - "id": "2c40aee2", + "id": "781bf479", "metadata": {}, "source": [ "### Comments on the Code\n", @@ -1008,7 +1008,7 @@ }, { "cell_type": "markdown", - "id": "54c9db31", + "id": "8f85443b", "metadata": {}, "source": [ "## Examples\n", @@ -1021,7 +1021,7 @@ }, { "cell_type": "markdown", - "id": "78fc5bbb", + "id": "1a8476d8", "metadata": {}, "source": [ "### The Continuous Case\n", @@ -1048,7 +1048,7 @@ { "cell_type": "code", "execution_count": null, - "id": "a6fecd7f", + "id": "86c69322", "metadata": { "hide-output": false }, @@ -1076,7 +1076,7 @@ }, { "cell_type": "markdown", - "id": "6b87f875", + "id": "de459c87", "metadata": {}, "source": [ "The legends on the figures indicate the variables being tracked.\n", @@ -1088,7 +1088,7 @@ { "cell_type": "code", "execution_count": null, - "id": "289a0314", + "id": "3079f221", "metadata": { "hide-output": false }, @@ -1099,7 +1099,7 @@ }, { "cell_type": "markdown", - "id": "05524f69", + "id": "6b6daf18", "metadata": {}, "source": [ "### The Discrete Case\n", @@ -1110,7 +1110,7 @@ { "cell_type": "code", "execution_count": null, - "id": "39231398", + "id": "69968790", "metadata": { "hide-output": false }, @@ -1145,7 +1145,7 @@ }, { "cell_type": "markdown", - "id": "b000d8be", + "id": "95b9ba1b", "metadata": {}, "source": [ "The call `gen_fig_2(path)` generates" @@ -1154,7 +1154,7 @@ { "cell_type": "code", "execution_count": null, - "id": "39b16501", + "id": "78088e2f", "metadata": { "hide-output": false }, @@ -1165,7 +1165,7 @@ }, { "cell_type": "markdown", - "id": "43e4f935", + "id": "f23d5f7b", "metadata": {}, "source": [ "## Exercises\n", @@ -1176,7 +1176,7 @@ }, { "cell_type": "markdown", - "id": "da2141d1", + "id": "747523e6", "metadata": {}, "source": [ "## Exercise 12.1\n", @@ -1194,7 +1194,7 @@ }, { "cell_type": "markdown", - "id": "8d3f156b", + "id": "da18ea22", "metadata": {}, "source": [ "## Solution to[ Exercise 12.1](https://python-advanced.quantecon.org/#lq_ex1)" @@ -1203,7 +1203,7 @@ { "cell_type": "code", "execution_count": null, - "id": "faa37dfa", + "id": "4d3e66a6", "metadata": { "hide-output": false }, @@ -1237,7 +1237,7 @@ { "cell_type": "code", "execution_count": null, - "id": "3af0925a", + "id": "886736cd", "metadata": { "hide-output": false }, @@ -1248,7 +1248,7 @@ } ], "metadata": { - "date": 1680677525.9247503, + "date": 1685490452.8124762, "filename": "lqramsey.md", "kernelspec": { "display_name": "Python", diff --git a/lu_tricks.ipynb b/lu_tricks.ipynb index e6445bf..3d1a22c 100644 --- a/lu_tricks.ipynb +++ b/lu_tricks.ipynb @@ -2,7 +2,7 @@ "cells": [ { "cell_type": "markdown", - "id": "b422ef39", + "id": "de760754", "metadata": {}, "source": [ "\n", @@ -11,7 +11,7 @@ }, { "cell_type": "markdown", - "id": "038d3c41", + "id": "f11b7982", "metadata": {}, "source": [ "# Classical Control with Linear Algebra" @@ -19,7 +19,7 @@ }, { "cell_type": "markdown", - "id": "588b9a35", + "id": "c63d4a1c", "metadata": {}, "source": [ "## Contents\n", @@ -36,7 +36,7 @@ }, { "cell_type": "markdown", - "id": "7ba4e89e", + "id": "3eb7f7f1", "metadata": {}, "source": [ "## Overview\n", @@ -77,7 +77,7 @@ { "cell_type": "code", "execution_count": null, - "id": "ca743bd0", + "id": "27756c27", "metadata": { "hide-output": false }, @@ -90,7 +90,7 @@ }, { "cell_type": "markdown", - "id": "b674872f", + "id": "3da221a2", "metadata": {}, "source": [ "### References\n", @@ -100,7 +100,7 @@ }, { "cell_type": "markdown", - "id": "0ab311e4", + "id": "d2f8cfe8", "metadata": {}, "source": [ "## A Control Problem\n", @@ -141,7 +141,7 @@ }, { "cell_type": "markdown", - "id": "d94b0288", + "id": "32165b23", "metadata": {}, "source": [ "### Example\n", @@ -183,7 +183,7 @@ }, { "cell_type": "markdown", - "id": "8d56c413", + "id": "301d1204", "metadata": {}, "source": [ "## Finite Horizon Theory\n", @@ -313,7 +313,7 @@ }, { "cell_type": "markdown", - "id": "83fff53e", + "id": "ba898197", "metadata": {}, "source": [ "### Matrix Methods\n", @@ -323,7 +323,7 @@ }, { "cell_type": "markdown", - "id": "5143c8f9", + "id": "4e6b6417", "metadata": {}, "source": [ "#### A Single Lag Term\n", @@ -422,7 +422,7 @@ }, { "cell_type": "markdown", - "id": "bfca5140", + "id": "0fb51592", "metadata": {}, "source": [ "#### An Alternative Representation\n", @@ -515,7 +515,7 @@ }, { "cell_type": "markdown", - "id": "5959b546", + "id": "3c58387a", "metadata": {}, "source": [ "#### Additional Lag Terms\n", @@ -634,7 +634,7 @@ }, { "cell_type": "markdown", - "id": "a2f64196", + "id": "1cafae90", "metadata": {}, "source": [ "## Infinite Horizon Limit\n", @@ -864,7 +864,7 @@ }, { "cell_type": "markdown", - "id": "fb738270", + "id": "b5000b20", "metadata": {}, "source": [ "## Undiscounted Problems\n", @@ -906,7 +906,7 @@ }, { "cell_type": "markdown", - "id": "5abe4f19", + "id": "a743f2d2", "metadata": {}, "source": [ "### Transforming Discounted to Undiscounted Problem\n", @@ -991,7 +991,7 @@ }, { "cell_type": "markdown", - "id": "87356e9b", + "id": "2a2d683b", "metadata": {}, "source": [ "## Implementation\n", @@ -1003,7 +1003,7 @@ { "cell_type": "code", "execution_count": null, - "id": "faff8606", + "id": "1370f33a", "metadata": { "hide-output": false }, @@ -1319,7 +1319,7 @@ }, { "cell_type": "markdown", - "id": "12920ebb", + "id": "6e101365", "metadata": {}, "source": [ "### Example\n", @@ -1352,7 +1352,7 @@ { "cell_type": "code", "execution_count": null, - "id": "9964d5d0", + "id": "bcce2d4a", "metadata": { "hide-output": false }, @@ -1392,7 +1392,7 @@ }, { "cell_type": "markdown", - "id": "5a69b3cf", + "id": "8d10cb0c", "metadata": {}, "source": [ "Here’s what happens when we change $ \\gamma $ to 5.0" @@ -1401,7 +1401,7 @@ { "cell_type": "code", "execution_count": null, - "id": "85a96173", + "id": "2383e0ae", "metadata": { "hide-output": false }, @@ -1412,7 +1412,7 @@ }, { "cell_type": "markdown", - "id": "529b9d6b", + "id": "16b21906", "metadata": {}, "source": [ "And here’s $ \\gamma = 10 $" @@ -1421,7 +1421,7 @@ { "cell_type": "code", "execution_count": null, - "id": "22cb7eda", + "id": "928b9819", "metadata": { "hide-output": false }, @@ -1432,7 +1432,7 @@ }, { "cell_type": "markdown", - "id": "decf3976", + "id": "1b582ef7", "metadata": {}, "source": [ "## Exercises" @@ -1440,7 +1440,7 @@ }, { "cell_type": "markdown", - "id": "31860b5f", + "id": "956c5ccb", "metadata": {}, "source": [ "## Exercise 31.1\n", @@ -1486,7 +1486,7 @@ }, { "cell_type": "markdown", - "id": "d9d94df0", + "id": "8d5af520", "metadata": {}, "source": [ "## Exercise 31.2\n", @@ -1510,7 +1510,7 @@ }, { "cell_type": "markdown", - "id": "940a7845", + "id": "90cfd77d", "metadata": {}, "source": [ "## Exercise 31.3\n", @@ -1531,7 +1531,7 @@ }, { "cell_type": "markdown", - "id": "0b33ac00", + "id": "a7e1bd9d", "metadata": {}, "source": [ "## Exercise 31.4\n", @@ -1551,7 +1551,7 @@ } ], "metadata": { - "date": 1680677525.9943342, + "date": 1685490452.8831491, "filename": "lu_tricks.md", "kernelspec": { "display_name": "Python", diff --git a/lucas_asset_pricing_dles.ipynb b/lucas_asset_pricing_dles.ipynb index df1c01a..a36b06a 100644 --- a/lucas_asset_pricing_dles.ipynb +++ b/lucas_asset_pricing_dles.ipynb @@ -2,7 +2,7 @@ "cells": [ { "cell_type": "markdown", - "id": "de023d09", + "id": "e5823dfa", "metadata": {}, "source": [ "\n", @@ -13,7 +13,7 @@ }, { "cell_type": "markdown", - "id": "3ff2ddc3", + "id": "46b7fdd9", "metadata": {}, "source": [ "# Lucas Asset Pricing Using DLE" @@ -21,7 +21,7 @@ }, { "cell_type": "markdown", - "id": "213b655a", + "id": "88c7bedf", "metadata": {}, "source": [ "## Contents\n", @@ -33,7 +33,7 @@ }, { "cell_type": "markdown", - "id": "a4959eb9", + "id": "92bf8329", "metadata": {}, "source": [ "This is one of a suite of lectures that use the quantecon DLE class to instantiate models within the\n", @@ -45,7 +45,7 @@ { "cell_type": "code", "execution_count": null, - "id": "3cf13b53", + "id": "1bf0cd08", "metadata": { "hide-output": false }, @@ -56,7 +56,7 @@ }, { "cell_type": "markdown", - "id": "52faedac", + "id": "ba5a9112", "metadata": {}, "source": [ "This lecture uses the DLE class to price payout\n", @@ -76,7 +76,7 @@ { "cell_type": "code", "execution_count": null, - "id": "dd14c860", + "id": "26a59a4e", "metadata": { "hide-output": false }, @@ -91,7 +91,7 @@ }, { "cell_type": "markdown", - "id": "ceff0d08", + "id": "e356d3e0", "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", @@ -175,7 +175,7 @@ }, { "cell_type": "markdown", - "id": "837f6b2c", + "id": "03806a64", "metadata": {}, "source": [ "## Asset Pricing Equations\n", @@ -209,7 +209,7 @@ }, { "cell_type": "markdown", - "id": "17a7c8c4", + "id": "2c46c881", "metadata": {}, "source": [ "## Asset Pricing Simulations" @@ -218,7 +218,7 @@ { "cell_type": "code", "execution_count": null, - "id": "c599a9df", + "id": "f9455cf9", "metadata": { "hide-output": false }, @@ -255,7 +255,7 @@ { "cell_type": "code", "execution_count": null, - "id": "71181c11", + "id": "79782a94", "metadata": { "hide-output": false }, @@ -266,7 +266,7 @@ }, { "cell_type": "markdown", - "id": "86b2e776", + "id": "5cfbacec", "metadata": {}, "source": [ "After specifying a “Pay” matrix, we simulate the economy.\n", @@ -278,7 +278,7 @@ { "cell_type": "code", "execution_count": null, - "id": "e9c369ff", + "id": "5f16b685", "metadata": { "hide-output": false }, @@ -289,7 +289,7 @@ }, { "cell_type": "markdown", - "id": "ce5e86ca", + "id": "bc775de7", "metadata": {}, "source": [ "The graph below plots the price of this claim over time:" @@ -298,7 +298,7 @@ { "cell_type": "code", "execution_count": null, - "id": "e607c595", + "id": "3804f57f", "metadata": { "hide-output": false }, @@ -312,7 +312,7 @@ }, { "cell_type": "markdown", - "id": "0e88000f", + "id": "d395eaf4", "metadata": {}, "source": [ "The next plot displays the realized gross rate of return on this “Lucas\n", @@ -322,7 +322,7 @@ { "cell_type": "code", "execution_count": null, - "id": "f2d9c396", + "id": "8b19e590", "metadata": { "hide-output": false }, @@ -338,7 +338,7 @@ { "cell_type": "code", "execution_count": null, - "id": "23fdae20", + "id": "5cd4125a", "metadata": { "hide-output": false }, @@ -349,7 +349,7 @@ }, { "cell_type": "markdown", - "id": "efe2af31", + "id": "1642a564", "metadata": {}, "source": [ "Above we have also calculated the correlation coefficient between these\n", @@ -363,7 +363,7 @@ { "cell_type": "code", "execution_count": null, - "id": "2e01b5a6", + "id": "383ee639", "metadata": { "hide-output": false }, @@ -378,7 +378,7 @@ }, { "cell_type": "markdown", - "id": "8af035f4", + "id": "7e81d604", "metadata": {}, "source": [ "From the above plot, we can see the tendency of the term structure to\n", @@ -396,7 +396,7 @@ { "cell_type": "code", "execution_count": null, - "id": "0cefb98e", + "id": "1c266241", "metadata": { "hide-output": false }, @@ -414,7 +414,7 @@ { "cell_type": "code", "execution_count": null, - "id": "7809ed32", + "id": "4164c5d9", "metadata": { "hide-output": false }, @@ -430,7 +430,7 @@ { "cell_type": "code", "execution_count": null, - "id": "b08000f4", + "id": "d32c57b8", "metadata": { "hide-output": false }, @@ -441,7 +441,7 @@ }, { "cell_type": "markdown", - "id": "babe1b6e", + "id": "cf13a206", "metadata": {}, "source": [ "The correlation between these two gross rates is now more negative.\n", @@ -453,7 +453,7 @@ { "cell_type": "code", "execution_count": null, - "id": "945dd1ff", + "id": "407a9ce9", "metadata": { "hide-output": false }, @@ -468,7 +468,7 @@ }, { "cell_type": "markdown", - "id": "a250127d", + "id": "0b8e1c95", "metadata": {}, "source": [ "We can see the tendency of the term structure to slope up when rates are\n", @@ -478,7 +478,7 @@ } ], "metadata": { - "date": 1680677526.0152297, + "date": 1685490452.9043407, "filename": "lucas_asset_pricing_dles.md", "kernelspec": { "display_name": "Python", diff --git a/lucas_model.ipynb b/lucas_model.ipynb index 8aa433e..29c0061 100644 --- a/lucas_model.ipynb +++ b/lucas_model.ipynb @@ -2,7 +2,7 @@ "cells": [ { "cell_type": "markdown", - "id": "c6e51d8a", + "id": "f4c32243", "metadata": {}, "source": [ "\n", @@ -11,7 +11,7 @@ }, { "cell_type": "markdown", - "id": "dba8dbab", + "id": "c72f118f", "metadata": {}, "source": [ "# Asset Pricing II: The Lucas Asset Pricing Model\n", @@ -22,7 +22,7 @@ }, { "cell_type": "markdown", - "id": "c8e76076", + "id": "d632da6b", "metadata": {}, "source": [ "## Contents\n", @@ -35,7 +35,7 @@ }, { "cell_type": "markdown", - "id": "5ab80a2b", + "id": "98e54c40", "metadata": {}, "source": [ "In addition to what’s in Anaconda, this lecture will need the following libraries:" @@ -44,7 +44,7 @@ { "cell_type": "code", "execution_count": null, - "id": "5417890d", + "id": "eab3f7fd", "metadata": { "hide-output": false }, @@ -55,7 +55,7 @@ }, { "cell_type": "markdown", - "id": "fe561a0e", + "id": "f5c20070", "metadata": {}, "source": [ "## Overview\n", @@ -78,7 +78,7 @@ { "cell_type": "code", "execution_count": null, - "id": "94cf55bf", + "id": "70d09788", "metadata": { "hide-output": false }, @@ -94,7 +94,7 @@ }, { "cell_type": "markdown", - "id": "53411cb1", + "id": "bb191884", "metadata": {}, "source": [ "## The Lucas Model\n", @@ -116,7 +116,7 @@ }, { "cell_type": "markdown", - "id": "2ee74f7d", + "id": "ec8dabfd", "metadata": {}, "source": [ "### Basic Setup\n", @@ -126,7 +126,7 @@ }, { "cell_type": "markdown", - "id": "225bf499", + "id": "9df0fce8", "metadata": {}, "source": [ "#### Assets\n", @@ -156,7 +156,7 @@ }, { "cell_type": "markdown", - "id": "40ac54ea", + "id": "2038910a", "metadata": {}, "source": [ "#### Consumers\n", @@ -180,7 +180,7 @@ }, { "cell_type": "markdown", - "id": "1418983f", + "id": "661d75e6", "metadata": {}, "source": [ "### Pricing a Lucas Tree\n", @@ -219,7 +219,7 @@ }, { "cell_type": "markdown", - "id": "a757bce2", + "id": "cab9f740", "metadata": {}, "source": [ "#### The Dynamic Program\n", @@ -277,7 +277,7 @@ }, { "cell_type": "markdown", - "id": "97595a22", + "id": "a8ffbd86", "metadata": {}, "source": [ "#### Next Steps\n", @@ -296,7 +296,7 @@ }, { "cell_type": "markdown", - "id": "6e2018cb", + "id": "35ced0b2", "metadata": {}, "source": [ "#### Equilibrium Constraints\n", @@ -315,7 +315,7 @@ }, { "cell_type": "markdown", - "id": "22be1f02", + "id": "ec84d970", "metadata": {}, "source": [ "#### The Equilibrium Price Function\n", @@ -361,7 +361,7 @@ }, { "cell_type": "markdown", - "id": "80322422", + "id": "f302b46e", "metadata": {}, "source": [ "### Solving the Model\n", @@ -377,7 +377,7 @@ }, { "cell_type": "markdown", - "id": "8af4cab0", + "id": "1ab29a19", "metadata": {}, "source": [ "#### Setting up the Problem\n", @@ -427,7 +427,7 @@ }, { "cell_type": "markdown", - "id": "b98ba357", + "id": "bc1e9af9", "metadata": {}, "source": [ "#### A Little Fixed Point Theory\n", @@ -489,7 +489,7 @@ }, { "cell_type": "markdown", - "id": "bacbb02c", + "id": "bff5498a", "metadata": {}, "source": [ "### Computation – An Example\n", @@ -510,7 +510,7 @@ { "cell_type": "code", "execution_count": null, - "id": "5a4996d1", + "id": "17ac73ff", "metadata": { "hide-output": false }, @@ -549,7 +549,7 @@ }, { "cell_type": "markdown", - "id": "d17d369d", + "id": "f7a66743", "metadata": {}, "source": [ "The following function takes an instance of the `LucasTree` and generates a\n", @@ -559,7 +559,7 @@ { "cell_type": "code", "execution_count": null, - "id": "f65da46e", + "id": "05696621", "metadata": { "hide-output": false }, @@ -601,7 +601,7 @@ }, { "cell_type": "markdown", - "id": "2b9c3af9", + "id": "66dc7f20", "metadata": {}, "source": [ "To solve the model, we write a function that iterates using the Lucas operator\n", @@ -611,7 +611,7 @@ { "cell_type": "code", "execution_count": null, - "id": "109ce6a5", + "id": "3b279caf", "metadata": { "hide-output": false }, @@ -647,7 +647,7 @@ }, { "cell_type": "markdown", - "id": "12fcdb0f", + "id": "f5b3f433", "metadata": {}, "source": [ "Solving the model and plotting the resulting price function" @@ -656,7 +656,7 @@ { "cell_type": "code", "execution_count": null, - "id": "190bfed0", + "id": "e998d99c", "metadata": { "hide-output": false }, @@ -675,7 +675,7 @@ }, { "cell_type": "markdown", - "id": "e5c09a35", + "id": "97b0c343", "metadata": {}, "source": [ "We see that the price is increasing, even if we remove all serial correlation from the endowment process.\n", @@ -701,7 +701,7 @@ }, { "cell_type": "markdown", - "id": "70a350f3", + "id": "1d4af700", "metadata": {}, "source": [ "## Exercises\n", @@ -712,7 +712,7 @@ }, { "cell_type": "markdown", - "id": "e5276d63", + "id": "99491586", "metadata": {}, "source": [ "## Exercise 34.1\n", @@ -722,7 +722,7 @@ }, { "cell_type": "markdown", - "id": "2b64f02a", + "id": "5ee85c90", "metadata": {}, "source": [ "## Solution to[ Exercise 34.1](https://python-advanced.quantecon.org/#lucas_ex1)" @@ -731,7 +731,7 @@ { "cell_type": "code", "execution_count": null, - "id": "1b81666b", + "id": "33dcada0", "metadata": { "hide-output": false }, @@ -753,7 +753,7 @@ } ], "metadata": { - "date": 1680677526.0478728, + "date": 1685490452.9368224, "filename": "lucas_model.md", "kernelspec": { "display_name": "Python", diff --git a/markov_jump_lq.ipynb b/markov_jump_lq.ipynb index d5a5b6f..0375c93 100644 --- a/markov_jump_lq.ipynb +++ b/markov_jump_lq.ipynb @@ -2,7 +2,7 @@ "cells": [ { "cell_type": "markdown", - "id": "99d80b8e", + "id": "0598f894", "metadata": {}, "source": [ "\n", @@ -13,7 +13,7 @@ }, { "cell_type": "markdown", - "id": "3cebd43a", + "id": "f4b4b578", "metadata": {}, "source": [ "# Markov Jump Linear Quadratic Dynamic Programming" @@ -21,7 +21,7 @@ }, { "cell_type": "markdown", - "id": "32be6e75", + "id": "5f523100", "metadata": {}, "source": [ "## Contents\n", @@ -38,7 +38,7 @@ }, { "cell_type": "markdown", - "id": "e3730b2b", + "id": "716505d7", "metadata": {}, "source": [ "In addition to what’s in Anaconda, this lecture will need the following libraries:" @@ -47,7 +47,7 @@ { "cell_type": "code", "execution_count": null, - "id": "9405089b", + "id": "f228591b", "metadata": { "hide-output": false }, @@ -58,7 +58,7 @@ }, { "cell_type": "markdown", - "id": "dc8aec7f", + "id": "e00aca06", "metadata": {}, "source": [ "## Overview\n", @@ -98,7 +98,7 @@ }, { "cell_type": "markdown", - "id": "680caf98", + "id": "94fe059a", "metadata": {}, "source": [ "## Review of useful LQ dynamic programming formulas\n", @@ -172,7 +172,7 @@ }, { "cell_type": "markdown", - "id": "81c1e85f", + "id": "faccf7fa", "metadata": {}, "source": [ "## Linked Riccati equations for Markov LQ dynamic programming\n", @@ -285,7 +285,7 @@ }, { "cell_type": "markdown", - "id": "1849826c", + "id": "68f6ed0f", "metadata": {}, "source": [ "## Applications\n", @@ -298,7 +298,7 @@ { "cell_type": "code", "execution_count": null, - "id": "89976d5d", + "id": "195ee1a6", "metadata": { "hide-output": false }, @@ -315,7 +315,7 @@ { "cell_type": "code", "execution_count": null, - "id": "f1e0e5eb", + "id": "d7dae34b", "metadata": { "hide-output": false }, @@ -327,7 +327,7 @@ }, { "cell_type": "markdown", - "id": "9ad1253f", + "id": "35eced2a", "metadata": {}, "source": [ "## Example 1\n", @@ -397,7 +397,7 @@ { "cell_type": "code", "execution_count": null, - "id": "63a6ea64", + "id": "9db2a706", "metadata": { "hide-output": false }, @@ -442,7 +442,7 @@ }, { "cell_type": "markdown", - "id": "c92cf198", + "id": "287b134a", "metadata": {}, "source": [ "The continuous part of the state $ x_t $ consists of two variables,\n", @@ -452,7 +452,7 @@ { "cell_type": "code", "execution_count": null, - "id": "d08342c2", + "id": "d8f639e4", "metadata": { "hide-output": false }, @@ -463,7 +463,7 @@ }, { "cell_type": "markdown", - "id": "cec40828", + "id": "023b334d", "metadata": {}, "source": [ "We start with a Markov transition matrix that makes the Markov state be\n", @@ -503,7 +503,7 @@ { "cell_type": "code", "execution_count": null, - "id": "d0e1c668", + "id": "5eb17677", "metadata": { "hide-output": false }, @@ -517,7 +517,7 @@ { "cell_type": "code", "execution_count": null, - "id": "63dbef2b", + "id": "da42f413", "metadata": { "hide-output": false }, @@ -530,7 +530,7 @@ { "cell_type": "code", "execution_count": null, - "id": "d043a643", + "id": "3c2c01ef", "metadata": { "hide-output": false }, @@ -544,7 +544,7 @@ }, { "cell_type": "markdown", - "id": "142cc9f4", + "id": "5dcbf197", "metadata": {}, "source": [ "Let’s look at the value function matrices and the decision rules for\n", @@ -554,7 +554,7 @@ { "cell_type": "code", "execution_count": null, - "id": "c01ccca6", + "id": "a378ded5", "metadata": { "hide-output": false }, @@ -567,7 +567,7 @@ { "cell_type": "code", "execution_count": null, - "id": "eb72c392", + "id": "c78794de", "metadata": { "hide-output": false }, @@ -580,7 +580,7 @@ { "cell_type": "code", "execution_count": null, - "id": "07401214", + "id": "75ffeee7", "metadata": { "hide-output": false }, @@ -592,7 +592,7 @@ }, { "cell_type": "markdown", - "id": "6b19b04f", + "id": "d4504d60", "metadata": {}, "source": [ "Now we’ll plot the decision rules and see if they make sense" @@ -601,7 +601,7 @@ { "cell_type": "code", "execution_count": null, - "id": "b35eb1f2", + "id": "e4a1fc8b", "metadata": { "hide-output": false }, @@ -633,7 +633,7 @@ }, { "cell_type": "markdown", - "id": "fb9aa5bc", + "id": "34f93bd4", "metadata": {}, "source": [ "The above graph plots $ k_{t+1}= k_t + u_t = k_t - F x_t $ as an affine\n", @@ -659,7 +659,7 @@ { "cell_type": "code", "execution_count": null, - "id": "3da4dea4", + "id": "2adac01c", "metadata": { "hide-output": false }, @@ -680,7 +680,7 @@ }, { "cell_type": "markdown", - "id": "3d6d03d5", + "id": "90f6009f", "metadata": {}, "source": [ "Now we’ll depart from the preceding transition matrix that made the\n", @@ -699,7 +699,7 @@ { "cell_type": "code", "execution_count": null, - "id": "b4c7133b", + "id": "01dc6779", "metadata": { "hide-output": false }, @@ -717,7 +717,7 @@ { "cell_type": "code", "execution_count": null, - "id": "b587e03d", + "id": "0e43d745", "metadata": { "hide-output": false }, @@ -734,7 +734,7 @@ }, { "cell_type": "markdown", - "id": "e2ab6c3f", + "id": "b334c646", "metadata": {}, "source": [ "We can plot optimal decision rules associated with different\n", @@ -744,7 +744,7 @@ { "cell_type": "code", "execution_count": null, - "id": "e010e1f6", + "id": "6c2306d2", "metadata": { "hide-output": false }, @@ -767,7 +767,7 @@ { "cell_type": "code", "execution_count": null, - "id": "b7319f63", + "id": "833f2685", "metadata": { "hide-output": false }, @@ -787,7 +787,7 @@ }, { "cell_type": "markdown", - "id": "fc10690f", + "id": "fb6f1485", "metadata": {}, "source": [ "Notice how the decision rules’ constants and slopes behave as functions\n", @@ -812,7 +812,7 @@ { "cell_type": "code", "execution_count": null, - "id": "01fd848b", + "id": "d6844e76", "metadata": { "hide-output": false }, @@ -829,7 +829,7 @@ }, { "cell_type": "markdown", - "id": "71c6444f", + "id": "df5f9422", "metadata": {}, "source": [ "We can plot optimal decision rules for different $ \\lambda $ and\n", @@ -839,7 +839,7 @@ { "cell_type": "code", "execution_count": null, - "id": "49e0cd34", + "id": "55177f9f", "metadata": { "hide-output": false }, @@ -869,7 +869,7 @@ { "cell_type": "code", "execution_count": null, - "id": "5ab51787", + "id": "4a7f1dcd", "metadata": { "hide-output": false }, @@ -891,7 +891,7 @@ }, { "cell_type": "markdown", - "id": "bda21b71", + "id": "ad35e018", "metadata": {}, "source": [ "The following code defines a wrapper function that computes optimal\n", @@ -901,7 +901,7 @@ { "cell_type": "code", "execution_count": null, - "id": "b2623d54", + "id": "c1957981", "metadata": { "hide-output": false }, @@ -1002,7 +1002,7 @@ }, { "cell_type": "markdown", - "id": "2bf05e98", + "id": "6200869d", "metadata": {}, "source": [ "To illustrate the code with another example, we shall set\n", @@ -1054,7 +1054,7 @@ { "cell_type": "code", "execution_count": null, - "id": "bafe7cea", + "id": "eec1c63e", "metadata": { "hide-output": false }, @@ -1065,7 +1065,7 @@ }, { "cell_type": "markdown", - "id": "c7e29b07", + "id": "c14a7c89", "metadata": {}, "source": [ "Set $ f_{1,{s_t}} $ and $ d_{s_t} $ as constant functions and\n", @@ -1078,7 +1078,7 @@ { "cell_type": "code", "execution_count": null, - "id": "42ed59db", + "id": "b4686d7d", "metadata": { "hide-output": false }, @@ -1089,7 +1089,7 @@ }, { "cell_type": "markdown", - "id": "b9f6d356", + "id": "2160f889", "metadata": {}, "source": [ "## Example 2\n", @@ -1159,7 +1159,7 @@ { "cell_type": "code", "execution_count": null, - "id": "7d93ba76", + "id": "1e0d28bd", "metadata": { "hide-output": false }, @@ -1212,7 +1212,7 @@ { "cell_type": "code", "execution_count": null, - "id": "cffd8802", + "id": "8b3ff53f", "metadata": { "hide-output": false }, @@ -1223,7 +1223,7 @@ }, { "cell_type": "markdown", - "id": "0fdb06d4", + "id": "3524ca2b", "metadata": {}, "source": [ "Only $ d_{s_t} $ depends on $ s_t $." @@ -1232,7 +1232,7 @@ { "cell_type": "code", "execution_count": null, - "id": "d844aa28", + "id": "9ebfa635", "metadata": { "hide-output": false }, @@ -1243,7 +1243,7 @@ }, { "cell_type": "markdown", - "id": "fc05dfae", + "id": "fffba2c2", "metadata": {}, "source": [ "Only $ f_{1,{s_t}} $ depends on $ s_t $." @@ -1252,7 +1252,7 @@ { "cell_type": "code", "execution_count": null, - "id": "b324f250", + "id": "3db5e03d", "metadata": { "hide-output": false }, @@ -1263,7 +1263,7 @@ }, { "cell_type": "markdown", - "id": "9b871b54", + "id": "2fa79a41", "metadata": {}, "source": [ "Only $ f_{2,{s_t}} $ depends on $ s_t $." @@ -1272,7 +1272,7 @@ { "cell_type": "code", "execution_count": null, - "id": "fae4aef3", + "id": "20083c82", "metadata": { "hide-output": false }, @@ -1283,7 +1283,7 @@ }, { "cell_type": "markdown", - "id": "5325e3ee", + "id": "0f0acf92", "metadata": {}, "source": [ "Only $ \\alpha_0(s_t) $ depends on $ s_t $." @@ -1292,7 +1292,7 @@ { "cell_type": "code", "execution_count": null, - "id": "509e773e", + "id": "1645c891", "metadata": { "hide-output": false }, @@ -1303,7 +1303,7 @@ }, { "cell_type": "markdown", - "id": "28ee4aaa", + "id": "c96813aa", "metadata": {}, "source": [ "Only $ \\rho_{s_t} $ depends on $ s_t $." @@ -1312,7 +1312,7 @@ { "cell_type": "code", "execution_count": null, - "id": "53d29fa7", + "id": "dfe5bf16", "metadata": { "hide-output": false }, @@ -1323,7 +1323,7 @@ }, { "cell_type": "markdown", - "id": "f92bc853", + "id": "56803c2f", "metadata": {}, "source": [ "Only $ \\sigma_{s_t} $ depends on $ s_t $." @@ -1332,7 +1332,7 @@ { "cell_type": "code", "execution_count": null, - "id": "353f1475", + "id": "b7c9055b", "metadata": { "hide-output": false }, @@ -1343,7 +1343,7 @@ }, { "cell_type": "markdown", - "id": "a43622f3", + "id": "57c86b30", "metadata": {}, "source": [ "## More examples\n", @@ -1358,7 +1358,7 @@ } ], "metadata": { - "date": 1680677526.1009736, + "date": 1685490452.990838, "filename": "markov_jump_lq.md", "kernelspec": { "display_name": "Python", diff --git a/matsuyama.ipynb b/matsuyama.ipynb index b4faaf5..3d6a06e 100644 --- a/matsuyama.ipynb +++ b/matsuyama.ipynb @@ -2,7 +2,7 @@ "cells": [ { "cell_type": "markdown", - "id": "2f3517f8", + "id": "1dfcecc9", "metadata": {}, "source": [ "\n", @@ -11,7 +11,7 @@ }, { "cell_type": "markdown", - "id": "da4184cb", + "id": "f8553ab2", "metadata": {}, "source": [ "# Globalization and Cycles" @@ -19,7 +19,7 @@ }, { "cell_type": "markdown", - "id": "d1742543", + "id": "e4696560", "metadata": {}, "source": [ "## Contents\n", @@ -34,7 +34,7 @@ }, { "cell_type": "markdown", - "id": "c4fa610e", + "id": "ec50776c", "metadata": {}, "source": [ "## Overview\n", @@ -59,7 +59,7 @@ { "cell_type": "code", "execution_count": null, - "id": "6ec38972", + "id": "4553990e", "metadata": { "hide-output": false }, @@ -75,7 +75,7 @@ }, { "cell_type": "markdown", - "id": "367c24ee", + "id": "2b097f9d", "metadata": {}, "source": [ "### Background\n", @@ -91,7 +91,7 @@ }, { "cell_type": "markdown", - "id": "7ec6ecc1", + "id": "7a13dd4a", "metadata": {}, "source": [ "## Key Ideas\n", @@ -101,7 +101,7 @@ }, { "cell_type": "markdown", - "id": "32083ec6", + "id": "c2852f83", "metadata": {}, "source": [ "### Innovation Cycles\n", @@ -129,7 +129,7 @@ }, { "cell_type": "markdown", - "id": "4c23d2bd", + "id": "a2a360bc", "metadata": {}, "source": [ "### Synchronization\n", @@ -145,7 +145,7 @@ }, { "cell_type": "markdown", - "id": "8658f828", + "id": "c465a2b7", "metadata": {}, "source": [ "## Model\n", @@ -193,7 +193,7 @@ }, { "cell_type": "markdown", - "id": "f616d7a4", + "id": "8fdf072a", "metadata": {}, "source": [ "### Prices\n", @@ -283,7 +283,7 @@ }, { "cell_type": "markdown", - "id": "b66a7f82", + "id": "e3335bef", "metadata": {}, "source": [ "### New Varieties\n", @@ -315,7 +315,7 @@ }, { "cell_type": "markdown", - "id": "4b020e65", + "id": "aff01090", "metadata": {}, "source": [ "### Law of Motion\n", @@ -394,7 +394,7 @@ }, { "cell_type": "markdown", - "id": "88a31faf", + "id": "ccd24b5b", "metadata": {}, "source": [ "## Simulation\n", @@ -421,7 +421,7 @@ { "cell_type": "code", "execution_count": null, - "id": "e8755341", + "id": "7157952c", "metadata": { "hide-output": false }, @@ -734,7 +734,7 @@ }, { "cell_type": "markdown", - "id": "be245e21", + "id": "7a4f8fcf", "metadata": {}, "source": [ "### Time Series of Firm Measures\n", @@ -751,7 +751,7 @@ { "cell_type": "code", "execution_count": null, - "id": "17c2a9b2", + "id": "c73ef901", "metadata": { "hide-output": false }, @@ -791,7 +791,7 @@ }, { "cell_type": "markdown", - "id": "b93a6692", + "id": "64ae42fe", "metadata": {}, "source": [ "In the first case, innovation in the two countries does not synchronize.\n", @@ -802,7 +802,7 @@ }, { "cell_type": "markdown", - "id": "2f61ad3a", + "id": "59a4b774", "metadata": {}, "source": [ "### Basin of Attraction\n", @@ -837,7 +837,7 @@ }, { "cell_type": "markdown", - "id": "1d536b9f", + "id": "f81bfad4", "metadata": {}, "source": [ "## Exercises" @@ -845,7 +845,7 @@ }, { "cell_type": "markdown", - "id": "39fe1ebf", + "id": "d9cfcd9b", "metadata": {}, "source": [ "## Exercise 14.1\n", @@ -855,7 +855,7 @@ }, { "cell_type": "markdown", - "id": "193b7017", + "id": "d3f4fdf5", "metadata": {}, "source": [ "## Solution to[ Exercise 14.1](https://python-advanced.quantecon.org/#matsuyama_ex1)" @@ -864,7 +864,7 @@ { "cell_type": "code", "execution_count": null, - "id": "ce2ac0e2", + "id": "2ae7a5c5", "metadata": { "hide-output": false }, @@ -920,7 +920,7 @@ }, { "cell_type": "markdown", - "id": "6255e3d5", + "id": "9d63bf31", "metadata": {}, "source": [ "Additionally, instead of just seeing 4 plots at once, we might want to\n", @@ -933,7 +933,7 @@ { "cell_type": "code", "execution_count": null, - "id": "98440189", + "id": "7d678611", "metadata": { "hide-output": false }, @@ -960,7 +960,7 @@ { "cell_type": "code", "execution_count": null, - "id": "5b7c7ea0", + "id": "034d2f42", "metadata": { "hide-output": false }, @@ -974,7 +974,7 @@ } ], "metadata": { - "date": 1680677526.1313648, + "date": 1685490453.021407, "filename": "matsuyama.md", "kernelspec": { "display_name": "Python", diff --git a/muth_kalman.ipynb b/muth_kalman.ipynb index cf4e18b..17b0259 100644 --- a/muth_kalman.ipynb +++ b/muth_kalman.ipynb @@ -2,7 +2,7 @@ "cells": [ { "cell_type": "markdown", - "id": "a90a3905", + "id": "be07e83d", "metadata": {}, "source": [ "\n", @@ -13,7 +13,7 @@ }, { "cell_type": "markdown", - "id": "442702a3", + "id": "a0933dd7", "metadata": {}, "source": [ "# Reverse Engineering a la Muth" @@ -21,7 +21,7 @@ }, { "cell_type": "markdown", - "id": "906430bf", + "id": "c5ac9f42", "metadata": {}, "source": [ "## Contents\n", @@ -37,7 +37,7 @@ }, { "cell_type": "markdown", - "id": "7d295d86", + "id": "a2930c7f", "metadata": {}, "source": [ "In addition to what’s in Anaconda, this lecture uses the quantecon library." @@ -46,7 +46,7 @@ { "cell_type": "code", "execution_count": null, - "id": "f54d7d28", + "id": "64e4bcd3", "metadata": { "hide-output": false }, @@ -57,7 +57,7 @@ }, { "cell_type": "markdown", - "id": "af7d2e1e", + "id": "2a1301bb", "metadata": {}, "source": [ "We’ll also need the following imports:" @@ -66,7 +66,7 @@ { "cell_type": "code", "execution_count": null, - "id": "6d8b9358", + "id": "f72d72a9", "metadata": { "hide-output": false }, @@ -85,7 +85,7 @@ }, { "cell_type": "markdown", - "id": "0721e6e4", + "id": "443d5257", "metadata": {}, "source": [ "This lecture uses the Kalman filter to reformulate John F. Muth’s first\n", @@ -98,7 +98,7 @@ }, { "cell_type": "markdown", - "id": "2fe9f3fb", + "id": "f7f3a172", "metadata": {}, "source": [ "## Friedman (1956) and Muth (1960)\n", @@ -149,7 +149,7 @@ }, { "cell_type": "markdown", - "id": "73e6dfb6", + "id": "c679aa68", "metadata": {}, "source": [ "## A Process for Which Adaptive Expectations are Optimal\n", @@ -217,7 +217,7 @@ { "cell_type": "code", "execution_count": null, - "id": "4a2431e0", + "id": "663d2028", "metadata": { "hide-output": false }, @@ -250,7 +250,7 @@ }, { "cell_type": "markdown", - "id": "1f46d193", + "id": "c93fe4b3", "metadata": {}, "source": [ "## Some Useful State-Space Math\n", @@ -307,7 +307,7 @@ { "cell_type": "code", "execution_count": null, - "id": "fae99dfc", + "id": "70b2cbc1", "metadata": { "hide-output": false }, @@ -340,7 +340,7 @@ }, { "cell_type": "markdown", - "id": "a48cb648", + "id": "fb3e6b6b", "metadata": {}, "source": [ "Now that we have simulated our joint system, we have $ x_t $,\n", @@ -352,7 +352,7 @@ }, { "cell_type": "markdown", - "id": "9c266ba0", + "id": "b36b1c60", "metadata": {}, "source": [ "## Estimates of Unobservables\n", @@ -365,7 +365,7 @@ { "cell_type": "code", "execution_count": null, - "id": "933fe234", + "id": "883952b0", "metadata": { "hide-output": false }, @@ -382,7 +382,7 @@ }, { "cell_type": "markdown", - "id": "436a7145", + "id": "9e3a752b", "metadata": {}, "source": [ "Note how $ x_t $ and $ \\hat{x_t} $ differ.\n", @@ -393,7 +393,7 @@ }, { "cell_type": "markdown", - "id": "ff5e3269", + "id": "b6db578c", "metadata": {}, "source": [ "## Relationship of Unobservables to Observables\n", @@ -406,7 +406,7 @@ { "cell_type": "code", "execution_count": null, - "id": "e2a82432", + "id": "70f7c1b9", "metadata": { "hide-output": false }, @@ -423,7 +423,7 @@ }, { "cell_type": "markdown", - "id": "b44bada2", + "id": "df3d8916", "metadata": {}, "source": [ "We see above that $ y $ seems to look like white noise around the\n", @@ -432,7 +432,7 @@ }, { "cell_type": "markdown", - "id": "0df3035e", + "id": "e63a50bf", "metadata": {}, "source": [ "### Innovations\n", @@ -444,7 +444,7 @@ { "cell_type": "code", "execution_count": null, - "id": "62949de4", + "id": "e3201a09", "metadata": { "hide-output": false }, @@ -460,7 +460,7 @@ }, { "cell_type": "markdown", - "id": "6b15a94f", + "id": "30ee2cb6", "metadata": {}, "source": [ "## MA and AR Representations\n", @@ -481,7 +481,7 @@ { "cell_type": "code", "execution_count": null, - "id": "2b4d6356", + "id": "0e342fc4", "metadata": { "hide-output": false }, @@ -507,7 +507,7 @@ }, { "cell_type": "markdown", - "id": "a8c1111c", + "id": "c7fa40b5", "metadata": {}, "source": [ "The **moving average** coefficients in the top panel show tell-tale\n", @@ -524,7 +524,7 @@ { "cell_type": "code", "execution_count": null, - "id": "654c4886", + "id": "4c36e61f", "metadata": { "hide-output": false }, @@ -535,7 +535,7 @@ } ], "metadata": { - "date": 1680677526.3896594, + "date": 1685490453.0489576, "filename": "muth_kalman.md", "kernelspec": { "display_name": "Python", diff --git a/opt_tax_recur.ipynb b/opt_tax_recur.ipynb index fad17e5..32607c7 100644 --- a/opt_tax_recur.ipynb +++ b/opt_tax_recur.ipynb @@ -2,7 +2,7 @@ "cells": [ { "cell_type": "markdown", - "id": "83848ae9", + "id": "0d276c32", "metadata": {}, "source": [ "\n", @@ -11,7 +11,7 @@ }, { "cell_type": "markdown", - "id": "04fe5f56", + "id": "a385390d", "metadata": {}, "source": [ "# Optimal Taxation with State-Contingent Debt" @@ -19,7 +19,7 @@ }, { "cell_type": "markdown", - "id": "93c4fc38", + "id": "4c7737be", "metadata": {}, "source": [ "## Contents\n", @@ -33,7 +33,7 @@ }, { "cell_type": "markdown", - "id": "4f49b77e", + "id": "d41aa74b", "metadata": {}, "source": [ "In addition to what’s in Anaconda, this lecture will need the following libraries:" @@ -42,7 +42,7 @@ { "cell_type": "code", "execution_count": null, - "id": "91c7de3c", + "id": "ca700046", "metadata": { "hide-output": false }, @@ -54,7 +54,7 @@ }, { "cell_type": "markdown", - "id": "964f187a", + "id": "c2be612d", "metadata": {}, "source": [ "## Overview\n", @@ -95,7 +95,7 @@ { "cell_type": "code", "execution_count": null, - "id": "70314beb", + "id": "86c93164", "metadata": { "hide-output": false }, @@ -114,7 +114,7 @@ }, { "cell_type": "markdown", - "id": "b98ca35b", + "id": "22b67d24", "metadata": {}, "source": [ "## A Competitive Equilibrium with Distorting Taxes\n", @@ -231,7 +231,7 @@ }, { "cell_type": "markdown", - "id": "3fdc76de", + "id": "49b283d3", "metadata": {}, "source": [ "### Arrow-Debreu Version of Price System\n", @@ -259,7 +259,7 @@ }, { "cell_type": "markdown", - "id": "a7c42e31", + "id": "aabd81c0", "metadata": {}, "source": [ "### Primal Approach\n", @@ -291,7 +291,7 @@ }, { "cell_type": "markdown", - "id": "828c14cb", + "id": "a2b7f6e3", "metadata": {}, "source": [ "### The Implementability Constraint\n", @@ -367,7 +367,7 @@ }, { "cell_type": "markdown", - "id": "79ecb9d1", + "id": "2e78c718", "metadata": {}, "source": [ "### Solution Details\n", @@ -509,7 +509,7 @@ }, { "cell_type": "markdown", - "id": "0da9849d", + "id": "7771be3c", "metadata": {}, "source": [ "### The Ramsey Allocation for a Given Multiplier\n", @@ -545,7 +545,7 @@ }, { "cell_type": "markdown", - "id": "295c1f8e", + "id": "223645a4", "metadata": {}, "source": [ "### Further Specialization\n", @@ -567,7 +567,7 @@ }, { "cell_type": "markdown", - "id": "68dd4c85", + "id": "5379b7c2", "metadata": {}, "source": [ "### Determining the Lagrange Multiplier\n", @@ -703,7 +703,7 @@ }, { "cell_type": "markdown", - "id": "da64da3c", + "id": "7ed6b0cb", "metadata": {}, "source": [ "### Time Inconsistency\n", @@ -734,7 +734,7 @@ }, { "cell_type": "markdown", - "id": "7aca615f", + "id": "ef050872", "metadata": {}, "source": [ "### Specification with CRRA Utility\n", @@ -819,7 +819,7 @@ }, { "cell_type": "markdown", - "id": "30487e80", + "id": "e0422e0f", "metadata": {}, "source": [ "### Sequence Implementation\n", @@ -830,7 +830,7 @@ { "cell_type": "code", "execution_count": null, - "id": "2af41119", + "id": "0fe9b7fd", "metadata": { "hide-output": false }, @@ -1038,7 +1038,7 @@ }, { "cell_type": "markdown", - "id": "e49e23b5", + "id": "dd847405", "metadata": {}, "source": [ "## Recursive Formulation of the Ramsey Problem\n", @@ -1055,7 +1055,7 @@ }, { "cell_type": "markdown", - "id": "efb270f2", + "id": "b8cba3d2", "metadata": {}, "source": [ "### Intertemporal Delegation\n", @@ -1104,7 +1104,7 @@ }, { "cell_type": "markdown", - "id": "3f81bc00", + "id": "dc043a4d", "metadata": {}, "source": [ "### Two Bellman Equations\n", @@ -1123,7 +1123,7 @@ }, { "cell_type": "markdown", - "id": "07743edc", + "id": "ecf71eae", "metadata": {}, "source": [ "### The Continuation Ramsey Problem\n", @@ -1168,7 +1168,7 @@ }, { "cell_type": "markdown", - "id": "f0d5ee87", + "id": "907f7db3", "metadata": {}, "source": [ "### The Ramsey Problem\n", @@ -1221,7 +1221,7 @@ }, { "cell_type": "markdown", - "id": "c7b95e31", + "id": "7e37aaaf", "metadata": {}, "source": [ "### First-Order Conditions\n", @@ -1305,7 +1305,7 @@ }, { "cell_type": "markdown", - "id": "5ecf1585", + "id": "01249658", "metadata": {}, "source": [ "### State Variable Degeneracy\n", @@ -1333,7 +1333,7 @@ }, { "cell_type": "markdown", - "id": "3ae9845a", + "id": "452a1b4f", "metadata": {}, "source": [ "### Manifestations of Time Inconsistency\n", @@ -1383,7 +1383,7 @@ }, { "cell_type": "markdown", - "id": "61151097", + "id": "c8a3684f", "metadata": {}, "source": [ "### Recursive Implementation\n", @@ -1394,7 +1394,7 @@ { "cell_type": "code", "execution_count": null, - "id": "31c8392e", + "id": "ff4d714b", "metadata": { "hide-output": false }, @@ -1648,7 +1648,7 @@ }, { "cell_type": "markdown", - "id": "ece7fb3e", + "id": "afb92a84", "metadata": {}, "source": [ "## Examples\n", @@ -1658,7 +1658,7 @@ }, { "cell_type": "markdown", - "id": "05be1d69", + "id": "9fbbd35f", "metadata": {}, "source": [ "### Anticipated One-Period War\n", @@ -1714,7 +1714,7 @@ { "cell_type": "code", "execution_count": null, - "id": "d3e4f159", + "id": "052ae6d6", "metadata": { "hide-output": false }, @@ -1770,7 +1770,7 @@ }, { "cell_type": "markdown", - "id": "ea372b22", + "id": "77b784c6", "metadata": {}, "source": [ "We set initial government debt $ b_0 = 1 $.\n", @@ -1784,7 +1784,7 @@ { "cell_type": "code", "execution_count": null, - "id": "cff96ebe", + "id": "707e66c5", "metadata": { "hide-output": false }, @@ -1825,7 +1825,7 @@ }, { "cell_type": "markdown", - "id": "a4657348", + "id": "a0100aeb", "metadata": {}, "source": [ "**Tax smoothing**\n", @@ -1871,7 +1871,7 @@ { "cell_type": "code", "execution_count": null, - "id": "508dea50", + "id": "2ab5fc53", "metadata": { "hide-output": false }, @@ -1886,7 +1886,7 @@ }, { "cell_type": "markdown", - "id": "e61bbe7b", + "id": "236c6176", "metadata": {}, "source": [ "### Government Saving\n", @@ -1922,7 +1922,7 @@ }, { "cell_type": "markdown", - "id": "b30073cc", + "id": "846c6ca9", "metadata": {}, "source": [ "### Time 0 Manipulation of Interest Rate\n", @@ -1940,7 +1940,7 @@ }, { "cell_type": "markdown", - "id": "bb0d9121", + "id": "d661b9bc", "metadata": {}, "source": [ "### Time 0 and Time-Inconsistency\n", @@ -1960,7 +1960,7 @@ { "cell_type": "code", "execution_count": null, - "id": "a8ea1146", + "id": "2f152d92", "metadata": { "hide-output": false }, @@ -1994,7 +1994,7 @@ }, { "cell_type": "markdown", - "id": "fb51af00", + "id": "8128c02e", "metadata": {}, "source": [ "The figure indicates that if the government enters with positive debt, it sets\n", @@ -2044,7 +2044,7 @@ { "cell_type": "code", "execution_count": null, - "id": "4fabfdd2", + "id": "991b1abd", "metadata": { "hide-output": false }, @@ -2074,7 +2074,7 @@ }, { "cell_type": "markdown", - "id": "2b7cf2e4", + "id": "5edaf095", "metadata": {}, "source": [ "The tax rates in the figure are equal for only two values of initial government debt." @@ -2082,7 +2082,7 @@ }, { "cell_type": "markdown", - "id": "423c8abb", + "id": "a465e780", "metadata": {}, "source": [ "### Tax Smoothing and non-CRRA Preferences\n", @@ -2119,7 +2119,7 @@ { "cell_type": "code", "execution_count": null, - "id": "df5bf32b", + "id": "735c9d72", "metadata": { "hide-output": false }, @@ -2165,7 +2165,7 @@ }, { "cell_type": "markdown", - "id": "94857735", + "id": "e8c2dab4", "metadata": {}, "source": [ "Also, suppose that $ g_t $ follows a two-state IID process with equal\n", @@ -2179,7 +2179,7 @@ { "cell_type": "code", "execution_count": null, - "id": "7943da8a", + "id": "79053e59", "metadata": { "hide-output": false }, @@ -2221,7 +2221,7 @@ }, { "cell_type": "markdown", - "id": "bc55f0a0", + "id": "d5e24b7f", "metadata": {}, "source": [ "As should be expected, the recursive and sequential solutions produce almost\n", @@ -2234,7 +2234,7 @@ }, { "cell_type": "markdown", - "id": "1d0fecc0", + "id": "4c27e111", "metadata": {}, "source": [ "### Further Comments\n", @@ -2255,7 +2255,7 @@ } ], "metadata": { - "date": 1680677526.4970841, + "date": 1685490453.3169343, "filename": "opt_tax_recur.md", "kernelspec": { "display_name": "Python", diff --git a/orth_proj.ipynb b/orth_proj.ipynb index 9fe69fe..ca3b213 100644 --- a/orth_proj.ipynb +++ b/orth_proj.ipynb @@ -2,7 +2,7 @@ "cells": [ { "cell_type": "markdown", - "id": "f88fdbed", + "id": "f7434317", "metadata": {}, "source": [ "\n", @@ -11,7 +11,7 @@ }, { "cell_type": "markdown", - "id": "378aee7f", + "id": "f5fa7483", "metadata": {}, "source": [ "# Orthogonal Projections and Their Applications\n", @@ -22,7 +22,7 @@ }, { "cell_type": "markdown", - "id": "5b07c0d5", + "id": "cffafe6e", "metadata": {}, "source": [ "## Contents\n", @@ -40,7 +40,7 @@ }, { "cell_type": "markdown", - "id": "59e93231", + "id": "ab71009d", "metadata": {}, "source": [ "## Overview\n", @@ -69,7 +69,7 @@ { "cell_type": "code", "execution_count": null, - "id": "57363018", + "id": "614c26da", "metadata": { "hide-output": false }, @@ -81,7 +81,7 @@ }, { "cell_type": "markdown", - "id": "09229a55", + "id": "a808c60a", "metadata": {}, "source": [ "### Further Reading\n", @@ -97,7 +97,7 @@ }, { "cell_type": "markdown", - "id": "50b39f87", + "id": "af24e290", "metadata": {}, "source": [ "## Key Definitions\n", @@ -161,7 +161,7 @@ }, { "cell_type": "markdown", - "id": "4f5f93e1", + "id": "57f08b18", "metadata": {}, "source": [ "### Linear Independence vs Orthogonality\n", @@ -175,7 +175,7 @@ }, { "cell_type": "markdown", - "id": "8114b3d6", + "id": "ce84ec22", "metadata": {}, "source": [ "## The Orthogonal Projection Theorem\n", @@ -206,7 +206,7 @@ }, { "cell_type": "markdown", - "id": "143ffbaa", + "id": "3e42dc18", "metadata": {}, "source": [ "### Proof of Sufficiency\n", @@ -232,7 +232,7 @@ }, { "cell_type": "markdown", - "id": "4874f726", + "id": "4cedd791", "metadata": {}, "source": [ "### Orthogonal Projection as a Mapping\n", @@ -273,7 +273,7 @@ }, { "cell_type": "markdown", - "id": "e795935c", + "id": "8ba93e31", "metadata": {}, "source": [ "#### Orthogonal Complement\n", @@ -314,7 +314,7 @@ }, { "cell_type": "markdown", - "id": "77f3de8b", + "id": "ea6d3f94", "metadata": {}, "source": [ "## Orthonormal Basis\n", @@ -360,7 +360,7 @@ }, { "cell_type": "markdown", - "id": "6f127b31", + "id": "c44065b5", "metadata": {}, "source": [ "### Projection onto an Orthonormal Basis\n", @@ -398,7 +398,7 @@ }, { "cell_type": "markdown", - "id": "68ee810a", + "id": "03fe950c", "metadata": {}, "source": [ "## Projection Via Matrix Algebra\n", @@ -460,7 +460,7 @@ }, { "cell_type": "markdown", - "id": "c6df1635", + "id": "61871089", "metadata": {}, "source": [ "### Starting with the Basis\n", @@ -482,7 +482,7 @@ }, { "cell_type": "markdown", - "id": "71405585", + "id": "4295327e", "metadata": {}, "source": [ "### The Orthonormal Case\n", @@ -513,7 +513,7 @@ }, { "cell_type": "markdown", - "id": "af758339", + "id": "49494b5d", "metadata": {}, "source": [ "### Application: Overdetermined Systems of Equations\n", @@ -570,7 +570,7 @@ }, { "cell_type": "markdown", - "id": "59e4d89c", + "id": "36e2e7fb", "metadata": {}, "source": [ "## Least Squares Regression\n", @@ -584,7 +584,7 @@ }, { "cell_type": "markdown", - "id": "554b8e39", + "id": "fde7896b", "metadata": {}, "source": [ "### Squared Risk Measures\n", @@ -622,7 +622,7 @@ }, { "cell_type": "markdown", - "id": "81715a3f", + "id": "b4a69b6f", "metadata": {}, "source": [ "### Solution\n", @@ -731,7 +731,7 @@ }, { "cell_type": "markdown", - "id": "28450dca", + "id": "e4617edc", "metadata": {}, "source": [ "## Orthogonalization and Decomposition\n", @@ -748,7 +748,7 @@ }, { "cell_type": "markdown", - "id": "e2c2b152", + "id": "fb5dd89d", "metadata": {}, "source": [ "### Gram-Schmidt Orthogonalization\n", @@ -781,7 +781,7 @@ }, { "cell_type": "markdown", - "id": "4b5e0570", + "id": "c42f6566", "metadata": {}, "source": [ "### QR Decomposition\n", @@ -813,7 +813,7 @@ }, { "cell_type": "markdown", - "id": "1ca97ba9", + "id": "98e2f4e9", "metadata": {}, "source": [ "### Linear Regression via QR Decomposition\n", @@ -838,7 +838,7 @@ }, { "cell_type": "markdown", - "id": "4f5b7bbc", + "id": "68fa3dd3", "metadata": {}, "source": [ "## Exercises" @@ -846,7 +846,7 @@ }, { "cell_type": "markdown", - "id": "bfa02164", + "id": "9b88cf64", "metadata": {}, "source": [ "## Exercise 1.1\n", @@ -856,7 +856,7 @@ }, { "cell_type": "markdown", - "id": "37699254", + "id": "7a161566", "metadata": {}, "source": [ "## Solution to[ Exercise 1.1](https://python-advanced.quantecon.org/#op_ex1)\n", @@ -867,7 +867,7 @@ }, { "cell_type": "markdown", - "id": "c4ebc38b", + "id": "693de976", "metadata": {}, "source": [ "## Exercise 1.2\n", @@ -879,7 +879,7 @@ }, { "cell_type": "markdown", - "id": "d0e680fb", + "id": "742ebdb0", "metadata": {}, "source": [ "## Solution to[ Exercise 1.2](https://python-advanced.quantecon.org/#op_ex2)\n", @@ -895,7 +895,7 @@ }, { "cell_type": "markdown", - "id": "b864be06", + "id": "684e10b4", "metadata": {}, "source": [ "## Exercise 1.3\n", @@ -930,7 +930,7 @@ }, { "cell_type": "markdown", - "id": "b26c3a73", + "id": "d7a31554", "metadata": {}, "source": [ "## Solution to[ Exercise 1.3](https://python-advanced.quantecon.org/#op_ex3)\n", @@ -942,7 +942,7 @@ { "cell_type": "code", "execution_count": null, - "id": "64735679", + "id": "47f6f45f", "metadata": { "hide-output": false }, @@ -988,7 +988,7 @@ }, { "cell_type": "markdown", - "id": "fde39a19", + "id": "2937b44e", "metadata": {}, "source": [ "Here are the arrays we’ll work with" @@ -997,7 +997,7 @@ { "cell_type": "code", "execution_count": null, - "id": "381fef46", + "id": "cec6eab2", "metadata": { "hide-output": false }, @@ -1014,7 +1014,7 @@ }, { "cell_type": "markdown", - "id": "8e5ee1d6", + "id": "94f9d47b", "metadata": {}, "source": [ "First, let’s try projection of $ y $ onto the column space of\n", @@ -1024,7 +1024,7 @@ { "cell_type": "code", "execution_count": null, - "id": "6aa440c5", + "id": "0bae447e", "metadata": { "hide-output": false }, @@ -1036,7 +1036,7 @@ }, { "cell_type": "markdown", - "id": "1b05aa88", + "id": "b15328c4", "metadata": {}, "source": [ "Now let’s do the same using an orthonormal basis created from our\n", @@ -1046,7 +1046,7 @@ { "cell_type": "code", "execution_count": null, - "id": "08453861", + "id": "0e0e0a53", "metadata": { "hide-output": false }, @@ -1059,7 +1059,7 @@ { "cell_type": "code", "execution_count": null, - "id": "4cd9cc2c", + "id": "1a090da4", "metadata": { "hide-output": false }, @@ -1071,7 +1071,7 @@ }, { "cell_type": "markdown", - "id": "185e330f", + "id": "8e542d29", "metadata": {}, "source": [ "This is the same answer. So far so good. Finally, let’s try the same\n", @@ -1081,7 +1081,7 @@ { "cell_type": "code", "execution_count": null, - "id": "14f5f159", + "id": "f82aa064", "metadata": { "hide-output": false }, @@ -1094,7 +1094,7 @@ { "cell_type": "code", "execution_count": null, - "id": "cb0e337c", + "id": "49993acc", "metadata": { "hide-output": false }, @@ -1106,7 +1106,7 @@ }, { "cell_type": "markdown", - "id": "ead6e643", + "id": "ce14c47b", "metadata": {}, "source": [ "Again, we obtain the same answer." @@ -1114,7 +1114,7 @@ } ], "metadata": { - "date": 1680677526.5567663, + "date": 1685490453.3759506, "filename": "orth_proj.md", "kernelspec": { "display_name": "Python", diff --git a/permanent_income_dles.ipynb b/permanent_income_dles.ipynb index 5b16f72..3febf66 100644 --- a/permanent_income_dles.ipynb +++ b/permanent_income_dles.ipynb @@ -2,7 +2,7 @@ "cells": [ { "cell_type": "markdown", - "id": "744882b6", + "id": "84c0a45b", "metadata": {}, "source": [ "\n", @@ -13,7 +13,7 @@ }, { "cell_type": "markdown", - "id": "811b2a39", + "id": "2d66e458", "metadata": {}, "source": [ "# Permanent Income Model using the DLE Class" @@ -21,7 +21,7 @@ }, { "cell_type": "markdown", - "id": "fe8c0c19", + "id": "27f4efda", "metadata": {}, "source": [ "## Contents\n", @@ -32,7 +32,7 @@ }, { "cell_type": "markdown", - "id": "c1d5c353", + "id": "5e5ecc6f", "metadata": {}, "source": [ "This lecture is part of a suite of lectures that use the quantecon DLE class to instantiate models within the\n", @@ -44,7 +44,7 @@ { "cell_type": "code", "execution_count": null, - "id": "2be2ae53", + "id": "cb2d9a65", "metadata": { "hide-output": false }, @@ -55,7 +55,7 @@ }, { "cell_type": "markdown", - "id": "7372711f", + "id": "6e2bdb3b", "metadata": {}, "source": [ "This lecture adds a third solution method for the\n", @@ -76,7 +76,7 @@ { "cell_type": "code", "execution_count": null, - "id": "83d8246a", + "id": "22c80fe2", "metadata": { "hide-output": false }, @@ -94,7 +94,7 @@ }, { "cell_type": "markdown", - "id": "73f686dc", + "id": "cb596946", "metadata": {}, "source": [ "## The Permanent Income Model\n", @@ -194,7 +194,7 @@ }, { "cell_type": "markdown", - "id": "e700fd08", + "id": "8b341913", "metadata": {}, "source": [ "### Solution with the DLE Class\n", @@ -253,7 +253,7 @@ { "cell_type": "code", "execution_count": null, - "id": "dca05154", + "id": "7831daea", "metadata": { "hide-output": false }, @@ -293,7 +293,7 @@ }, { "cell_type": "markdown", - "id": "33d879b5", + "id": "4f7972df", "metadata": {}, "source": [ "To check the solution of this model with that from the **LQ** problem,\n", @@ -310,7 +310,7 @@ { "cell_type": "code", "execution_count": null, - "id": "f01ccebe", + "id": "fee648a2", "metadata": { "hide-output": false }, @@ -321,7 +321,7 @@ }, { "cell_type": "markdown", - "id": "b8b6973e", + "id": "fbe625ef", "metadata": {}, "source": [ "The state vector in the DLE class is:\n", @@ -351,7 +351,7 @@ { "cell_type": "code", "execution_count": null, - "id": "3efd36ce", + "id": "90bfad01", "metadata": { "hide-output": false }, @@ -377,7 +377,7 @@ } ], "metadata": { - "date": 1680677526.5780478, + "date": 1685490453.3982115, "filename": "permanent_income_dles.md", "kernelspec": { "display_name": "Python", diff --git a/rob_markov_perf.ipynb b/rob_markov_perf.ipynb index fc06bbe..8a54297 100644 --- a/rob_markov_perf.ipynb +++ b/rob_markov_perf.ipynb @@ -2,7 +2,7 @@ "cells": [ { "cell_type": "markdown", - "id": "a0e4bbe8", + "id": "7e570c1b", "metadata": {}, "source": [ "\n", @@ -11,7 +11,7 @@ }, { "cell_type": "markdown", - "id": "915e79cb", + "id": "d28f263d", "metadata": {}, "source": [ "# Robust Markov Perfect Equilibrium" @@ -19,7 +19,7 @@ }, { "cell_type": "markdown", - "id": "1de29429", + "id": "94a7b45f", "metadata": {}, "source": [ "## Contents\n", @@ -32,7 +32,7 @@ }, { "cell_type": "markdown", - "id": "c6d40341", + "id": "b35aad5a", "metadata": {}, "source": [ "In addition to what’s in Anaconda, this lecture will need the following libraries:" @@ -41,7 +41,7 @@ { "cell_type": "code", "execution_count": null, - "id": "52472702", + "id": "8ac438cc", "metadata": { "hide-output": false }, @@ -52,7 +52,7 @@ }, { "cell_type": "markdown", - "id": "4bac418f", + "id": "71f5e103", "metadata": {}, "source": [ "## Overview\n", @@ -79,7 +79,7 @@ { "cell_type": "code", "execution_count": null, - "id": "069f1d10", + "id": "d44c62d0", "metadata": { "hide-output": false }, @@ -94,7 +94,7 @@ }, { "cell_type": "markdown", - "id": "37f0e32f", + "id": "1ff44f7d", "metadata": {}, "source": [ "### Basic Setup\n", @@ -128,7 +128,7 @@ }, { "cell_type": "markdown", - "id": "4a096ec7", + "id": "141f661a", "metadata": {}, "source": [ "## Linear Markov Perfect Equilibria with Robust Agents\n", @@ -143,7 +143,7 @@ }, { "cell_type": "markdown", - "id": "9f1dff46", + "id": "70f2b690", "metadata": {}, "source": [ "### Modified Coupled Linear Regulator Problems\n", @@ -220,7 +220,7 @@ }, { "cell_type": "markdown", - "id": "506c1cda", + "id": "23b677b2", "metadata": {}, "source": [ "### Computing Equilibrium\n", @@ -337,7 +337,7 @@ }, { "cell_type": "markdown", - "id": "48ba56f8", + "id": "13656cdc", "metadata": {}, "source": [ "### Key Insight\n", @@ -357,7 +357,7 @@ }, { "cell_type": "markdown", - "id": "e74501fb", + "id": "440aa13d", "metadata": {}, "source": [ "### Worst-case Shocks\n", @@ -377,7 +377,7 @@ }, { "cell_type": "markdown", - "id": "bb9b0864", + "id": "fb3fe1a0", "metadata": {}, "source": [ "### Infinite Horizon\n", @@ -391,7 +391,7 @@ }, { "cell_type": "markdown", - "id": "14718a18", + "id": "cedc439b", "metadata": {}, "source": [ "### Implementation\n", @@ -403,7 +403,7 @@ }, { "cell_type": "markdown", - "id": "2517bd64", + "id": "fdf8b917", "metadata": {}, "source": [ "## Application\n", @@ -414,7 +414,7 @@ }, { "cell_type": "markdown", - "id": "b6fce28e", + "id": "a619e8d4", "metadata": {}, "source": [ "### A Duopoly Model\n", @@ -544,7 +544,7 @@ }, { "cell_type": "markdown", - "id": "a1585488", + "id": "b7706b6e", "metadata": {}, "source": [ "### Parameters and Solution\n", @@ -563,7 +563,7 @@ { "cell_type": "code", "execution_count": null, - "id": "162981d1", + "id": "05af8d5a", "metadata": { "hide-output": false }, @@ -609,7 +609,7 @@ }, { "cell_type": "markdown", - "id": "d798e11c", + "id": "1d4bdc81", "metadata": {}, "source": [ "#### Markov Perfect Equilibrium with Robustness\n", @@ -628,7 +628,7 @@ { "cell_type": "code", "execution_count": null, - "id": "3d96383a", + "id": "2b7e990f", "metadata": { "hide-output": false }, @@ -800,7 +800,7 @@ }, { "cell_type": "markdown", - "id": "3626a664", + "id": "724d40cd", "metadata": {}, "source": [ "### Some Details\n", @@ -874,7 +874,7 @@ { "cell_type": "code", "execution_count": null, - "id": "0a1395c3", + "id": "405ea9b4", "metadata": { "hide-output": false }, @@ -907,7 +907,7 @@ }, { "cell_type": "markdown", - "id": "069df073", + "id": "6c398d31", "metadata": {}, "source": [ "#### Consistency Check\n", @@ -919,7 +919,7 @@ { "cell_type": "code", "execution_count": null, - "id": "d4e0be4b", + "id": "f9237480", "metadata": { "hide-output": false }, @@ -943,7 +943,7 @@ }, { "cell_type": "markdown", - "id": "8d7ac961", + "id": "9097d8da", "metadata": {}, "source": [ "We can see that the results are consistent across the two functions." @@ -951,7 +951,7 @@ }, { "cell_type": "markdown", - "id": "5db9883e", + "id": "45ec5b59", "metadata": {}, "source": [ "#### Comparative Dynamics under Baseline Transition Dynamics\n", @@ -995,7 +995,7 @@ { "cell_type": "code", "execution_count": null, - "id": "65e8382a", + "id": "74f5676d", "metadata": { "hide-output": false }, @@ -1066,7 +1066,7 @@ }, { "cell_type": "markdown", - "id": "3ad6e5d6", + "id": "10372e8c", "metadata": {}, "source": [ "The following code prepares graphs that compare market-wide output $ q_{1t} + q_{2t} $ and the price of the good\n", @@ -1080,7 +1080,7 @@ { "cell_type": "code", "execution_count": null, - "id": "c54816ae", + "id": "d08131d3", "metadata": { "hide-output": false }, @@ -1104,7 +1104,7 @@ }, { "cell_type": "markdown", - "id": "4c47b85e", + "id": "843a6432", "metadata": {}, "source": [ "Under the dynamics associated with the baseline model, the price path is higher with the Markov perfect equilibrium robust decision rules\n", @@ -1120,7 +1120,7 @@ { "cell_type": "code", "execution_count": null, - "id": "3df0cd54", + "id": "3fb1af2f", "metadata": { "hide-output": false }, @@ -1144,7 +1144,7 @@ }, { "cell_type": "markdown", - "id": "9212532f", + "id": "0d05cc82", "metadata": {}, "source": [ "Evidently, firm 1’s output path is substantially lower when firms are robust firms while\n", @@ -1167,7 +1167,7 @@ }, { "cell_type": "markdown", - "id": "6ef5c010", + "id": "e8b02a6e", "metadata": {}, "source": [ "#### Heterogeneous Beliefs\n", @@ -1198,7 +1198,7 @@ { "cell_type": "code", "execution_count": null, - "id": "7e6b6455", + "id": "47e57587", "metadata": { "hide-output": false }, @@ -1214,7 +1214,7 @@ { "cell_type": "code", "execution_count": null, - "id": "1d250e33", + "id": "cdf685b2", "metadata": { "hide-output": false }, @@ -1245,7 +1245,7 @@ }, { "cell_type": "markdown", - "id": "2fb3fb18", + "id": "f48a6f46", "metadata": {}, "source": [ "We see from the above graph that under robustness concerns, player 1 and\n", @@ -1265,7 +1265,7 @@ } ], "metadata": { - "date": 1680677526.624691, + "date": 1685490453.4445932, "filename": "rob_markov_perf.md", "kernelspec": { "display_name": "Python", diff --git a/robustness.ipynb b/robustness.ipynb index f5b8b9a..911df21 100644 --- a/robustness.ipynb +++ b/robustness.ipynb @@ -2,7 +2,7 @@ "cells": [ { "cell_type": "markdown", - "id": "dfe96ea3", + "id": "c6b40439", "metadata": {}, "source": [ "\n", @@ -11,7 +11,7 @@ }, { "cell_type": "markdown", - "id": "1a280dba", + "id": "6efb370f", "metadata": {}, "source": [ "# Robustness\n", @@ -22,7 +22,7 @@ }, { "cell_type": "markdown", - "id": "12c795c6", + "id": "65701d85", "metadata": {}, "source": [ "## Contents\n", @@ -40,7 +40,7 @@ }, { "cell_type": "markdown", - "id": "eece39bb", + "id": "e23542d0", "metadata": {}, "source": [ "In addition to what’s in Anaconda, this lecture will need the following libraries:" @@ -49,7 +49,7 @@ { "cell_type": "code", "execution_count": null, - "id": "c1aff0f5", + "id": "7b06dd2f", "metadata": { "hide-output": false }, @@ -60,7 +60,7 @@ }, { "cell_type": "markdown", - "id": "a3535b1f", + "id": "7457b8d1", "metadata": {}, "source": [ "## Overview\n", @@ -109,7 +109,7 @@ { "cell_type": "code", "execution_count": null, - "id": "3f70703c", + "id": "3c55f723", "metadata": { "hide-output": false }, @@ -125,7 +125,7 @@ }, { "cell_type": "markdown", - "id": "36ba758b", + "id": "6e4fe55a", "metadata": {}, "source": [ "\n", @@ -134,7 +134,7 @@ }, { "cell_type": "markdown", - "id": "7e947caf", + "id": "7af8ed2b", "metadata": {}, "source": [ "### Sets of Models Imply Sets Of Values\n", @@ -201,7 +201,7 @@ }, { "cell_type": "markdown", - "id": "5d83d732", + "id": "0b7ffb1c", "metadata": {}, "source": [ "### Inspiring Video\n", @@ -211,7 +211,7 @@ }, { "cell_type": "markdown", - "id": "9bcd2a3d", + "id": "186ea999", "metadata": {}, "source": [ "### Other References\n", @@ -224,7 +224,7 @@ }, { "cell_type": "markdown", - "id": "144dfe34", + "id": "ce253937", "metadata": {}, "source": [ "## The Model\n", @@ -278,7 +278,7 @@ }, { "cell_type": "markdown", - "id": "7c85630a", + "id": "c47c7afa", "metadata": {}, "source": [ "## Constructing More Robust Policies\n", @@ -327,7 +327,7 @@ }, { "cell_type": "markdown", - "id": "d8dd2bac", + "id": "abb5ee43", "metadata": {}, "source": [ "### Analyzing the Bellman Equation\n", @@ -433,7 +433,7 @@ }, { "cell_type": "markdown", - "id": "19458546", + "id": "c1f6fba5", "metadata": {}, "source": [ "## Robustness as Outcome of a Two-Person Zero-Sum Game\n", @@ -454,7 +454,7 @@ }, { "cell_type": "markdown", - "id": "46a83530", + "id": "74e51dac", "metadata": {}, "source": [ "### Agent 2’s Problem\n", @@ -561,7 +561,7 @@ }, { "cell_type": "markdown", - "id": "37a1517a", + "id": "8572b5ca", "metadata": {}, "source": [ "### Using Agent 2’s Problem to Construct Bounds on the Value Sets" @@ -569,7 +569,7 @@ }, { "cell_type": "markdown", - "id": "f20003ff", + "id": "fbbe42ad", "metadata": {}, "source": [ "#### The Lower Bound\n", @@ -628,7 +628,7 @@ }, { "cell_type": "markdown", - "id": "d8d992e4", + "id": "bfdd7d66", "metadata": {}, "source": [ "#### The Upper Bound\n", @@ -691,7 +691,7 @@ }, { "cell_type": "markdown", - "id": "63967aa7", + "id": "3cfb18a8", "metadata": {}, "source": [ "#### Reshaping the Set of Values\n", @@ -701,7 +701,7 @@ }, { "cell_type": "markdown", - "id": "0a87b1b7", + "id": "cdfd546a", "metadata": {}, "source": [ "### Agent 1’s Problem\n", @@ -748,7 +748,7 @@ }, { "cell_type": "markdown", - "id": "ac7c86b0", + "id": "10b9504f", "metadata": {}, "source": [ "### Nash Equilibrium\n", @@ -782,7 +782,7 @@ }, { "cell_type": "markdown", - "id": "c02d1c43", + "id": "643ed46c", "metadata": {}, "source": [ "## The Stochastic Case\n", @@ -831,7 +831,7 @@ }, { "cell_type": "markdown", - "id": "eee5f930", + "id": "b655f4f1", "metadata": {}, "source": [ "### Solving the Model\n", @@ -929,7 +929,7 @@ }, { "cell_type": "markdown", - "id": "0c5abb50", + "id": "0945cffa", "metadata": {}, "source": [ "### Computing Other Quantities\n", @@ -939,7 +939,7 @@ }, { "cell_type": "markdown", - "id": "0715ec91", + "id": "f46aed07", "metadata": {}, "source": [ "#### Worst-Case Value of a Policy\n", @@ -997,7 +997,7 @@ }, { "cell_type": "markdown", - "id": "21f2ab87", + "id": "25736fe6", "metadata": {}, "source": [ "## Implementation\n", @@ -1023,7 +1023,7 @@ }, { "cell_type": "markdown", - "id": "fb0cd8bf", + "id": "49c4af08", "metadata": {}, "source": [ "## Application\n", @@ -1123,7 +1123,7 @@ { "cell_type": "code", "execution_count": null, - "id": "40729e65", + "id": "886a83f9", "metadata": { "hide-output": false }, @@ -1300,7 +1300,7 @@ }, { "cell_type": "markdown", - "id": "f9241593", + "id": "50faafb4", "metadata": {}, "source": [ "Here’s another such figure, with $ \\theta = 0.002 $ instead of $ 0.02 $\n", @@ -1316,7 +1316,7 @@ }, { "cell_type": "markdown", - "id": "9a4d3b65", + "id": "8419bb2e", "metadata": {}, "source": [ "## Appendix\n", @@ -1390,7 +1390,7 @@ } ], "metadata": { - "date": 1680677526.6891966, + "date": 1685490453.5090854, "filename": "robustness.md", "kernelspec": { "display_name": "Python", diff --git a/rosen_schooling_model.ipynb b/rosen_schooling_model.ipynb index 6873675..cf626eb 100644 --- a/rosen_schooling_model.ipynb +++ b/rosen_schooling_model.ipynb @@ -2,7 +2,7 @@ "cells": [ { "cell_type": "markdown", - "id": "0c27d932", + "id": "d1b3ee98", "metadata": {}, "source": [ "\n", @@ -13,7 +13,7 @@ }, { "cell_type": "markdown", - "id": "ba5910f0", + "id": "cac48258", "metadata": {}, "source": [ "# Rosen Schooling Model" @@ -21,7 +21,7 @@ }, { "cell_type": "markdown", - "id": "93f3ea33", + "id": "28f49292", "metadata": {}, "source": [ "## Contents\n", @@ -33,7 +33,7 @@ }, { "cell_type": "markdown", - "id": "2c9d6906", + "id": "2ba49a4f", "metadata": {}, "source": [ "This lecture is yet another part of a suite of lectures that use the quantecon DLE class to instantiate models within the\n", @@ -45,7 +45,7 @@ { "cell_type": "code", "execution_count": null, - "id": "798db44a", + "id": "34799b44", "metadata": { "hide-output": false }, @@ -56,7 +56,7 @@ }, { "cell_type": "markdown", - "id": "22896251", + "id": "c6b90259", "metadata": {}, "source": [ "We’ll also need the following imports:" @@ -65,7 +65,7 @@ { "cell_type": "code", "execution_count": null, - "id": "1d89d4cb", + "id": "d48130d7", "metadata": { "hide-output": false }, @@ -82,7 +82,7 @@ }, { "cell_type": "markdown", - "id": "5b28801e", + "id": "f1291d21", "metadata": {}, "source": [ "## A One-Occupation Model\n", @@ -130,7 +130,7 @@ }, { "cell_type": "markdown", - "id": "1bfcbec1", + "id": "6c84728e", "metadata": {}, "source": [ "## Mapping into HS2013 Framework\n", @@ -145,7 +145,7 @@ }, { "cell_type": "markdown", - "id": "c4b5f7bb", + "id": "feddb0cd", "metadata": {}, "source": [ "### Preferences\n", @@ -177,7 +177,7 @@ }, { "cell_type": "markdown", - "id": "0504a88f", + "id": "5c4a4be3", "metadata": {}, "source": [ "### Technology\n", @@ -198,7 +198,7 @@ }, { "cell_type": "markdown", - "id": "ad2e55e6", + "id": "376f6774", "metadata": {}, "source": [ "### Information\n", @@ -231,7 +231,7 @@ { "cell_type": "code", "execution_count": null, - "id": "9e73a25b", + "id": "0f75bc8c", "metadata": { "hide-output": false }, @@ -244,7 +244,7 @@ }, { "cell_type": "markdown", - "id": "c35994ba", + "id": "fcf86963", "metadata": {}, "source": [ "### Effects of Changes in Education Technology and Demand\n", @@ -263,7 +263,7 @@ { "cell_type": "code", "execution_count": null, - "id": "f7b9bc53", + "id": "e05785de", "metadata": { "hide-output": false }, @@ -318,7 +318,7 @@ }, { "cell_type": "markdown", - "id": "b249ea16", + "id": "e4d9c5a2", "metadata": {}, "source": [ "We create three other instances by:\n", @@ -331,7 +331,7 @@ { "cell_type": "code", "execution_count": null, - "id": "9128efb3", + "id": "029bdc6b", "metadata": { "hide-output": false }, @@ -378,7 +378,7 @@ }, { "cell_type": "markdown", - "id": "1a2b64f6", + "id": "cba4dd3f", "metadata": {}, "source": [ "The first figure plots the impulse response of $ n_t $ (on the left)\n", @@ -406,7 +406,7 @@ { "cell_type": "code", "execution_count": null, - "id": "e5a932a4", + "id": "abee6fa9", "metadata": { "hide-output": false }, @@ -427,7 +427,7 @@ }, { "cell_type": "markdown", - "id": "ec546ed7", + "id": "1d949958", "metadata": {}, "source": [ "The next figure plots the impulse response of $ n_t $ (on the left)\n", @@ -438,7 +438,7 @@ { "cell_type": "code", "execution_count": null, - "id": "6d877d5e", + "id": "0da95ab2", "metadata": { "hide-output": false }, @@ -461,7 +461,7 @@ }, { "cell_type": "markdown", - "id": "25cd428e", + "id": "84777b4e", "metadata": {}, "source": [ "Both panels in the above figure show that raising $ k $ lowers the effect of\n", @@ -475,7 +475,7 @@ } ], "metadata": { - "date": 1680677526.7109072, + "date": 1685490453.5316172, "filename": "rosen_schooling_model.md", "kernelspec": { "display_name": "Python", diff --git a/smoothing.ipynb b/smoothing.ipynb index 332d14a..da43260 100644 --- a/smoothing.ipynb +++ b/smoothing.ipynb @@ -2,7 +2,7 @@ "cells": [ { "cell_type": "markdown", - "id": "7e35f20b", + "id": "6d15abd1", "metadata": {}, "source": [ "\n", @@ -11,7 +11,7 @@ }, { "cell_type": "markdown", - "id": "4bcb20e1", + "id": "a886c291", "metadata": {}, "source": [ "# Consumption Smoothing with Complete and Incomplete Markets\n", @@ -22,7 +22,7 @@ }, { "cell_type": "markdown", - "id": "65ef00d1", + "id": "96dd1081", "metadata": {}, "source": [ "## Contents\n", @@ -37,7 +37,7 @@ }, { "cell_type": "markdown", - "id": "f190f18a", + "id": "d4edaee8", "metadata": {}, "source": [ "In addition to what’s in Anaconda, this lecture uses the library:" @@ -46,7 +46,7 @@ { "cell_type": "code", "execution_count": null, - "id": "c4d72523", + "id": "4247e5ae", "metadata": { "hide-output": false }, @@ -57,7 +57,7 @@ }, { "cell_type": "markdown", - "id": "5ec5a68c", + "id": "a0db313d", "metadata": {}, "source": [ "## Overview\n", @@ -109,7 +109,7 @@ { "cell_type": "code", "execution_count": null, - "id": "83291e59", + "id": "5d53c0b4", "metadata": { "hide-output": false }, @@ -124,7 +124,7 @@ }, { "cell_type": "markdown", - "id": "99c6b260", + "id": "4040b103", "metadata": {}, "source": [ "### Relationship to Other Lectures\n", @@ -136,7 +136,7 @@ }, { "cell_type": "markdown", - "id": "fc405e0d", + "id": "ea14df1e", "metadata": {}, "source": [ "## Background\n", @@ -171,7 +171,7 @@ }, { "cell_type": "markdown", - "id": "0541ef5f", + "id": "5065b250", "metadata": {}, "source": [ "## Linear State Space Version of Complete Markets Model\n", @@ -332,7 +332,7 @@ { "cell_type": "code", "execution_count": null, - "id": "987878eb", + "id": "e1aba217", "metadata": { "hide-output": false }, @@ -415,7 +415,7 @@ }, { "cell_type": "markdown", - "id": "d5bac5b2", + "id": "0d0bf45f", "metadata": {}, "source": [ "### Interpretation of Graph\n", @@ -433,7 +433,7 @@ }, { "cell_type": "markdown", - "id": "b1295b06", + "id": "178b89fc", "metadata": {}, "source": [ "### Incomplete Markets Version\n", @@ -446,7 +446,7 @@ }, { "cell_type": "markdown", - "id": "48bf78ba", + "id": "cdc7f1d2", "metadata": {}, "source": [ "### Finite State Markov Income Process\n", @@ -497,7 +497,7 @@ }, { "cell_type": "markdown", - "id": "166297b0", + "id": "7137e06b", "metadata": {}, "source": [ "### Market Structure\n", @@ -516,7 +516,7 @@ }, { "cell_type": "markdown", - "id": "185fa335", + "id": "170e67b3", "metadata": {}, "source": [ "## Model 1 (Complete Markets)\n", @@ -695,7 +695,7 @@ }, { "cell_type": "markdown", - "id": "b50a9efe", + "id": "7d37c1da", "metadata": {}, "source": [ "### Key Outcomes\n", @@ -723,7 +723,7 @@ }, { "cell_type": "markdown", - "id": "86aafb5d", + "id": "be3b22f3", "metadata": {}, "source": [ "### Code\n", @@ -737,7 +737,7 @@ { "cell_type": "code", "execution_count": null, - "id": "6bc0b6b3", + "id": "d2b32aa1", "metadata": { "hide-output": false }, @@ -867,7 +867,7 @@ }, { "cell_type": "markdown", - "id": "f0d8da7e", + "id": "332666a3", "metadata": {}, "source": [ "Let’s test by checking that $ \\bar c $ and $ b_2 $ satisfy the budget constraint" @@ -876,7 +876,7 @@ { "cell_type": "code", "execution_count": null, - "id": "c9f5174a", + "id": "c742a61b", "metadata": { "hide-output": false }, @@ -889,7 +889,7 @@ }, { "cell_type": "markdown", - "id": "0528d2eb", + "id": "ec4a068d", "metadata": {}, "source": [ "Below, we’ll take the outcomes produced by this code – in particular the implied\n", @@ -899,7 +899,7 @@ }, { "cell_type": "markdown", - "id": "6d4f3854", + "id": "36926c68", "metadata": {}, "source": [ "## Model 2 (One-Period Risk-Free Debt Only)\n", @@ -1028,7 +1028,7 @@ }, { "cell_type": "markdown", - "id": "7ad3fbde", + "id": "8706e8eb", "metadata": {}, "source": [ "### Summary of Outcomes\n", @@ -1050,7 +1050,7 @@ }, { "cell_type": "markdown", - "id": "f3108440", + "id": "35093443", "metadata": {}, "source": [ "### The Incomplete Markets Model\n", @@ -1067,7 +1067,7 @@ { "cell_type": "code", "execution_count": null, - "id": "b1b86c65", + "id": "3a8a0e7b", "metadata": { "hide-output": false }, @@ -1105,7 +1105,7 @@ }, { "cell_type": "markdown", - "id": "f3d8da4d", + "id": "5268614a", "metadata": {}, "source": [ "In the graph on the left, for the same sample path of nonfinancial\n", @@ -1120,7 +1120,7 @@ }, { "cell_type": "markdown", - "id": "08ce95b2", + "id": "f459a7c0", "metadata": {}, "source": [ "### A sequel\n", @@ -1131,7 +1131,7 @@ } ], "metadata": { - "date": 1680677526.9914355, + "date": 1685490453.7613523, "filename": "smoothing.md", "kernelspec": { "display_name": "Python", diff --git a/smoothing_tax.ipynb b/smoothing_tax.ipynb index 1084a6f..9c8a2ea 100644 --- a/smoothing_tax.ipynb +++ b/smoothing_tax.ipynb @@ -2,7 +2,7 @@ "cells": [ { "cell_type": "markdown", - "id": "1a379fb0", + "id": "1e030e93", "metadata": {}, "source": [ "\n", @@ -11,7 +11,7 @@ }, { "cell_type": "markdown", - "id": "08886169", + "id": "a79076d3", "metadata": {}, "source": [ "# Tax Smoothing with Complete and Incomplete Markets\n", @@ -22,7 +22,7 @@ }, { "cell_type": "markdown", - "id": "de5e757d", + "id": "17d5d377", "metadata": {}, "source": [ "## Contents\n", @@ -36,7 +36,7 @@ }, { "cell_type": "markdown", - "id": "5a1ba522", + "id": "b3e45ff9", "metadata": {}, "source": [ "In addition to what’s in Anaconda, this lecture uses the library:" @@ -45,7 +45,7 @@ { "cell_type": "code", "execution_count": null, - "id": "adecc6a9", + "id": "070ee188", "metadata": { "hide-output": false }, @@ -56,7 +56,7 @@ }, { "cell_type": "markdown", - "id": "673805de", + "id": "eb0f11b6", "metadata": {}, "source": [ "## Overview\n", @@ -94,7 +94,7 @@ }, { "cell_type": "markdown", - "id": "08855cf3", + "id": "b716fce5", "metadata": {}, "source": [ "### Isomorphism between Consumption and Tax Smoothing\n", @@ -120,7 +120,7 @@ }, { "cell_type": "markdown", - "id": "151cb7cb", + "id": "658882d2", "metadata": {}, "source": [ "#### Link to History\n", @@ -134,7 +134,7 @@ { "cell_type": "code", "execution_count": null, - "id": "fd415cc7", + "id": "d6a2386a", "metadata": { "hide-output": false }, @@ -149,7 +149,7 @@ }, { "cell_type": "markdown", - "id": "1d36a985", + "id": "db6c105f", "metadata": {}, "source": [ "To exploit the isomorphism between consumption-smoothing and tax-smoothing models, we simply use code from [Consumption Smoothing with Complete and Incomplete Markets](https://python-advanced.quantecon.org/smoothing.html)" @@ -157,7 +157,7 @@ }, { "cell_type": "markdown", - "id": "f134b54e", + "id": "96eddc84", "metadata": {}, "source": [ "### Code\n", @@ -171,7 +171,7 @@ { "cell_type": "code", "execution_count": null, - "id": "a7964ff5", + "id": "10d2a964", "metadata": { "hide-output": false }, @@ -301,7 +301,7 @@ }, { "cell_type": "markdown", - "id": "11593f73", + "id": "ef038db1", "metadata": {}, "source": [ "### Revisiting the consumption-smoothing model\n", @@ -318,7 +318,7 @@ { "cell_type": "code", "execution_count": null, - "id": "41bd1858", + "id": "606009e9", "metadata": { "hide-output": false }, @@ -354,7 +354,7 @@ }, { "cell_type": "markdown", - "id": "975f6a0d", + "id": "50aef490", "metadata": {}, "source": [ "In the graph on the left, for the same sample path of nonfinancial\n", @@ -369,7 +369,7 @@ }, { "cell_type": "markdown", - "id": "0e727fbc", + "id": "e660dafe", "metadata": {}, "source": [ "#### Relabeling variables to create tax-smoothing models\n", @@ -380,7 +380,7 @@ { "cell_type": "code", "execution_count": null, - "id": "7e7b7d92", + "id": "6cd4ed41", "metadata": { "hide-output": false }, @@ -409,7 +409,7 @@ }, { "cell_type": "markdown", - "id": "5f5b1df0", + "id": "e22045bc", "metadata": {}, "source": [ "## Tax Smoothing with Complete Markets\n", @@ -460,7 +460,7 @@ }, { "cell_type": "markdown", - "id": "94f4a67e", + "id": "02653da3", "metadata": {}, "source": [ "## Returns on State-Contingent Debt\n", @@ -492,7 +492,7 @@ { "cell_type": "code", "execution_count": null, - "id": "a1a9fb0e", + "id": "2cbd9af4", "metadata": { "hide-output": false }, @@ -532,7 +532,7 @@ }, { "cell_type": "markdown", - "id": "9b08b300", + "id": "a42d8cb5", "metadata": {}, "source": [ "### An Example of Tax Smoothing\n", @@ -561,7 +561,7 @@ { "cell_type": "code", "execution_count": null, - "id": "724b5636", + "id": "21d707f6", "metadata": { "hide-output": false }, @@ -640,7 +640,7 @@ }, { "cell_type": "markdown", - "id": "b24a3814", + "id": "70dfce65", "metadata": {}, "source": [ "### Explanation\n", @@ -666,7 +666,7 @@ }, { "cell_type": "markdown", - "id": "df74483a", + "id": "ef6c0a30", "metadata": {}, "source": [ "### Exercise 7.1\n", @@ -687,7 +687,7 @@ }, { "cell_type": "markdown", - "id": "74ac736c", + "id": "3190d4e1", "metadata": {}, "source": [ "## More Finite Markov Chain Tax-Smoothing Examples\n", @@ -705,7 +705,7 @@ { "cell_type": "code", "execution_count": null, - "id": "80230211", + "id": "37d6cbb5", "metadata": { "hide-output": false }, @@ -825,7 +825,7 @@ }, { "cell_type": "markdown", - "id": "38f9f5ed", + "id": "e58f6454", "metadata": {}, "source": [ "### Parameters" @@ -834,7 +834,7 @@ { "cell_type": "code", "execution_count": null, - "id": "ad0af56c", + "id": "65329cfa", "metadata": { "hide-output": false }, @@ -853,7 +853,7 @@ }, { "cell_type": "markdown", - "id": "c0ef471a", + "id": "04d8cd0d", "metadata": {}, "source": [ "### Example 1\n", @@ -885,7 +885,7 @@ { "cell_type": "code", "execution_count": null, - "id": "07419783", + "id": "6d74568e", "metadata": { "hide-output": false }, @@ -902,7 +902,7 @@ { "cell_type": "code", "execution_count": null, - "id": "26ace3f1", + "id": "10cca6f3", "metadata": { "hide-output": false }, @@ -915,7 +915,7 @@ { "cell_type": "code", "execution_count": null, - "id": "ac1dcf2e", + "id": "c31829f7", "metadata": { "hide-output": false }, @@ -929,7 +929,7 @@ }, { "cell_type": "markdown", - "id": "8d3957f9", + "id": "c0977e1c", "metadata": {}, "source": [ "### Example 2\n", @@ -955,7 +955,7 @@ { "cell_type": "code", "execution_count": null, - "id": "f90a5da1", + "id": "af83879d", "metadata": { "hide-output": false }, @@ -972,7 +972,7 @@ { "cell_type": "code", "execution_count": null, - "id": "f6ef36d6", + "id": "25952b4f", "metadata": { "hide-output": false }, @@ -984,7 +984,7 @@ }, { "cell_type": "markdown", - "id": "f4c16df4", + "id": "5ad50753", "metadata": {}, "source": [ "### Example 3\n", @@ -1013,7 +1013,7 @@ { "cell_type": "code", "execution_count": null, - "id": "c26eaee4", + "id": "9d1ac176", "metadata": { "hide-output": false }, @@ -1031,7 +1031,7 @@ { "cell_type": "code", "execution_count": null, - "id": "34d5e9d6", + "id": "57958de2", "metadata": { "hide-output": false }, @@ -1043,7 +1043,7 @@ }, { "cell_type": "markdown", - "id": "520bd58c", + "id": "6e3632fd", "metadata": {}, "source": [ "### Example 4\n", @@ -1070,7 +1070,7 @@ { "cell_type": "code", "execution_count": null, - "id": "d57703e1", + "id": "7d586c48", "metadata": { "hide-output": false }, @@ -1089,7 +1089,7 @@ { "cell_type": "code", "execution_count": null, - "id": "358f0e22", + "id": "c4d415fe", "metadata": { "hide-output": false }, @@ -1101,7 +1101,7 @@ }, { "cell_type": "markdown", - "id": "781bc96e", + "id": "1094a4f2", "metadata": {}, "source": [ "### Example 5\n", @@ -1133,7 +1133,7 @@ { "cell_type": "code", "execution_count": null, - "id": "ff6570d0", + "id": "92c6e8be", "metadata": { "hide-output": false }, @@ -1154,7 +1154,7 @@ { "cell_type": "code", "execution_count": null, - "id": "14cc665d", + "id": "b1833f20", "metadata": { "hide-output": false }, @@ -1166,7 +1166,7 @@ }, { "cell_type": "markdown", - "id": "5be41310", + "id": "5c6227dd", "metadata": {}, "source": [ "### Continuous-State Gaussian Model\n", @@ -1216,7 +1216,7 @@ }, { "cell_type": "markdown", - "id": "cf02d670", + "id": "42bda0bf", "metadata": {}, "source": [ "#### Related Lectures\n", @@ -1242,7 +1242,7 @@ } ], "metadata": { - "date": 1680677527.0435083, + "date": 1685490453.8118196, "filename": "smoothing_tax.md", "kernelspec": { "display_name": "Python", diff --git a/stationary_densities.ipynb b/stationary_densities.ipynb index 74c531a..f843c72 100644 --- a/stationary_densities.ipynb +++ b/stationary_densities.ipynb @@ -2,7 +2,7 @@ "cells": [ { "cell_type": "markdown", - "id": "01fdcb8f", + "id": "ad48e6e6", "metadata": {}, "source": [ "\n", @@ -11,7 +11,7 @@ }, { "cell_type": "markdown", - "id": "c812b518", + "id": "0425ca9d", "metadata": {}, "source": [ "# Continuous State Markov Chains\n", @@ -22,7 +22,7 @@ }, { "cell_type": "markdown", - "id": "fdf72bd5", + "id": "d5e22deb", "metadata": {}, "source": [ "## Contents\n", @@ -38,7 +38,7 @@ }, { "cell_type": "markdown", - "id": "56208c3a", + "id": "59e0096f", "metadata": {}, "source": [ "In addition to what’s in Anaconda, this lecture will need the following libraries:" @@ -47,7 +47,7 @@ { "cell_type": "code", "execution_count": null, - "id": "93619cea", + "id": "27dd0f99", "metadata": { "hide-output": false }, @@ -58,7 +58,7 @@ }, { "cell_type": "markdown", - "id": "abbb59d3", + "id": "928f1fcd", "metadata": {}, "source": [ "## Overview\n", @@ -106,7 +106,7 @@ { "cell_type": "code", "execution_count": null, - "id": "0cc4668b", + "id": "4528a54c", "metadata": { "hide-output": false }, @@ -122,7 +122,7 @@ }, { "cell_type": "markdown", - "id": "a0a0d05d", + "id": "1c85a8e6", "metadata": {}, "source": [ "\n", @@ -131,7 +131,7 @@ }, { "cell_type": "markdown", - "id": "ee387d0e", + "id": "104ab764", "metadata": {}, "source": [ "## The Density Case\n", @@ -151,7 +151,7 @@ }, { "cell_type": "markdown", - "id": "a8a0ae44", + "id": "c2104a6e", "metadata": {}, "source": [ "### Definitions and Basic Properties\n", @@ -229,7 +229,7 @@ }, { "cell_type": "markdown", - "id": "b3220599", + "id": "e28466d0", "metadata": {}, "source": [ "### Connection to Stochastic Difference Equations\n", @@ -351,7 +351,7 @@ }, { "cell_type": "markdown", - "id": "33f84b5c", + "id": "bb4076f0", "metadata": {}, "source": [ "### Distribution Dynamics\n", @@ -438,7 +438,7 @@ }, { "cell_type": "markdown", - "id": "d4306f52", + "id": "92166bd2", "metadata": {}, "source": [ "### Computation\n", @@ -519,7 +519,7 @@ }, { "cell_type": "markdown", - "id": "45f9ac19", + "id": "c78e4e7d", "metadata": {}, "source": [ "### Implementation\n", @@ -544,7 +544,7 @@ }, { "cell_type": "markdown", - "id": "c88e6d8a", + "id": "5d3d154a", "metadata": {}, "source": [ "### Example\n", @@ -558,7 +558,7 @@ { "cell_type": "code", "execution_count": null, - "id": "8d6cf0c3", + "id": "4211272f", "metadata": { "hide-output": false }, @@ -608,7 +608,7 @@ }, { "cell_type": "markdown", - "id": "8a594fa7", + "id": "96357c94", "metadata": {}, "source": [ "The figure shows part of the density sequence $ \\{\\psi_t\\} $, with each\n", @@ -623,7 +623,7 @@ }, { "cell_type": "markdown", - "id": "66365f6b", + "id": "4736a546", "metadata": {}, "source": [ "## Beyond Densities\n", @@ -645,7 +645,7 @@ }, { "cell_type": "markdown", - "id": "e5e1a3ba", + "id": "9a99cb21", "metadata": {}, "source": [ "### Example and Definitions\n", @@ -702,7 +702,7 @@ }, { "cell_type": "markdown", - "id": "d22c14b8", + "id": "739ae5aa", "metadata": {}, "source": [ "### Computation\n", @@ -717,7 +717,7 @@ }, { "cell_type": "markdown", - "id": "61c01d7c", + "id": "92ac9d0d", "metadata": {}, "source": [ "## Stability\n", @@ -733,7 +733,7 @@ }, { "cell_type": "markdown", - "id": "73a18487", + "id": "3f1631d3", "metadata": {}, "source": [ "### Theoretical Results\n", @@ -816,7 +816,7 @@ }, { "cell_type": "markdown", - "id": "47f72059", + "id": "3b0f598e", "metadata": {}, "source": [ "### An Example of Stability\n", @@ -843,7 +843,7 @@ }, { "cell_type": "markdown", - "id": "885c556d", + "id": "a0cd3356", "metadata": {}, "source": [ "### Computing Stationary Densities\n", @@ -895,7 +895,7 @@ }, { "cell_type": "markdown", - "id": "5c3e8bca", + "id": "1b81e19c", "metadata": {}, "source": [ "## Exercises\n", @@ -906,7 +906,7 @@ }, { "cell_type": "markdown", - "id": "c33c9f76", + "id": "d5db18b1", "metadata": {}, "source": [ "## Exercise 2.1\n", @@ -961,7 +961,7 @@ }, { "cell_type": "markdown", - "id": "b2762eb7", + "id": "5ef27020", "metadata": {}, "source": [ "## Solution to[ Exercise 2.1](https://python-advanced.quantecon.org/#sd_ex1)\n", @@ -981,7 +981,7 @@ { "cell_type": "code", "execution_count": null, - "id": "51a6ad60", + "id": "017879e2", "metadata": { "hide-output": false }, @@ -1020,7 +1020,7 @@ }, { "cell_type": "markdown", - "id": "0fd25c7d", + "id": "5cfec88f", "metadata": {}, "source": [ "\n", @@ -1029,7 +1029,7 @@ }, { "cell_type": "markdown", - "id": "1b7dc89b", + "id": "8e5e8b7a", "metadata": {}, "source": [ "## Exercise 2.2\n", @@ -1048,7 +1048,7 @@ { "cell_type": "code", "execution_count": null, - "id": "ff225664", + "id": "f3111af5", "metadata": { "hide-output": false }, @@ -1059,7 +1059,7 @@ }, { "cell_type": "markdown", - "id": "24769230", + "id": "605f3f8e", "metadata": {}, "source": [ "## Solution to[ Exercise 2.2](https://python-advanced.quantecon.org/#sd_ex2)\n", @@ -1070,7 +1070,7 @@ { "cell_type": "code", "execution_count": null, - "id": "fe86c2be", + "id": "2a40cc68", "metadata": { "hide-output": false }, @@ -1122,7 +1122,7 @@ }, { "cell_type": "markdown", - "id": "d120af33", + "id": "83dc49fe", "metadata": {}, "source": [ "\n", @@ -1131,7 +1131,7 @@ }, { "cell_type": "markdown", - "id": "5c822bd4", + "id": "253eef93", "metadata": {}, "source": [ "## Exercise 2.3\n", @@ -1155,7 +1155,7 @@ { "cell_type": "code", "execution_count": null, - "id": "1956b4d8", + "id": "76b00f11", "metadata": { "hide-output": false }, @@ -1177,7 +1177,7 @@ }, { "cell_type": "markdown", - "id": "a1668171", + "id": "dd090cb7", "metadata": {}, "source": [ "Each data set is represented by a box, where the top and bottom of the box are the third and first quartiles of the data, and the red line in the center is the median.\n", @@ -1203,7 +1203,7 @@ { "cell_type": "code", "execution_count": null, - "id": "7eaff244", + "id": "9c059040", "metadata": { "hide-output": false }, @@ -1214,7 +1214,7 @@ }, { "cell_type": "markdown", - "id": "cd4dcd8d", + "id": "343504e8", "metadata": {}, "source": [ "For each $ X_0 $ in this set,\n", @@ -1228,7 +1228,7 @@ }, { "cell_type": "markdown", - "id": "9919fafc", + "id": "a7dcb2cd", "metadata": {}, "source": [ "## Solution to[ Exercise 2.3](https://python-advanced.quantecon.org/#sd_ex3)\n", @@ -1242,7 +1242,7 @@ { "cell_type": "code", "execution_count": null, - "id": "133a99a6", + "id": "41ffbc50", "metadata": { "hide-output": false }, @@ -1276,7 +1276,7 @@ }, { "cell_type": "markdown", - "id": "0b25f5f3", + "id": "6f9e238f", "metadata": {}, "source": [ "## Appendix\n", @@ -1296,7 +1296,7 @@ } ], "metadata": { - "date": 1680677527.1191304, + "date": 1685490453.8861685, "filename": "stationary_densities.md", "kernelspec": { "display_name": "Python", diff --git a/status.ipynb b/status.ipynb index adf703f..2efa44e 100644 --- a/status.ipynb +++ b/status.ipynb @@ -2,7 +2,7 @@ "cells": [ { "cell_type": "markdown", - "id": "94297ca2", + "id": "84469410", "metadata": {}, "source": [ "# Execution Statistics\n", @@ -11,64 +11,64 @@ "\n", "[](https://python-advanced.quantecon.org/BCG_complete_mkts.html)[](https://python-advanced.quantecon.org/BCG_incomplete_mkts.html)[](https://python-advanced.quantecon.org/additive_functionals.html)[](https://python-advanced.quantecon.org/amss.html)[](https://python-advanced.quantecon.org/amss2.html)[](https://python-advanced.quantecon.org/amss3.html)[](https://python-advanced.quantecon.org/arellano.html)[](https://python-advanced.quantecon.org/arma.html)[](https://python-advanced.quantecon.org/asset_pricing_lph.html)[](https://python-advanced.quantecon.org/black_litterman.html)[](https://python-advanced.quantecon.org/calvo.html)[](https://python-advanced.quantecon.org/cattle_cycles.html)[](https://python-advanced.quantecon.org/chang_credible.html)[](https://python-advanced.quantecon.org/chang_ramsey.html)[](https://python-advanced.quantecon.org/classical_filtering.html)[](https://python-advanced.quantecon.org/coase.html)[](https://python-advanced.quantecon.org/cons_news.html)[](https://python-advanced.quantecon.org/discrete_dp.html)[](https://python-advanced.quantecon.org/dyn_stack.html)[](https://python-advanced.quantecon.org/entropy.html)[](https://python-advanced.quantecon.org/estspec.html)[](https://python-advanced.quantecon.org/five_preferences.html)[](https://python-advanced.quantecon.org/growth_in_dles.html)[](https://python-advanced.quantecon.org/hs_invertibility_example.html)[](https://python-advanced.quantecon.org/hs_recursive_models.html)[](https://python-advanced.quantecon.org/intro.html)[](https://python-advanced.quantecon.org/irfs_in_hall_model.html)[](https://python-advanced.quantecon.org/knowing_forecasts_of_others.html)[](https://python-advanced.quantecon.org/lqramsey.html)[](https://python-advanced.quantecon.org/lu_tricks.html)[](https://python-advanced.quantecon.org/lucas_asset_pricing_dles.html)[](https://python-advanced.quantecon.org/lucas_model.html)[](https://python-advanced.quantecon.org/markov_jump_lq.html)[](https://python-advanced.quantecon.org/matsuyama.html)[](https://python-advanced.quantecon.org/muth_kalman.html)[](https://python-advanced.quantecon.org/opt_tax_recur.html)[](https://python-advanced.quantecon.org/orth_proj.html)[](https://python-advanced.quantecon.org/permanent_income_dles.html)[](https://python-advanced.quantecon.org/rob_markov_perf.html)[](https://python-advanced.quantecon.org/robustness.html)[](https://python-advanced.quantecon.org/rosen_schooling_model.html)[](https://python-advanced.quantecon.org/smoothing.html)[](https://python-advanced.quantecon.org/smoothing_tax.html)[](https://python-advanced.quantecon.org/stationary_densities.html)[](https://python-advanced.quantecon.org/.html)[](https://python-advanced.quantecon.org/tax_smoothing_1.html)[](https://python-advanced.quantecon.org/tax_smoothing_2.html)[](https://python-advanced.quantecon.org/tax_smoothing_3.html)[](https://python-advanced.quantecon.org/troubleshooting.html)[](https://python-advanced.quantecon.org/un_insure.html)[](https://python-advanced.quantecon.org/zreferences.html)|Document|Modified|Method|Run Time (s)|Status|\n", "|:------------------:|:------------------:|:------------------:|:------------------:|:------------------:|\n", - "|BCG_complete_mkts|2023-04-05 03:30|cache|64.4|✅|\n", - "|BCG_incomplete_mkts|2023-04-05 03:32|cache|104.34|✅|\n", - "|additive_functionals|2023-04-05 03:32|cache|21.22|✅|\n", - "|amss|2023-04-05 03:41|cache|507.39|✅|\n", - "|amss2|2023-04-05 03:42|cache|75.15|✅|\n", - "|amss3|2023-04-05 03:47|cache|331.37|✅|\n", - "|arellano|2023-04-05 03:57|cache|561.9|✅|\n", - "|arma|2023-04-05 03:57|cache|12.05|✅|\n", - "|asset_pricing_lph|2023-04-05 03:57|cache|3.39|✅|\n", - "|black_litterman|2023-04-05 03:58|cache|74.42|✅|\n", - "|calvo|2023-04-05 03:58|cache|7.93|✅|\n", - "|cattle_cycles|2023-04-05 03:58|cache|7.1|✅|\n", - "|chang_credible|2023-04-05 04:02|cache|217.95|✅|\n", - "|chang_ramsey|2023-04-05 04:09|cache|429.46|✅|\n", - "|classical_filtering|2023-04-05 04:09|cache|1.65|✅|\n", - "|coase|2023-04-05 04:09|cache|9.68|✅|\n", - "|cons_news|2023-04-05 04:10|cache|7.58|✅|\n", - "|discrete_dp|2023-04-05 04:10|cache|52.02|✅|\n", - "|dyn_stack|2023-04-05 04:11|cache|9.49|✅|\n", - "|entropy|2023-04-05 04:11|cache|1.05|✅|\n", - "|estspec|2023-04-05 04:11|cache|8.47|✅|\n", - "|five_preferences|2023-04-05 04:12|cache|54.13|✅|\n", - "|growth_in_dles|2023-04-05 04:12|cache|7.15|✅|\n", - "|hs_invertibility_example|2023-04-05 04:12|cache|7.35|✅|\n", - "|hs_recursive_models|2023-04-05 04:12|cache|4.02|✅|\n", - "|intro|2023-04-05 04:12|cache|4.02|✅|\n", - "|irfs_in_hall_model|2023-04-05 04:12|cache|7.23|✅|\n", - "|knowing_forecasts_of_others|2023-04-05 04:13|cache|29.35|✅|\n", - "|lqramsey|2023-04-05 04:13|cache|9.73|✅|\n", - "|lu_tricks|2023-04-05 04:13|cache|2.96|✅|\n", - "|lucas_asset_pricing_dles|2023-04-05 04:13|cache|7.25|✅|\n", - "|lucas_model|2023-04-05 04:13|cache|10.78|✅|\n", - "|markov_jump_lq|2023-04-05 04:15|cache|93.59|✅|\n", - "|matsuyama|2023-04-05 04:15|cache|8.85|✅|\n", - "|muth_kalman|2023-04-05 04:15|cache|7.76|✅|\n", - "|opt_tax_recur|2023-04-05 04:16|cache|60.02|✅|\n", - "|orth_proj|2023-04-05 04:16|cache|1.48|✅|\n", - "|permanent_income_dles|2023-04-05 04:16|cache|7.21|✅|\n", - "|rob_markov_perf|2023-04-05 04:16|cache|7.31|✅|\n", - "|robustness|2023-04-05 04:16|cache|9.2|✅|\n", - "|rosen_schooling_model|2023-04-05 04:17|cache|7.19|✅|\n", - "|smoothing|2023-04-05 04:17|cache|7.65|✅|\n", - "|smoothing_tax|2023-04-05 04:17|cache|11.67|✅|\n", - "|stationary_densities|2023-04-05 04:17|cache|13.96|✅|\n", - "|status|2023-04-05 04:12|cache|4.02|✅|\n", - "|tax_smoothing_1|2023-04-05 04:17|cache|15.07|✅|\n", - "|tax_smoothing_2|2023-04-05 04:18|cache|8.26|✅|\n", - "|tax_smoothing_3|2023-04-05 04:18|cache|7.8|✅|\n", - "|troubleshooting|2023-04-05 04:12|cache|4.02|✅|\n", - "|un_insure|2023-04-05 04:18|cache|15.79|✅|\n", - "|zreferences|2023-04-05 04:12|cache|4.02|✅|\n", + "|BCG_complete_mkts|2023-05-28 04:24|cache|68.48|✅|\n", + "|BCG_incomplete_mkts|2023-05-28 04:26|cache|102.58|✅|\n", + "|additive_functionals|2023-05-30 23:47|cache|6.83|❌|\n", + "|amss|2023-05-28 04:35|cache|514.04|✅|\n", + "|amss2|2023-05-28 04:36|cache|74.81|✅|\n", + "|amss3|2023-05-28 04:41|cache|334.9|✅|\n", + "|arellano|2023-05-28 04:52|cache|614.06|✅|\n", + "|arma|2023-05-28 04:52|cache|11.76|✅|\n", + "|asset_pricing_lph|2023-05-28 04:52|cache|3.07|✅|\n", + "|black_litterman|2023-05-28 04:53|cache|73.48|✅|\n", + "|calvo|2023-05-28 04:53|cache|7.91|✅|\n", + "|cattle_cycles|2023-05-28 04:53|cache|7.1|✅|\n", + "|chang_credible|2023-05-28 04:57|cache|213.91|✅|\n", + "|chang_ramsey|2023-05-28 05:04|cache|424.31|✅|\n", + "|classical_filtering|2023-05-28 05:04|cache|1.64|✅|\n", + "|coase|2023-05-28 05:04|cache|8.97|✅|\n", + "|cons_news|2023-05-28 05:04|cache|7.32|✅|\n", + "|discrete_dp|2023-05-28 05:05|cache|39.35|✅|\n", + "|dyn_stack|2023-05-28 05:05|cache|9.34|✅|\n", + "|entropy|2023-05-28 05:05|cache|1.21|✅|\n", + "|estspec|2023-05-28 05:05|cache|8.02|✅|\n", + "|five_preferences|2023-05-28 05:06|cache|52.45|✅|\n", + "|growth_in_dles|2023-05-28 05:06|cache|6.89|✅|\n", + "|hs_invertibility_example|2023-05-28 05:06|cache|10.02|✅|\n", + "|hs_recursive_models|2023-05-28 05:06|cache|1.2|✅|\n", + "|intro|2023-05-28 05:06|cache|1.2|✅|\n", + "|irfs_in_hall_model|2023-05-28 05:07|cache|6.92|✅|\n", + "|knowing_forecasts_of_others|2023-05-28 05:07|cache|32.24|✅|\n", + "|lqramsey|2023-05-28 05:07|cache|9.29|✅|\n", + "|lu_tricks|2023-05-28 05:07|cache|2.6|✅|\n", + "|lucas_asset_pricing_dles|2023-05-28 05:07|cache|6.97|✅|\n", + "|lucas_model|2023-05-28 05:08|cache|10.35|✅|\n", + "|markov_jump_lq|2023-05-28 05:09|cache|93.64|✅|\n", + "|matsuyama|2023-05-28 05:09|cache|8.78|✅|\n", + "|muth_kalman|2023-05-28 05:09|cache|7.69|✅|\n", + "|opt_tax_recur|2023-05-28 05:10|cache|59.8|✅|\n", + "|orth_proj|2023-05-28 05:11|cache|1.39|✅|\n", + "|permanent_income_dles|2023-05-28 05:11|cache|7.01|✅|\n", + "|rob_markov_perf|2023-05-28 05:11|cache|7.14|✅|\n", + "|robustness|2023-05-30 23:47|cache|6.58|❌|\n", + "|rosen_schooling_model|2023-05-28 05:11|cache|6.92|✅|\n", + "|smoothing|2023-05-28 05:11|cache|7.38|✅|\n", + "|smoothing_tax|2023-05-28 05:11|cache|11.1|✅|\n", + "|stationary_densities|2023-05-28 05:12|cache|13.43|✅|\n", + "|status|2023-05-28 05:06|cache|1.2|✅|\n", + "|tax_smoothing_1|2023-05-28 05:12|cache|14.61|✅|\n", + "|tax_smoothing_2|2023-05-28 05:12|cache|7.93|✅|\n", + "|tax_smoothing_3|2023-05-28 05:12|cache|7.75|✅|\n", + "|troubleshooting|2023-05-28 05:06|cache|1.2|✅|\n", + "|un_insure|2023-05-28 05:12|cache|15.51|✅|\n", + "|zreferences|2023-05-28 05:06|cache|1.2|✅|\n", "These lectures are built on `linux` instances through `github actions` so are\n", "executed using the following [hardware specifications](https://docs.github.com/en/actions/reference/specifications-for-github-hosted-runners#supported-runners-and-hardware-resources)" ] } ], "metadata": { - "date": 1680677527.1518707, + "date": 1685490453.920168, "filename": "status.md", "kernelspec": { "display_name": "Python", diff --git a/tax_smoothing_1.ipynb b/tax_smoothing_1.ipynb index f19bd8b..3d67d87 100644 --- a/tax_smoothing_1.ipynb +++ b/tax_smoothing_1.ipynb @@ -2,7 +2,7 @@ "cells": [ { "cell_type": "markdown", - "id": "7dca66c0", + "id": "78145c27", "metadata": {}, "source": [ "\n", @@ -13,7 +13,7 @@ }, { "cell_type": "markdown", - "id": "3bc6f6ef", + "id": "321269b9", "metadata": {}, "source": [ "# How to Pay for a War: Part 1" @@ -21,7 +21,7 @@ }, { "cell_type": "markdown", - "id": "a789ede4", + "id": "3e342773", "metadata": {}, "source": [ "## Contents\n", @@ -36,7 +36,7 @@ }, { "cell_type": "markdown", - "id": "094dff69", + "id": "1b38c744", "metadata": {}, "source": [ "In addition to what’s in Anaconda, this lecture will deploy quantecon:" @@ -45,7 +45,7 @@ { "cell_type": "code", "execution_count": null, - "id": "b264f59d", + "id": "29bccbd1", "metadata": { "hide-output": false }, @@ -56,7 +56,7 @@ }, { "cell_type": "markdown", - "id": "56248531", + "id": "d8e2189e", "metadata": {}, "source": [ "## Reader’s Guide\n", @@ -67,7 +67,7 @@ { "cell_type": "code", "execution_count": null, - "id": "b7a3f366", + "id": "fc4349cf", "metadata": { "hide-output": false }, @@ -81,7 +81,7 @@ }, { "cell_type": "markdown", - "id": "0cd16869", + "id": "b65b200c", "metadata": {}, "source": [ "This lecture uses the method of **Markov jump linear quadratic dynamic programming** that is described in lecture\n", @@ -185,7 +185,7 @@ }, { "cell_type": "markdown", - "id": "6e9cc371", + "id": "9a44c8ea", "metadata": {}, "source": [ "## Public Finance Questions\n", @@ -230,7 +230,7 @@ }, { "cell_type": "markdown", - "id": "b3759187", + "id": "d626f6aa", "metadata": {}, "source": [ "## Barro (1979) Model\n", @@ -347,7 +347,7 @@ { "cell_type": "code", "execution_count": null, - "id": "922495d9", + "id": "5856b8f4", "metadata": { "hide-output": false }, @@ -392,7 +392,7 @@ }, { "cell_type": "markdown", - "id": "20ab29a9", + "id": "3776efa0", "metadata": {}, "source": [ "We can now create an instance of `LQ`:" @@ -401,7 +401,7 @@ { "cell_type": "code", "execution_count": null, - "id": "dbec9ed3", + "id": "a35aa24a", "metadata": { "hide-output": false }, @@ -414,7 +414,7 @@ }, { "cell_type": "markdown", - "id": "fa905352", + "id": "a259e0d0", "metadata": {}, "source": [ "We can see the isomorphism by noting that consumption is a martingale in\n", @@ -454,7 +454,7 @@ { "cell_type": "code", "execution_count": null, - "id": "2b428e1b", + "id": "7998fa5c", "metadata": { "hide-output": false }, @@ -465,7 +465,7 @@ }, { "cell_type": "markdown", - "id": "92ff6d18", + "id": "20b25381", "metadata": {}, "source": [ "This explains the fanning out of the conditional empirical distribution of taxation across time, computing\n", @@ -476,7 +476,7 @@ { "cell_type": "code", "execution_count": null, - "id": "cde383a1", + "id": "59fda209", "metadata": { "hide-output": false }, @@ -493,7 +493,7 @@ }, { "cell_type": "markdown", - "id": "e8b4c812", + "id": "afe1d4d5", "metadata": {}, "source": [ "We can see a similar, but a smoother pattern, if we plot government debt\n", @@ -503,7 +503,7 @@ { "cell_type": "code", "execution_count": null, - "id": "1871cb4b", + "id": "93513804", "metadata": { "hide-output": false }, @@ -520,7 +520,7 @@ }, { "cell_type": "markdown", - "id": "d7963705", + "id": "29fccc13", "metadata": {}, "source": [ "## Python Class to Solve Markov Jump Linear Quadratic Control Problems\n", @@ -549,7 +549,7 @@ }, { "cell_type": "markdown", - "id": "6fecad85", + "id": "4ee65b11", "metadata": {}, "source": [ "## Barro Model with a Time-varying Interest Rate\n", @@ -591,7 +591,7 @@ { "cell_type": "code", "execution_count": null, - "id": "e16ec53f", + "id": "3f0f3ed7", "metadata": { "hide-output": false }, @@ -623,7 +623,7 @@ }, { "cell_type": "markdown", - "id": "6511d6bb", + "id": "ae6a164f", "metadata": {}, "source": [ "The decision rules are now dependent on the Markov state:" @@ -632,7 +632,7 @@ { "cell_type": "code", "execution_count": null, - "id": "a5294130", + "id": "b864003e", "metadata": { "hide-output": false }, @@ -644,7 +644,7 @@ { "cell_type": "code", "execution_count": null, - "id": "49e2c7ad", + "id": "434e4d43", "metadata": { "hide-output": false }, @@ -655,7 +655,7 @@ }, { "cell_type": "markdown", - "id": "57c26da1", + "id": "96540c74", "metadata": {}, "source": [ "Simulating a large number of such economies over time reveals\n", @@ -668,7 +668,7 @@ { "cell_type": "code", "execution_count": null, - "id": "c91faf76", + "id": "61ecc94d", "metadata": { "hide-output": false }, @@ -686,7 +686,7 @@ } ], "metadata": { - "date": 1680677527.1923513, + "date": 1685490453.9609783, "filename": "tax_smoothing_1.md", "kernelspec": { "display_name": "Python", diff --git a/tax_smoothing_2.ipynb b/tax_smoothing_2.ipynb index 455e2f2..5cfeb68 100644 --- a/tax_smoothing_2.ipynb +++ b/tax_smoothing_2.ipynb @@ -2,7 +2,7 @@ "cells": [ { "cell_type": "markdown", - "id": "bcbdff97", + "id": "e7655da7", "metadata": {}, "source": [ "\n", @@ -13,7 +13,7 @@ }, { "cell_type": "markdown", - "id": "b2e613b6", + "id": "fede8d83", "metadata": {}, "source": [ "# How to Pay for a War: Part 2" @@ -21,7 +21,7 @@ }, { "cell_type": "markdown", - "id": "75f45c1d", + "id": "3e3605fa", "metadata": {}, "source": [ "## Contents\n", @@ -38,7 +38,7 @@ }, { "cell_type": "markdown", - "id": "9ebe8562", + "id": "688d83fb", "metadata": {}, "source": [ "In addition to what’s in Anaconda, this lecture deploys the quantecon library:" @@ -47,7 +47,7 @@ { "cell_type": "code", "execution_count": null, - "id": "04f12a4f", + "id": "9681fe21", "metadata": { "hide-output": false }, @@ -58,7 +58,7 @@ }, { "cell_type": "markdown", - "id": "147d7fbc", + "id": "9b9f2a2f", "metadata": {}, "source": [ "## An Application of Markov Jump Linear Quadratic Dynamic Programming\n", @@ -106,7 +106,7 @@ { "cell_type": "code", "execution_count": null, - "id": "d46c0d90", + "id": "d1687595", "metadata": { "hide-output": false }, @@ -120,7 +120,7 @@ }, { "cell_type": "markdown", - "id": "4997f49c", + "id": "7cab3358", "metadata": {}, "source": [ "## Two example specifications\n", @@ -137,7 +137,7 @@ }, { "cell_type": "markdown", - "id": "2770a0d8", + "id": "4ea60a54", "metadata": {}, "source": [ "## One- and Two-period Bonds but No Restructuring\n", @@ -210,7 +210,7 @@ }, { "cell_type": "markdown", - "id": "4166f940", + "id": "6805fa68", "metadata": {}, "source": [ "## Mapping into an LQ Markov Jump Problem\n", @@ -375,7 +375,7 @@ { "cell_type": "code", "execution_count": null, - "id": "9e9633c2", + "id": "41c3bb06", "metadata": { "hide-output": false }, @@ -436,7 +436,7 @@ }, { "cell_type": "markdown", - "id": "26b3d26f", + "id": "3328ed35", "metadata": {}, "source": [ "With the above function, we can proceed to solve the model in two steps:\n", @@ -450,7 +450,7 @@ }, { "cell_type": "markdown", - "id": "4373ff7b", + "id": "256a64a6", "metadata": {}, "source": [ "## Penalty on Different Issuance Across Maturities\n", @@ -503,7 +503,7 @@ { "cell_type": "code", "execution_count": null, - "id": "8293f992", + "id": "da1ea74f", "metadata": { "hide-output": false }, @@ -557,7 +557,7 @@ }, { "cell_type": "markdown", - "id": "5405975b", + "id": "6ced945b", "metadata": {}, "source": [ "The above simulations show that when no penalty is imposed on different\n", @@ -574,7 +574,7 @@ { "cell_type": "code", "execution_count": null, - "id": "d2474627", + "id": "9eef7c33", "metadata": { "hide-output": false }, @@ -618,7 +618,7 @@ }, { "cell_type": "markdown", - "id": "44855f31", + "id": "e462d249", "metadata": {}, "source": [ "## A Model with Restructuring\n", @@ -795,7 +795,7 @@ }, { "cell_type": "markdown", - "id": "ac401efe", + "id": "30da82c0", "metadata": {}, "source": [ "## Restructuring as a Markov Jump Linear Quadratic Control Problem\n", @@ -808,7 +808,7 @@ { "cell_type": "code", "execution_count": null, - "id": "6c315c2e", + "id": "47dd11d3", "metadata": { "hide-output": false }, @@ -863,7 +863,7 @@ }, { "cell_type": "markdown", - "id": "5b398fd1", + "id": "280a79fe", "metadata": {}, "source": [ "### Example with Restructuring\n", @@ -894,7 +894,7 @@ { "cell_type": "code", "execution_count": null, - "id": "aaed30e8", + "id": "11678cca", "metadata": { "hide-output": false }, @@ -939,7 +939,7 @@ { "cell_type": "code", "execution_count": null, - "id": "04d93c3b", + "id": "951606df", "metadata": { "hide-output": false }, @@ -967,7 +967,7 @@ { "cell_type": "code", "execution_count": null, - "id": "6c41dd8d", + "id": "4bc1460a", "metadata": { "hide-output": false }, @@ -984,7 +984,7 @@ } ], "metadata": { - "date": 1680677527.2279928, + "date": 1685490453.9983878, "filename": "tax_smoothing_2.md", "kernelspec": { "display_name": "Python", diff --git a/tax_smoothing_3.ipynb b/tax_smoothing_3.ipynb index 6c76c17..26de76f 100644 --- a/tax_smoothing_3.ipynb +++ b/tax_smoothing_3.ipynb @@ -2,7 +2,7 @@ "cells": [ { "cell_type": "markdown", - "id": "b21a1a72", + "id": "e26be8e2", "metadata": {}, "source": [ "\n", @@ -13,7 +13,7 @@ }, { "cell_type": "markdown", - "id": "0e93319c", + "id": "ec6ac92c", "metadata": {}, "source": [ "# How to Pay for a War: Part 3" @@ -21,7 +21,7 @@ }, { "cell_type": "markdown", - "id": "dc045458", + "id": "431dbc38", "metadata": {}, "source": [ "## Contents\n", @@ -35,7 +35,7 @@ }, { "cell_type": "markdown", - "id": "7f380f4b", + "id": "68cec30f", "metadata": {}, "source": [ "In addition to what’s in Anaconda, this lecture deploys the quantecon library:" @@ -44,7 +44,7 @@ { "cell_type": "code", "execution_count": null, - "id": "ef6a0e80", + "id": "4a1ce279", "metadata": { "hide-output": false }, @@ -55,7 +55,7 @@ }, { "cell_type": "markdown", - "id": "d5d583f4", + "id": "c9f81bc9", "metadata": {}, "source": [ "## Another Application of Markov Jump Linear Quadratic Dynamic Programming\n", @@ -84,7 +84,7 @@ { "cell_type": "code", "execution_count": null, - "id": "ce1a10bd", + "id": "cbe27afc", "metadata": { "hide-output": false }, @@ -98,7 +98,7 @@ }, { "cell_type": "markdown", - "id": "e3074e28", + "id": "12533c4f", "metadata": {}, "source": [ "## Roll-Over Risk\n", @@ -150,7 +150,7 @@ }, { "cell_type": "markdown", - "id": "8c8c7be7", + "id": "6a5d5e1b", "metadata": {}, "source": [ "## A Dead End\n", @@ -188,7 +188,7 @@ }, { "cell_type": "markdown", - "id": "465322eb", + "id": "4466bc1b", "metadata": {}, "source": [ "## Better Representation of Roll-Over Risk\n", @@ -242,7 +242,7 @@ { "cell_type": "code", "execution_count": null, - "id": "c0dfccb2", + "id": "2c133b15", "metadata": { "hide-output": false }, @@ -302,7 +302,7 @@ }, { "cell_type": "markdown", - "id": "80aefc0b", + "id": "e78d4f2c", "metadata": {}, "source": [ "This model is simulated below, using the same process for $ G_t $ as\n", @@ -325,7 +325,7 @@ { "cell_type": "code", "execution_count": null, - "id": "524dfb94", + "id": "5640b9dc", "metadata": { "hide-output": false }, @@ -353,7 +353,7 @@ }, { "cell_type": "markdown", - "id": "7bae94c8", + "id": "f8c60120", "metadata": {}, "source": [ "We can adjust the model so that, rather than having debt fluctuate\n", @@ -367,7 +367,7 @@ { "cell_type": "code", "execution_count": null, - "id": "cab38e51", + "id": "35e36df9", "metadata": { "hide-output": false }, @@ -408,7 +408,7 @@ }, { "cell_type": "markdown", - "id": "b8ce71c0", + "id": "4557ca94", "metadata": {}, "source": [ "With a lower interest rate, the government has an incentive to\n", @@ -424,7 +424,7 @@ } ], "metadata": { - "date": 1680677527.2495377, + "date": 1685490454.0195963, "filename": "tax_smoothing_3.md", "kernelspec": { "display_name": "Python", diff --git a/troubleshooting.ipynb b/troubleshooting.ipynb index df929ff..1c32f62 100644 --- a/troubleshooting.ipynb +++ b/troubleshooting.ipynb @@ -2,7 +2,7 @@ "cells": [ { "cell_type": "markdown", - "id": "10272db4", + "id": "5f81e47b", "metadata": {}, "source": [ "\n", @@ -11,7 +11,7 @@ }, { "cell_type": "markdown", - "id": "74e79bb7", + "id": "96e6630d", "metadata": {}, "source": [ "# Troubleshooting" @@ -19,7 +19,7 @@ }, { "cell_type": "markdown", - "id": "783634d9", + "id": "427be46e", "metadata": {}, "source": [ "## Contents\n", @@ -31,7 +31,7 @@ }, { "cell_type": "markdown", - "id": "6a62e385", + "id": "55e6ef37", "metadata": {}, "source": [ "This page is for readers experiencing errors when running the code from the lectures." @@ -39,7 +39,7 @@ }, { "cell_type": "markdown", - "id": "f9a95076", + "id": "7005087c", "metadata": {}, "source": [ "## Fixing Your Local Environment\n", @@ -81,7 +81,7 @@ }, { "cell_type": "markdown", - "id": "dd2ad606", + "id": "01180b3a", "metadata": {}, "source": [ "## Reporting an Issue\n", @@ -98,7 +98,7 @@ } ], "metadata": { - "date": 1680677527.2562194, + "date": 1685490454.0263243, "filename": "troubleshooting.md", "kernelspec": { "display_name": "Python", diff --git a/un_insure.ipynb b/un_insure.ipynb index 8c2cf80..c4ac326 100644 --- a/un_insure.ipynb +++ b/un_insure.ipynb @@ -2,7 +2,7 @@ "cells": [ { "cell_type": "markdown", - "id": "26344b53", + "id": "2d3c427b", "metadata": {}, "source": [ "# Optimal Unemployment Insurance" @@ -10,7 +10,7 @@ }, { "cell_type": "markdown", - "id": "770b8665", + "id": "e0f405b3", "metadata": {}, "source": [ "## Overview\n", @@ -28,7 +28,7 @@ }, { "cell_type": "markdown", - "id": "9a7af76f", + "id": "63ad2dbb", "metadata": {}, "source": [ "## Shavell and Weiss’s Model\n", @@ -88,7 +88,7 @@ }, { "cell_type": "markdown", - "id": "7e594661", + "id": "59969ec4", "metadata": {}, "source": [ "### Autarky\n", @@ -160,7 +160,7 @@ }, { "cell_type": "markdown", - "id": "2e3a0bfa", + "id": "a069219a", "metadata": {}, "source": [ "### Full Information\n", @@ -274,7 +274,7 @@ }, { "cell_type": "markdown", - "id": "ee760c94", + "id": "f68ed0c1", "metadata": {}, "source": [ "### Incentive Problem\n", @@ -340,7 +340,7 @@ }, { "cell_type": "markdown", - "id": "fefff189", + "id": "4081f5b3", "metadata": {}, "source": [ "## Private Information\n", @@ -445,7 +445,7 @@ }, { "cell_type": "markdown", - "id": "6c94cdc0", + "id": "269b7ef7", "metadata": {}, "source": [ "### Computational Details\n", @@ -534,7 +534,7 @@ }, { "cell_type": "markdown", - "id": "a13302ea", + "id": "0ecca755", "metadata": {}, "source": [ "### Python Computations\n", @@ -547,7 +547,7 @@ { "cell_type": "code", "execution_count": null, - "id": "dcceb453", + "id": "33b2fa56", "metadata": { "hide-output": false }, @@ -562,7 +562,7 @@ }, { "cell_type": "markdown", - "id": "0d0d324f", + "id": "fa55eef6", "metadata": {}, "source": [ "We first create a class to set up a particular parametrization." @@ -571,7 +571,7 @@ { "cell_type": "code", "execution_count": null, - "id": "935cfd96", + "id": "52cd71ba", "metadata": { "hide-output": false }, @@ -594,7 +594,7 @@ }, { "cell_type": "markdown", - "id": "ff6f62c4", + "id": "14576702", "metadata": {}, "source": [ "### Parameter Values\n", @@ -609,7 +609,7 @@ { "cell_type": "code", "execution_count": null, - "id": "ad663dad", + "id": "6335d604", "metadata": { "hide-output": false }, @@ -635,7 +635,7 @@ }, { "cell_type": "markdown", - "id": "3e49b6ce", + "id": "5c370224", "metadata": {}, "source": [ "Recall that under autarky the value for an unemployed worker\n", @@ -674,7 +674,7 @@ { "cell_type": "code", "execution_count": null, - "id": "2110e37d", + "id": "971a4ec7", "metadata": { "hide-output": false }, @@ -693,7 +693,7 @@ }, { "cell_type": "markdown", - "id": "25ad67a5", + "id": "786a6c01", "metadata": {}, "source": [ "Since the calibration exercise is to match the hazard rate under autarky to the data, we must find an interest rate $ r $ to match `p(a,r) = 0.1`.\n", @@ -706,7 +706,7 @@ { "cell_type": "code", "execution_count": null, - "id": "2b95c5d0", + "id": "f0bf169c", "metadata": { "hide-output": false }, @@ -724,7 +724,7 @@ }, { "cell_type": "markdown", - "id": "7c926a84", + "id": "ab1c512e", "metadata": {}, "source": [ "Now, let us create an instance of the model with our parametrization" @@ -733,7 +733,7 @@ { "cell_type": "code", "execution_count": null, - "id": "1abf470a", + "id": "88855eba", "metadata": { "hide-output": false }, @@ -747,7 +747,7 @@ }, { "cell_type": "markdown", - "id": "f131c64f", + "id": "3f2e1d60", "metadata": {}, "source": [ "We want to compute an $ r $ that is consistent with the hazard rate 0.1 in autarky.\n", @@ -758,7 +758,7 @@ { "cell_type": "code", "execution_count": null, - "id": "25f6a932", + "id": "ea8ec262", "metadata": { "hide-output": false }, @@ -775,7 +775,7 @@ }, { "cell_type": "markdown", - "id": "e3c4ef2c", + "id": "4d2769c3", "metadata": {}, "source": [ "Now that we have calibrated our interest rate $ r $, we can continue with solving the model with private information." @@ -783,7 +783,7 @@ }, { "cell_type": "markdown", - "id": "c1b38526", + "id": "1db4efc1", "metadata": {}, "source": [ "### Computation under Private Information\n", @@ -808,7 +808,7 @@ { "cell_type": "code", "execution_count": null, - "id": "b2b3f2a7", + "id": "477be95f", "metadata": { "hide-output": false }, @@ -838,7 +838,7 @@ }, { "cell_type": "markdown", - "id": "660f3d6f", + "id": "741589f9", "metadata": {}, "source": [ "With these analytical solutions for optimal $ c $ and $ a $ in hand, we can reduce the minimization to [(39.12)](#equation-eq-hugo23) in the single variable\n", @@ -849,7 +849,7 @@ }, { "cell_type": "markdown", - "id": "1a3d6f09", + "id": "26be8106", "metadata": {}, "source": [ "### Algorithm\n", @@ -868,7 +868,7 @@ { "cell_type": "code", "execution_count": null, - "id": "4c7ecd83", + "id": "52fab446", "metadata": { "hide-output": false }, @@ -921,7 +921,7 @@ }, { "cell_type": "markdown", - "id": "5c4a7408", + "id": "a3e69f54", "metadata": {}, "source": [ "The below code executes steps 4 and 5 in the Algorithm until convergence to a function $ C^*(V) $." @@ -930,7 +930,7 @@ { "cell_type": "code", "execution_count": null, - "id": "524f1ba6", + "id": "c2f96b53", "metadata": { "hide-output": false }, @@ -958,7 +958,7 @@ }, { "cell_type": "markdown", - "id": "8b837096", + "id": "a7b529fe", "metadata": {}, "source": [ "## Outcomes\n", @@ -969,7 +969,7 @@ { "cell_type": "code", "execution_count": null, - "id": "072e90d2", + "id": "8cb90db3", "metadata": { "hide-output": false }, @@ -995,7 +995,7 @@ }, { "cell_type": "markdown", - "id": "20377cbe", + "id": "beadf9b2", "metadata": {}, "source": [ "### Replacement Ratios and Continuation Values\n", @@ -1010,7 +1010,7 @@ { "cell_type": "code", "execution_count": null, - "id": "8ff02035", + "id": "c22e2b45", "metadata": { "hide-output": false }, @@ -1030,7 +1030,7 @@ { "cell_type": "code", "execution_count": null, - "id": "d31730d1", + "id": "ee604be8", "metadata": { "hide-output": false }, @@ -1047,7 +1047,7 @@ { "cell_type": "code", "execution_count": null, - "id": "6f3341ac", + "id": "cca2e11f", "metadata": { "hide-output": false }, @@ -1083,7 +1083,7 @@ }, { "cell_type": "markdown", - "id": "52d1c2b7", + "id": "34e7c019", "metadata": {}, "source": [ "For an initial promised value $ V^u = V_{\\rm aut} $, the planner chooses the autarky level of $ 0 $ for the replacement ratio and instructs the worker to search at the autarky search intensity, regardless of the duration of unemployment\n", @@ -1093,7 +1093,7 @@ }, { "cell_type": "markdown", - "id": "6e39d545", + "id": "6f95f10d", "metadata": {}, "source": [ "### Interpretations\n", @@ -1147,7 +1147,7 @@ } ], "metadata": { - "date": 1680677527.3145578, + "date": 1685490454.0849657, "filename": "un_insure.md", "kernelspec": { "display_name": "Python", diff --git a/zreferences.ipynb b/zreferences.ipynb index 25663cc..1c71319 100644 --- a/zreferences.ipynb +++ b/zreferences.ipynb @@ -2,7 +2,7 @@ "cells": [ { "cell_type": "markdown", - "id": "bfd24c46", + "id": "2d2542c2", "metadata": {}, "source": [ "\n", @@ -11,7 +11,7 @@ }, { "cell_type": "markdown", - "id": "367fa281", + "id": "1871e063", "metadata": {}, "source": [ "# References\n", @@ -322,7 +322,7 @@ } ], "metadata": { - "date": 1680677527.3586204, + "date": 1685490454.1281092, "filename": "zreferences.md", "kernelspec": { "display_name": "Python",