From d25f2a03196206b90e76b87131b9928a5579ccfb Mon Sep 17 00:00:00 2001 From: quantecon-services Date: Sat, 4 Jan 2025 02:35:11 +0000 Subject: [PATCH] auto publishing updates to notebooks --- BCG_complete_mkts.ipynb | 74 ++-- BCG_incomplete_mkts.ipynb | 100 ++--- additive_functionals.ipynb | 76 ++-- amss.ipynb | 92 ++--- amss2.ipynb | 102 +++--- amss3.ipynb | 124 +++---- arellano.ipynb | 84 ++--- arma.ipynb | 94 ++--- asset_pricing_lph.ipynb | 106 +++--- black_litterman.ipynb | 66 ++-- calvo.ipynb | 584 ++++++++++++++---------------- calvo_abreu.ipynb | 50 +-- calvo_machine_learn.ipynb | 180 ++++----- cattle_cycles.ipynb | 50 +-- chang_credible.ipynb | 54 +-- chang_ramsey.ipynb | 72 ++-- classical_filtering.ipynb | 68 ++-- coase.ipynb | 76 ++-- cons_news.ipynb | 74 ++-- discrete_dp.ipynb | 202 +++++------ dyn_stack.ipynb | 126 +++---- entropy.ipynb | 38 +- estspec.ipynb | 50 +-- five_preferences.ipynb | 142 ++++---- growth_in_dles.ipynb | 96 ++--- hs_invertibility_example.ipynb | 36 +- hs_recursive_models.ipynb | 100 ++--- intro.ipynb | 22 +- irfs_in_hall_model.ipynb | 50 +-- knowing_forecasts_of_others.ipynb | 142 ++++---- lqramsey.ipynb | 74 ++-- lu_tricks.ipynb | 58 +-- lucas_asset_pricing_dles.ipynb | 54 +-- lucas_model.ipynb | 60 +-- markov_jump_lq.ipynb | 118 +++--- match_transport.ipynb | 368 ++++++++++--------- matsuyama.ipynb | 52 +-- muth_kalman.ipynb | 50 +-- opt_tax_recur.ipynb | 96 ++--- orth_proj.ipynb | 88 ++--- permanent_income_dles.ipynb | 26 +- rob_markov_perf.ipynb | 72 ++-- robustness.ipynb | 60 +-- rosen_schooling_model.ipynb | 42 +-- smoothing.ipynb | 54 +-- smoothing_tax.ipynb | 90 ++--- stationary_densities.ipynb | 82 ++--- status.ipynb | 118 +++--- tax_smoothing_1.ipynb | 52 +-- tax_smoothing_2.ipynb | 44 +-- tax_smoothing_3.ipynb | 30 +- troubleshooting.ipynb | 10 +- un_insure.ipynb | 78 ++-- zreferences.ipynb | 8 +- 54 files changed, 2456 insertions(+), 2458 deletions(-) diff --git a/BCG_complete_mkts.ipynb b/BCG_complete_mkts.ipynb index c450e21..1e5e30e 100644 --- a/BCG_complete_mkts.ipynb +++ b/BCG_complete_mkts.ipynb @@ -2,7 +2,7 @@ "cells": [ { "cell_type": "markdown", - "id": "db9a3ea5", + "id": "b1a4173a", "metadata": {}, "source": [ "\n", @@ -11,7 +11,7 @@ }, { "cell_type": "markdown", - "id": "814a0931", + "id": "ad515639", "metadata": {}, "source": [ "# Irrelevance of Capital Structures with Complete Markets\n", @@ -22,7 +22,7 @@ { "cell_type": "code", "execution_count": null, - "id": "a246c213", + "id": "149a2bf8", "metadata": { "hide-output": false }, @@ -34,7 +34,7 @@ }, { "cell_type": "markdown", - "id": "5093ec9a", + "id": "8f2f18e9", "metadata": {}, "source": [ "## Introduction\n", @@ -67,7 +67,7 @@ }, { "cell_type": "markdown", - "id": "284146a3", + "id": "92a6f157", "metadata": {}, "source": [ "### Setup\n", @@ -100,7 +100,7 @@ }, { "cell_type": "markdown", - "id": "e21bb95a", + "id": "4f987614", "metadata": {}, "source": [ "### Endowments\n", @@ -125,7 +125,7 @@ }, { "cell_type": "markdown", - "id": "d7e80976", + "id": "4d30abdb", "metadata": {}, "source": [ "### Technology:\n", @@ -142,7 +142,7 @@ }, { "cell_type": "markdown", - "id": "05c9bf6c", + "id": "2cb1b474", "metadata": {}, "source": [ "### Preferences:\n", @@ -167,7 +167,7 @@ }, { "cell_type": "markdown", - "id": "734646bb", + "id": "fd684a27", "metadata": {}, "source": [ "### Parameterizations\n", @@ -190,7 +190,7 @@ }, { "cell_type": "markdown", - "id": "54f92848", + "id": "63433c98", "metadata": {}, "source": [ "### Pareto criterion and planning problem\n", @@ -248,7 +248,7 @@ }, { "cell_type": "markdown", - "id": "00dd7fe9", + "id": "3ccab878", "metadata": {}, "source": [ "### Helpful observations and bookkeeping\n", @@ -329,7 +329,7 @@ }, { "cell_type": "markdown", - "id": "1329a1ea", + "id": "d4ca37ed", "metadata": {}, "source": [ "#### Remarks\n", @@ -348,7 +348,7 @@ }, { "cell_type": "markdown", - "id": "97bb9b17", + "id": "95a13958", "metadata": {}, "source": [ "## Competitive equilibrium\n", @@ -367,7 +367,7 @@ }, { "cell_type": "markdown", - "id": "0f53cdc0", + "id": "354e16ed", "metadata": {}, "source": [ "### Measures of agents and firms\n", @@ -419,7 +419,7 @@ }, { "cell_type": "markdown", - "id": "db0aaf93", + "id": "8b3dcf94", "metadata": {}, "source": [ "#### Ownership\n", @@ -459,7 +459,7 @@ }, { "cell_type": "markdown", - "id": "5a49b8eb", + "id": "5dfceebd", "metadata": {}, "source": [ "#### Asset markets\n", @@ -478,7 +478,7 @@ }, { "cell_type": "markdown", - "id": "b7d2040a", + "id": "b40b8ead", "metadata": {}, "source": [ "### Objects appearing in a competitive equilibrium\n", @@ -507,7 +507,7 @@ }, { "cell_type": "markdown", - "id": "039639f5", + "id": "4670f653", "metadata": {}, "source": [ "### A representative firm’s problem\n", @@ -554,7 +554,7 @@ }, { "cell_type": "markdown", - "id": "38b32498", + "id": "f48c645f", "metadata": {}, "source": [ "### A consumer’s problem\n", @@ -727,7 +727,7 @@ }, { "cell_type": "markdown", - "id": "3a1f68b8", + "id": "c4706789", "metadata": {}, "source": [ "### Computing competitive equilibrium prices and quantities\n", @@ -822,7 +822,7 @@ }, { "cell_type": "markdown", - "id": "9a0aba34", + "id": "d4a2a4c1", "metadata": {}, "source": [ "### Modigliani-Miller theorem\n", @@ -904,7 +904,7 @@ }, { "cell_type": "markdown", - "id": "f36a79ac", + "id": "b73e0c6f", "metadata": {}, "source": [ "## Code\n", @@ -978,7 +978,7 @@ { "cell_type": "code", "execution_count": null, - "id": "097b1827", + "id": "c6fb61cd", "metadata": { "hide-output": false }, @@ -994,7 +994,7 @@ { "cell_type": "code", "execution_count": null, - "id": "4a644145", + "id": "f0f5823a", "metadata": { "hide-output": false }, @@ -1189,7 +1189,7 @@ }, { "cell_type": "markdown", - "id": "c29dad30", + "id": "c00cdb10", "metadata": {}, "source": [ "### Examples\n", @@ -1199,7 +1199,7 @@ }, { "cell_type": "markdown", - "id": "840b53a4", + "id": "866e8b38", "metadata": {}, "source": [ "#### 1st example\n", @@ -1218,7 +1218,7 @@ { "cell_type": "code", "execution_count": null, - "id": "bfbdb33d", + "id": "d1733d8a", "metadata": { "hide-output": false }, @@ -1231,7 +1231,7 @@ }, { "cell_type": "markdown", - "id": "6de861f1", + "id": "554e4bb5", "metadata": {}, "source": [ "Let’s plot the agents’ time-1 endowments with respect to shocks to see\n", @@ -1241,7 +1241,7 @@ { "cell_type": "code", "execution_count": null, - "id": "0ddab41a", + "id": "559af0fb", "metadata": { "hide-output": false }, @@ -1278,7 +1278,7 @@ }, { "cell_type": "markdown", - "id": "55977bfe", + "id": "3de345dc", "metadata": {}, "source": [ "Let’s also compare the optimal capital stock, $ k $, and optimal\n", @@ -1288,7 +1288,7 @@ { "cell_type": "code", "execution_count": null, - "id": "7989214f", + "id": "2d7d5c06", "metadata": { "hide-output": false }, @@ -1311,7 +1311,7 @@ }, { "cell_type": "markdown", - "id": "b37f9173", + "id": "8903df03", "metadata": {}, "source": [ "#### 2nd example\n", @@ -1326,7 +1326,7 @@ { "cell_type": "code", "execution_count": null, - "id": "10aa4451", + "id": "01b583b8", "metadata": { "hide-output": false }, @@ -1358,7 +1358,7 @@ { "cell_type": "code", "execution_count": null, - "id": "7ebbf833", + "id": "5a152316", "metadata": { "hide-output": false }, @@ -1371,7 +1371,7 @@ { "cell_type": "code", "execution_count": null, - "id": "8532e8df", + "id": "c99e1e2b", "metadata": { "hide-output": false }, @@ -1385,7 +1385,7 @@ { "cell_type": "code", "execution_count": null, - "id": "69584419", + "id": "1cec99df", "metadata": { "hide-output": false }, @@ -1416,7 +1416,7 @@ } ], "metadata": { - "date": 1734843459.7942166, + "date": 1735958029.5250459, "filename": "BCG_complete_mkts.md", "kernelspec": { "display_name": "Python", diff --git a/BCG_incomplete_mkts.ipynb b/BCG_incomplete_mkts.ipynb index 6c455e9..d943d38 100644 --- a/BCG_incomplete_mkts.ipynb +++ b/BCG_incomplete_mkts.ipynb @@ -2,7 +2,7 @@ "cells": [ { "cell_type": "markdown", - "id": "a8ede616", + "id": "4fed15c5", "metadata": {}, "source": [ "\n", @@ -11,7 +11,7 @@ }, { "cell_type": "markdown", - "id": "81fd163f", + "id": "c5cb9808", "metadata": {}, "source": [ "# Equilibrium Capital Structures with Incomplete Markets\n", @@ -22,7 +22,7 @@ { "cell_type": "code", "execution_count": null, - "id": "57879a5f", + "id": "862c2016", "metadata": { "hide-output": false }, @@ -34,7 +34,7 @@ }, { "cell_type": "markdown", - "id": "9713d1da", + "id": "79728948", "metadata": {}, "source": [ "## Introduction\n", @@ -84,7 +84,7 @@ }, { "cell_type": "markdown", - "id": "2c5905d6", + "id": "908be973", "metadata": {}, "source": [ "### Setup\n", @@ -108,7 +108,7 @@ }, { "cell_type": "markdown", - "id": "669b916a", + "id": "44f1b08a", "metadata": {}, "source": [ "### Ownership\n", @@ -123,7 +123,7 @@ }, { "cell_type": "markdown", - "id": "362957da", + "id": "eaf2e8fb", "metadata": {}, "source": [ "### Measures of agents and firms\n", @@ -200,7 +200,7 @@ }, { "cell_type": "markdown", - "id": "102bfe36", + "id": "1175a480", "metadata": {}, "source": [ "### Endowments\n", @@ -217,7 +217,7 @@ }, { "cell_type": "markdown", - "id": "f0d5dc7f", + "id": "3eb06fab", "metadata": {}, "source": [ "### Feasibility:\n", @@ -236,7 +236,7 @@ }, { "cell_type": "markdown", - "id": "d656ffee", + "id": "8717c423", "metadata": {}, "source": [ "### Parameterizations\n", @@ -259,7 +259,7 @@ }, { "cell_type": "markdown", - "id": "4b34c8f3", + "id": "62bc9e25", "metadata": {}, "source": [ "### Preferences:\n", @@ -284,7 +284,7 @@ }, { "cell_type": "markdown", - "id": "2b32affe", + "id": "e1ea1be3", "metadata": {}, "source": [ "### Risk-sharing motives\n", @@ -304,7 +304,7 @@ }, { "cell_type": "markdown", - "id": "4b684f66", + "id": "269c7390", "metadata": {}, "source": [ "## Asset Markets\n", @@ -360,7 +360,7 @@ }, { "cell_type": "markdown", - "id": "d0a63ef6", + "id": "46e2b471", "metadata": {}, "source": [ "### Consumers\n", @@ -451,7 +451,7 @@ }, { "cell_type": "markdown", - "id": "2008e2ce", + "id": "37ce34da", "metadata": {}, "source": [ "### Pricing functions\n", @@ -490,7 +490,7 @@ }, { "cell_type": "markdown", - "id": "71df309e", + "id": "3ccf5119", "metadata": {}, "source": [ "### Firms\n", @@ -547,7 +547,7 @@ }, { "cell_type": "markdown", - "id": "b50774ad", + "id": "6a2fe6ba", "metadata": {}, "source": [ "#### Firm’s optimization problem\n", @@ -620,7 +620,7 @@ }, { "cell_type": "markdown", - "id": "df250c19", + "id": "ff4dc9f0", "metadata": {}, "source": [ "## Equilibrium verification\n", @@ -647,7 +647,7 @@ }, { "cell_type": "markdown", - "id": "f4094b58", + "id": "64baa967", "metadata": {}, "source": [ "## Pseudo Code\n", @@ -745,7 +745,7 @@ }, { "cell_type": "markdown", - "id": "fca85145", + "id": "b098057c", "metadata": {}, "source": [ "## Code\n", @@ -792,7 +792,7 @@ { "cell_type": "code", "execution_count": null, - "id": "0bf31915", + "id": "7dd5adff", "metadata": { "hide-output": false }, @@ -807,7 +807,7 @@ { "cell_type": "code", "execution_count": null, - "id": "c335a592", + "id": "a5f86cad", "metadata": { "hide-output": false }, @@ -1300,7 +1300,7 @@ }, { "cell_type": "markdown", - "id": "2be2452e", + "id": "b3c7d72e", "metadata": {}, "source": [ "## Examples\n", @@ -1310,7 +1310,7 @@ }, { "cell_type": "markdown", - "id": "46618628", + "id": "6bda2fe4", "metadata": {}, "source": [ "### First example\n", @@ -1322,7 +1322,7 @@ { "cell_type": "code", "execution_count": null, - "id": "5869bbb5", + "id": "7c087761", "metadata": { "hide-output": false }, @@ -1335,7 +1335,7 @@ { "cell_type": "code", "execution_count": null, - "id": "3a2a26ad", + "id": "5846864d", "metadata": { "hide-output": false }, @@ -1348,7 +1348,7 @@ }, { "cell_type": "markdown", - "id": "a14b5cb9", + "id": "12272ae9", "metadata": {}, "source": [ "Python reports to us that the equilibrium firm value is $ V=0.101 $,\n", @@ -1365,7 +1365,7 @@ { "cell_type": "code", "execution_count": null, - "id": "fb7e7489", + "id": "3d6bcf62", "metadata": { "hide-output": false }, @@ -1379,7 +1379,7 @@ }, { "cell_type": "markdown", - "id": "1f77c836", + "id": "0e2f4425", "metadata": {}, "source": [ "Up to the approximation involved in using a discrete grid, these numbers\n", @@ -1396,7 +1396,7 @@ { "cell_type": "code", "execution_count": null, - "id": "4f3a31b8", + "id": "501bfb3d", "metadata": { "hide-output": false }, @@ -1437,7 +1437,7 @@ }, { "cell_type": "markdown", - "id": "7696c0fa", + "id": "601971b0", "metadata": {}, "source": [ "#### A Modigliani-Miller theorem?\n", @@ -1532,7 +1532,7 @@ { "cell_type": "code", "execution_count": null, - "id": "f45a5f26", + "id": "31ca2abe", "metadata": { "hide-output": false }, @@ -1756,7 +1756,7 @@ }, { "cell_type": "markdown", - "id": "ee0bd093", + "id": "fcc17f6e", "metadata": {}, "source": [ "Here is our strategy for checking *stability* of an equilibrium.\n", @@ -1782,7 +1782,7 @@ { "cell_type": "code", "execution_count": null, - "id": "67752422", + "id": "d051fc1e", "metadata": { "hide-output": false }, @@ -1830,7 +1830,7 @@ }, { "cell_type": "markdown", - "id": "70bd800f", + "id": "4959f2c6", "metadata": {}, "source": [ "In the above 3D surface of prospective firm valuations, the perturbed\n", @@ -1848,7 +1848,7 @@ { "cell_type": "code", "execution_count": null, - "id": "9e852a38", + "id": "e41f4015", "metadata": { "hide-output": false }, @@ -1895,7 +1895,7 @@ }, { "cell_type": "markdown", - "id": "b2d4a24f", + "id": "92e8b017", "metadata": {}, "source": [ "In contrast to $ (k^*,b^* - e) $, the 3D surface for\n", @@ -1915,7 +1915,7 @@ { "cell_type": "code", "execution_count": null, - "id": "66a55e30", + "id": "36a60c4a", "metadata": { "hide-output": false }, @@ -1926,7 +1926,7 @@ }, { "cell_type": "markdown", - "id": "011b1c25", + "id": "ea4a1be8", "metadata": {}, "source": [ "Our two *stability experiments* suggest that the equilibrium capital\n", @@ -1940,7 +1940,7 @@ }, { "cell_type": "markdown", - "id": "7680ccc8", + "id": "122cd4e8", "metadata": {}, "source": [ "#### Equilibrium equity and bond price functions\n", @@ -1953,7 +1953,7 @@ { "cell_type": "code", "execution_count": null, - "id": "023270da", + "id": "ce1c3b38", "metadata": { "hide-output": false }, @@ -1991,7 +1991,7 @@ { "cell_type": "code", "execution_count": null, - "id": "6ce67911", + "id": "bde948a9", "metadata": { "hide-output": false }, @@ -2028,7 +2028,7 @@ }, { "cell_type": "markdown", - "id": "aaeeda74", + "id": "c5ff22db", "metadata": {}, "source": [ "### Comments on equilibrium pricing functions\n", @@ -2044,7 +2044,7 @@ }, { "cell_type": "markdown", - "id": "8924083c", + "id": "a8c2316e", "metadata": {}, "source": [ "### Another example economy\n", @@ -2070,7 +2070,7 @@ { "cell_type": "code", "execution_count": null, - "id": "ea3a71f7", + "id": "b3c5f279", "metadata": { "hide-output": false }, @@ -2125,7 +2125,7 @@ { "cell_type": "code", "execution_count": null, - "id": "0c5a5345", + "id": "a2f7d785", "metadata": { "hide-output": false }, @@ -2164,7 +2164,7 @@ }, { "cell_type": "markdown", - "id": "0af0b2d8", + "id": "6443cc98", "metadata": {}, "source": [ "## A picture worth a thousand words\n", @@ -2184,7 +2184,7 @@ { "cell_type": "code", "execution_count": null, - "id": "26c3986f", + "id": "4a194d8c", "metadata": { "hide-output": false }, @@ -2216,7 +2216,7 @@ }, { "cell_type": "markdown", - "id": "a9af167c", + "id": "356d8337", "metadata": {}, "source": [ "It is rewarding to stare at the above plots too.\n", @@ -2232,7 +2232,7 @@ } ], "metadata": { - "date": 1734843459.8564742, + "date": 1735958029.587163, "filename": "BCG_incomplete_mkts.md", "kernelspec": { "display_name": "Python", diff --git a/additive_functionals.ipynb b/additive_functionals.ipynb index be6f036..3ab4378 100644 --- a/additive_functionals.ipynb +++ b/additive_functionals.ipynb @@ -2,7 +2,7 @@ "cells": [ { "cell_type": "markdown", - "id": "a00a4289", + "id": "eb23ca55", "metadata": {}, "source": [ "\n", @@ -11,7 +11,7 @@ }, { "cell_type": "markdown", - "id": "1b2fa25d", + "id": "38e4e2a3", "metadata": {}, "source": [ "# Additive and Multiplicative Functionals\n", @@ -24,7 +24,7 @@ { "cell_type": "code", "execution_count": null, - "id": "018cce6a", + "id": "6da5e6b9", "metadata": { "hide-output": false }, @@ -35,7 +35,7 @@ }, { "cell_type": "markdown", - "id": "ba1f2cf3", + "id": "be1b710d", "metadata": {}, "source": [ "## Overview\n", @@ -80,7 +80,7 @@ { "cell_type": "code", "execution_count": null, - "id": "76ce33d0", + "id": "23d16fc1", "metadata": { "hide-output": false }, @@ -95,7 +95,7 @@ }, { "cell_type": "markdown", - "id": "19806d03", + "id": "09e41098", "metadata": {}, "source": [ "## A Particular Additive Functional\n", @@ -149,7 +149,7 @@ }, { "cell_type": "markdown", - "id": "c38703ff", + "id": "b2c2439d", "metadata": {}, "source": [ "### Linear State-Space Representation\n", @@ -220,7 +220,7 @@ }, { "cell_type": "markdown", - "id": "2ae634c1", + "id": "b83f7dd2", "metadata": {}, "source": [ "## Dynamics\n", @@ -269,7 +269,7 @@ }, { "cell_type": "markdown", - "id": "c3206b1f", + "id": "3082d06c", "metadata": {}, "source": [ "### Simulation\n", @@ -287,7 +287,7 @@ { "cell_type": "code", "execution_count": null, - "id": "e154883b", + "id": "03d3d52c", "metadata": { "hide-output": false }, @@ -447,7 +447,7 @@ }, { "cell_type": "markdown", - "id": "689d0132", + "id": "e06693fc", "metadata": {}, "source": [ "#### Plotting\n", @@ -458,7 +458,7 @@ { "cell_type": "code", "execution_count": null, - "id": "c4071442", + "id": "899f3a19", "metadata": { "hide-output": false }, @@ -741,7 +741,7 @@ }, { "cell_type": "markdown", - "id": "543bb646", + "id": "115fc240", "metadata": {}, "source": [ "For now, we just plot $ y_t $ and $ x_t $, postponing until later a description of exactly how we compute them.\n", @@ -753,7 +753,7 @@ { "cell_type": "code", "execution_count": null, - "id": "09af4598", + "id": "6d2e9e2e", "metadata": { "hide-output": false }, @@ -792,7 +792,7 @@ }, { "cell_type": "markdown", - "id": "4c7f0de0", + "id": "f8032b29", "metadata": {}, "source": [ "Notice the irregular but persistent growth in $ y_t $." @@ -800,7 +800,7 @@ }, { "cell_type": "markdown", - "id": "ee95b8b2", + "id": "2f1fbad8", "metadata": {}, "source": [ "### Decomposition\n", @@ -936,7 +936,7 @@ }, { "cell_type": "markdown", - "id": "bad72b9b", + "id": "415b80b5", "metadata": {}, "source": [ "## Code\n", @@ -959,7 +959,7 @@ { "cell_type": "code", "execution_count": null, - "id": "7a75817c", + "id": "bc6c8079", "metadata": { "hide-output": false }, @@ -971,7 +971,7 @@ }, { "cell_type": "markdown", - "id": "1f3fc5fa", + "id": "81eeaff3", "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", @@ -988,7 +988,7 @@ }, { "cell_type": "markdown", - "id": "4e5290cc", + "id": "23c2f8b4", "metadata": {}, "source": [ "### Associated Multiplicative Functional\n", @@ -1035,7 +1035,7 @@ { "cell_type": "code", "execution_count": null, - "id": "9358bfeb", + "id": "e3c017b0", "metadata": { "hide-output": false }, @@ -1047,7 +1047,7 @@ }, { "cell_type": "markdown", - "id": "ddb1df3b", + "id": "8b0cdc5b", "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", @@ -1065,7 +1065,7 @@ }, { "cell_type": "markdown", - "id": "7c389c44", + "id": "f0c7c627", "metadata": {}, "source": [ "### Peculiar Large Sample Property\n", @@ -1090,7 +1090,7 @@ { "cell_type": "code", "execution_count": null, - "id": "4abf5d71", + "id": "c7901a31", "metadata": { "hide-output": false }, @@ -1103,7 +1103,7 @@ }, { "cell_type": "markdown", - "id": "3ada76ba", + "id": "ecff6065", "metadata": {}, "source": [ "The dotted line in the above graph is the mean $ E \\tilde M_t = 1 $ of the martingale.\n", @@ -1115,7 +1115,7 @@ }, { "cell_type": "markdown", - "id": "3256d89e", + "id": "e5ac5bfe", "metadata": {}, "source": [ "## More About the Multiplicative Martingale\n", @@ -1136,7 +1136,7 @@ }, { "cell_type": "markdown", - "id": "7ac3ac80", + "id": "bb7a92be", "metadata": {}, "source": [ "### Simulating a Multiplicative Martingale Again\n", @@ -1153,7 +1153,7 @@ }, { "cell_type": "markdown", - "id": "ff24b243", + "id": "b38d5973", "metadata": {}, "source": [ "### Sample Paths\n", @@ -1166,7 +1166,7 @@ { "cell_type": "code", "execution_count": null, - "id": "b78540d8", + "id": "5eabb7fa", "metadata": { "hide-output": false }, @@ -1278,7 +1278,7 @@ }, { "cell_type": "markdown", - "id": "7ad42b37", + "id": "235af453", "metadata": {}, "source": [ "The heavy lifting is done inside the `AMF_LSS_VAR` class.\n", @@ -1289,7 +1289,7 @@ { "cell_type": "code", "execution_count": null, - "id": "66a767d7", + "id": "89b94a08", "metadata": { "hide-output": false }, @@ -1339,7 +1339,7 @@ }, { "cell_type": "markdown", - "id": "ceabc83a", + "id": "d93f6498", "metadata": {}, "source": [ "Now that we have these functions in our toolkit, let’s apply them to run some\n", @@ -1349,7 +1349,7 @@ { "cell_type": "code", "execution_count": null, - "id": "0c1a66e4", + "id": "6181a0e6", "metadata": { "hide-output": false }, @@ -1392,7 +1392,7 @@ }, { "cell_type": "markdown", - "id": "7d141cb0", + "id": "1ef7075e", "metadata": {}, "source": [ "Let’s plot the probability density functions for $ \\log {\\widetilde M}_t $ for\n", @@ -1419,7 +1419,7 @@ { "cell_type": "code", "execution_count": null, - "id": "b1c1881e", + "id": "a02359b9", "metadata": { "hide-output": false }, @@ -1474,7 +1474,7 @@ }, { "cell_type": "markdown", - "id": "9c61a0ea", + "id": "8ab889fe", "metadata": {}, "source": [ "These probability density functions help us understand mechanics underlying the **peculiar property** of our multiplicative martingale\n", @@ -1489,7 +1489,7 @@ }, { "cell_type": "markdown", - "id": "8a71013d", + "id": "92039161", "metadata": {}, "source": [ "### Multiplicative Martingale as Likelihood Ratio Process\n", @@ -1505,7 +1505,7 @@ } ], "metadata": { - "date": 1734843459.894325, + "date": 1735958029.625591, "filename": "additive_functionals.md", "kernelspec": { "display_name": "Python", diff --git a/amss.ipynb b/amss.ipynb index e953a9b..9019359 100644 --- a/amss.ipynb +++ b/amss.ipynb @@ -2,7 +2,7 @@ "cells": [ { "cell_type": "markdown", - "id": "10711ec8", + "id": "75a12e8e", "metadata": {}, "source": [ "\n", @@ -11,7 +11,7 @@ }, { "cell_type": "markdown", - "id": "ea1ba94d", + "id": "b2ed5344", "metadata": {}, "source": [ "# Optimal Taxation without State-Contingent Debt\n", @@ -22,7 +22,7 @@ { "cell_type": "code", "execution_count": null, - "id": "0cd79b92", + "id": "646d44fb", "metadata": { "hide-output": false }, @@ -34,7 +34,7 @@ }, { "cell_type": "markdown", - "id": "8f486e3b", + "id": "1555615a", "metadata": {}, "source": [ "## Overview\n", @@ -45,7 +45,7 @@ { "cell_type": "code", "execution_count": null, - "id": "25b44ab2", + "id": "c69db162", "metadata": { "hide-output": false }, @@ -62,7 +62,7 @@ }, { "cell_type": "markdown", - "id": "6e32ea34", + "id": "da1664f8", "metadata": {}, "source": [ "In [an earlier lecture](https://python-advanced.quantecon.org/opt_tax_recur.html), we described a model of\n", @@ -86,7 +86,7 @@ }, { "cell_type": "markdown", - "id": "500dd8a7", + "id": "b6db9eaa", "metadata": {}, "source": [ "## Competitive Equilibrium with Distorting Taxes\n", @@ -150,7 +150,7 @@ }, { "cell_type": "markdown", - "id": "faab2f22", + "id": "fb9ebaf9", "metadata": {}, "source": [ "### Risk-free One-Period Debt Only\n", @@ -284,7 +284,7 @@ }, { "cell_type": "markdown", - "id": "37a506d3", + "id": "09728ab6", "metadata": {}, "source": [ "### Comparison with Lucas-Stokey Economy\n", @@ -300,7 +300,7 @@ }, { "cell_type": "markdown", - "id": "ba23cdc5", + "id": "af59d63f", "metadata": {}, "source": [ "### Ramsey Problem Without State-contingent Debt\n", @@ -338,7 +338,7 @@ }, { "cell_type": "markdown", - "id": "c5fc0f9b", + "id": "12d48e52", "metadata": {}, "source": [ "#### Lagrangian Formulation\n", @@ -374,7 +374,7 @@ }, { "cell_type": "markdown", - "id": "856aa2ee", + "id": "fba77597", "metadata": {}, "source": [ "### Some Calculations\n", @@ -464,7 +464,7 @@ { "cell_type": "code", "execution_count": null, - "id": "ffc40ca1", + "id": "ce60d18a", "metadata": { "hide-output": false }, @@ -672,7 +672,7 @@ }, { "cell_type": "markdown", - "id": "170f7d2b", + "id": "ebb313c2", "metadata": {}, "source": [ "To analyze the AMSS model, we find it useful to adopt a recursive formulation\n", @@ -681,7 +681,7 @@ }, { "cell_type": "markdown", - "id": "e460daf7", + "id": "06e7f04d", "metadata": {}, "source": [ "## Recursive Version of AMSS Model\n", @@ -704,7 +704,7 @@ }, { "cell_type": "markdown", - "id": "77f158bd", + "id": "b4640173", "metadata": {}, "source": [ "### Recasting State Variables\n", @@ -773,7 +773,7 @@ }, { "cell_type": "markdown", - "id": "7a68c31c", + "id": "b2ef3a71", "metadata": {}, "source": [ "### Measurability Constraints\n", @@ -802,7 +802,7 @@ }, { "cell_type": "markdown", - "id": "a6162702", + "id": "5ca8ea3a", "metadata": {}, "source": [ "### Two Bellman Equations\n", @@ -866,7 +866,7 @@ }, { "cell_type": "markdown", - "id": "be61f123", + "id": "d098a81b", "metadata": {}, "source": [ "### Martingale Supercedes State-Variable Degeneracy\n", @@ -915,7 +915,7 @@ }, { "cell_type": "markdown", - "id": "15456773", + "id": "eabe8072", "metadata": {}, "source": [ "### Exercise 46.1\n", @@ -927,7 +927,7 @@ }, { "cell_type": "markdown", - "id": "c010e931", + "id": "79e0b47c", "metadata": {}, "source": [ "### Absence of State Variable Degeneracy\n", @@ -956,7 +956,7 @@ }, { "cell_type": "markdown", - "id": "ca98b15e", + "id": "011d6f7f", "metadata": {}, "source": [ "### Digression on Non-negative Transfers\n", @@ -993,7 +993,7 @@ }, { "cell_type": "markdown", - "id": "6db6e6b5", + "id": "bdbaa2f0", "metadata": {}, "source": [ "### Code\n", @@ -1004,7 +1004,7 @@ { "cell_type": "code", "execution_count": null, - "id": "ac49d280", + "id": "29d35e05", "metadata": { "hide-output": false }, @@ -1226,7 +1226,7 @@ }, { "cell_type": "markdown", - "id": "6cf12e8f", + "id": "24fc8a02", "metadata": {}, "source": [ "## Examples\n", @@ -1236,7 +1236,7 @@ }, { "cell_type": "markdown", - "id": "bc8af8aa", + "id": "95c79ebc", "metadata": {}, "source": [ "### Anticipated One-Period War\n", @@ -1302,7 +1302,7 @@ { "cell_type": "code", "execution_count": null, - "id": "f29e9619", + "id": "9cdb854c", "metadata": { "hide-output": false }, @@ -1358,7 +1358,7 @@ }, { "cell_type": "markdown", - "id": "32f2bd4d", + "id": "c6c6032a", "metadata": {}, "source": [ "The following figure plots Ramsey plans under complete and incomplete\n", @@ -1374,7 +1374,7 @@ { "cell_type": "code", "execution_count": null, - "id": "dc686822", + "id": "b4dbe840", "metadata": { "hide-output": false }, @@ -1410,7 +1410,7 @@ { "cell_type": "code", "execution_count": null, - "id": "49678c46", + "id": "9fe221ea", "metadata": { "hide-output": false }, @@ -1432,7 +1432,7 @@ { "cell_type": "code", "execution_count": null, - "id": "f4407e67", + "id": "784063c9", "metadata": { "hide-output": false }, @@ -1446,7 +1446,7 @@ { "cell_type": "code", "execution_count": null, - "id": "f4d16de1", + "id": "29b4c150", "metadata": { "hide-output": false }, @@ -1459,7 +1459,7 @@ { "cell_type": "code", "execution_count": null, - "id": "55e7a658", + "id": "7f956953", "metadata": { "hide-output": false }, @@ -1493,7 +1493,7 @@ }, { "cell_type": "markdown", - "id": "5041c2bb", + "id": "ecda89cb", "metadata": {}, "source": [ "How a Ramsey planner responds to war depends on the structure of the asset market.\n", @@ -1537,7 +1537,7 @@ }, { "cell_type": "markdown", - "id": "297d5ba1", + "id": "55574379", "metadata": {}, "source": [ "#### Perpetual War Alert\n", @@ -1562,7 +1562,7 @@ { "cell_type": "code", "execution_count": null, - "id": "c384f22e", + "id": "1bd0f7b0", "metadata": { "hide-output": false }, @@ -1608,7 +1608,7 @@ }, { "cell_type": "markdown", - "id": "a8c668f4", + "id": "07a2f3ea", "metadata": {}, "source": [ "With these preferences, Ramsey tax rates will vary even in the Lucas-Stokey\n", @@ -1622,7 +1622,7 @@ { "cell_type": "code", "execution_count": null, - "id": "38d067c5", + "id": "0665ff72", "metadata": { "hide-output": false }, @@ -1659,7 +1659,7 @@ { "cell_type": "code", "execution_count": null, - "id": "bff1d704", + "id": "2a963618", "metadata": { "hide-output": false }, @@ -1674,7 +1674,7 @@ { "cell_type": "code", "execution_count": null, - "id": "7ebdba6a", + "id": "7f7b1736", "metadata": { "hide-output": false }, @@ -1686,7 +1686,7 @@ { "cell_type": "code", "execution_count": null, - "id": "1bae78bd", + "id": "cd0f9f5c", "metadata": { "hide-output": false }, @@ -1718,7 +1718,7 @@ }, { "cell_type": "markdown", - "id": "8b99cc13", + "id": "57bf2c2d", "metadata": {}, "source": [ "When the government experiences a prolonged period of peace, it is able to reduce\n", @@ -1740,7 +1740,7 @@ { "cell_type": "code", "execution_count": null, - "id": "ad3de393", + "id": "c32776ed", "metadata": { "hide-output": false }, @@ -1756,7 +1756,7 @@ { "cell_type": "code", "execution_count": null, - "id": "6ba1f9b1", + "id": "278e0862", "metadata": { "hide-output": false }, @@ -1784,7 +1784,7 @@ }, { "cell_type": "markdown", - "id": "fe3d56df", + "id": "4a2a486b", "metadata": {}, "source": [ "

[1] In an allocation that solves the Ramsey problem and that levies distorting\n", @@ -1804,7 +1804,7 @@ } ], "metadata": { - "date": 1734843459.9470546, + "date": 1735958029.6774328, "filename": "amss.md", "kernelspec": { "display_name": "Python", diff --git a/amss2.ipynb b/amss2.ipynb index 91d88e2..6dda859 100644 --- a/amss2.ipynb +++ b/amss2.ipynb @@ -2,7 +2,7 @@ "cells": [ { "cell_type": "markdown", - "id": "6bf39f52", + "id": "771448e2", "metadata": {}, "source": [ "\n", @@ -11,7 +11,7 @@ }, { "cell_type": "markdown", - "id": "68b5ee54", + "id": "57340d5d", "metadata": {}, "source": [ "# Fluctuating Interest Rates Deliver Fiscal Insurance\n", @@ -22,7 +22,7 @@ { "cell_type": "code", "execution_count": null, - "id": "16813db3", + "id": "ef3f4c1c", "metadata": { "hide-output": false }, @@ -33,7 +33,7 @@ }, { "cell_type": "markdown", - "id": "191228ae", + "id": "73826436", "metadata": {}, "source": [ "## Overview\n", @@ -95,7 +95,7 @@ { "cell_type": "code", "execution_count": null, - "id": "d8954315", + "id": "cb5a214e", "metadata": { "hide-output": false }, @@ -107,7 +107,7 @@ }, { "cell_type": "markdown", - "id": "701d81d4", + "id": "dc573b78", "metadata": {}, "source": [ "## Forces at Work\n", @@ -137,7 +137,7 @@ }, { "cell_type": "markdown", - "id": "e3545797", + "id": "c8b1db9d", "metadata": {}, "source": [ "## Logical Flow of Lecture\n", @@ -157,7 +157,7 @@ }, { "cell_type": "markdown", - "id": "d4417d18", + "id": "ff99b1d2", "metadata": {}, "source": [ "### Equations from Lucas-Stokey (1983) Model\n", @@ -226,7 +226,7 @@ }, { "cell_type": "markdown", - "id": "5c032939", + "id": "a310b498", "metadata": {}, "source": [ "### Specification with CRRA Utility\n", @@ -284,7 +284,7 @@ { "cell_type": "code", "execution_count": null, - "id": "3cd83a69", + "id": "d4cfa936", "metadata": { "hide-output": false }, @@ -332,7 +332,7 @@ }, { "cell_type": "markdown", - "id": "d87789ea", + "id": "777179b5", "metadata": {}, "source": [ "## Example Economy\n", @@ -366,7 +366,7 @@ { "cell_type": "code", "execution_count": null, - "id": "839eb47c", + "id": "1e381b90", "metadata": { "hide-output": false }, @@ -535,7 +535,7 @@ { "cell_type": "code", "execution_count": null, - "id": "67d7377c", + "id": "a89cadd7", "metadata": { "hide-output": false }, @@ -844,7 +844,7 @@ { "cell_type": "code", "execution_count": null, - "id": "5b504542", + "id": "20b06f8e", "metadata": { "hide-output": false }, @@ -923,7 +923,7 @@ }, { "cell_type": "markdown", - "id": "b889f102", + "id": "04678429", "metadata": {}, "source": [ "## Reverse Engineering Strategy\n", @@ -974,7 +974,7 @@ }, { "cell_type": "markdown", - "id": "f84f0e0f", + "id": "44715c39", "metadata": {}, "source": [ "## Code for Reverse Engineering\n", @@ -985,7 +985,7 @@ { "cell_type": "code", "execution_count": null, - "id": "66d84ac7", + "id": "721bfb18", "metadata": { "hide-output": false }, @@ -1031,7 +1031,7 @@ }, { "cell_type": "markdown", - "id": "e2a5a348", + "id": "e36b8c1f", "metadata": {}, "source": [ "To recover and print out $ \\bar b $" @@ -1040,7 +1040,7 @@ { "cell_type": "code", "execution_count": null, - "id": "4b4b2266", + "id": "262d4e41", "metadata": { "hide-output": false }, @@ -1052,7 +1052,7 @@ }, { "cell_type": "markdown", - "id": "decc0d5e", + "id": "ed375b4d", "metadata": {}, "source": [ "To complete the reverse engineering exercise by jointly determining $ c_0, b_0 $, we\n", @@ -1062,7 +1062,7 @@ { "cell_type": "code", "execution_count": null, - "id": "d3a846f5", + "id": "96d5337e", "metadata": { "hide-output": false }, @@ -1089,7 +1089,7 @@ }, { "cell_type": "markdown", - "id": "f74e05ee", + "id": "5162b9ca", "metadata": {}, "source": [ "To solve the equations for $ c_0, b_0 $, we use SciPy’s fsolve function" @@ -1098,7 +1098,7 @@ { "cell_type": "code", "execution_count": null, - "id": "87a10b42", + "id": "e34d6b4b", "metadata": { "hide-output": false }, @@ -1111,7 +1111,7 @@ }, { "cell_type": "markdown", - "id": "692e79e4", + "id": "673b5e95", "metadata": {}, "source": [ "Thus, we have reverse engineered an initial $ b0 = -1.038698407551764 $ that ought to render the AMSS measurability constraints slack." @@ -1119,7 +1119,7 @@ }, { "cell_type": "markdown", - "id": "625754fb", + "id": "73ebf85d", "metadata": {}, "source": [ "## Short Simulation for Reverse-engineered: Initial Debt\n", @@ -1133,7 +1133,7 @@ { "cell_type": "code", "execution_count": null, - "id": "3f6c5ef7", + "id": "1d4bf6b1", "metadata": { "hide-output": false }, @@ -1181,7 +1181,7 @@ }, { "cell_type": "markdown", - "id": "9d8a5be9", + "id": "29cafc2c", "metadata": {}, "source": [ "The Ramsey allocations and Ramsey outcomes are **identical** for the Lucas-Stokey and AMSS economies.\n", @@ -1195,7 +1195,7 @@ }, { "cell_type": "markdown", - "id": "aea1494e", + "id": "66094c32", "metadata": {}, "source": [ "## Long Simulation\n", @@ -1230,7 +1230,7 @@ { "cell_type": "code", "execution_count": null, - "id": "86be7e3c", + "id": "2c94e2e9", "metadata": { "hide-output": false }, @@ -1258,7 +1258,7 @@ }, { "cell_type": "markdown", - "id": "76a5035d", + "id": "b248e63f", "metadata": {}, "source": [ "### Remarks about Long Simulation\n", @@ -1279,7 +1279,7 @@ }, { "cell_type": "markdown", - "id": "bcd1853f", + "id": "b5048527", "metadata": {}, "source": [ "## BEGS Approximations of Limiting Debt and Convergence Rate\n", @@ -1322,7 +1322,7 @@ }, { "cell_type": "markdown", - "id": "2e354429", + "id": "499b714a", "metadata": {}, "source": [ "### Asymptotic Mean\n", @@ -1362,7 +1362,7 @@ }, { "cell_type": "markdown", - "id": "59683aa0", + "id": "dfeec93b", "metadata": {}, "source": [ "### Rate of Convergence\n", @@ -1380,7 +1380,7 @@ }, { "cell_type": "markdown", - "id": "62dbc3e3", + "id": "1565e30a", "metadata": {}, "source": [ "### Formulas and Code Details\n", @@ -1428,7 +1428,7 @@ { "cell_type": "code", "execution_count": null, - "id": "4c37491c", + "id": "45125744", "metadata": { "hide-output": false }, @@ -1450,7 +1450,7 @@ }, { "cell_type": "markdown", - "id": "9c68659c", + "id": "7ab58259", "metadata": {}, "source": [ "Now let’s form the two random variables $ {\\mathcal R}, {\\mathcal X} $ appearing in the BEGS approximating formulas" @@ -1459,7 +1459,7 @@ { "cell_type": "code", "execution_count": null, - "id": "8e6c751b", + "id": "2ab8249f", "metadata": { "hide-output": false }, @@ -1485,7 +1485,7 @@ }, { "cell_type": "markdown", - "id": "37727604", + "id": "c8b4c363", "metadata": {}, "source": [ "Now let’s compute the ingredient of the approximating limit and the approximating rate of convergence" @@ -1494,7 +1494,7 @@ { "cell_type": "code", "execution_count": null, - "id": "f0d532ed", + "id": "d5af3131", "metadata": { "hide-output": false }, @@ -1508,7 +1508,7 @@ }, { "cell_type": "markdown", - "id": "85785516", + "id": "5b747d8d", "metadata": {}, "source": [ "Print out $ \\hat b $ and $ \\bar b $" @@ -1517,7 +1517,7 @@ { "cell_type": "code", "execution_count": null, - "id": "d561e9ec", + "id": "95a24684", "metadata": { "hide-output": false }, @@ -1528,7 +1528,7 @@ }, { "cell_type": "markdown", - "id": "1b7db0b7", + "id": "265ab19d", "metadata": {}, "source": [ "So we have" @@ -1537,7 +1537,7 @@ { "cell_type": "code", "execution_count": null, - "id": "4a2d8574", + "id": "2d5456d6", "metadata": { "hide-output": false }, @@ -1548,7 +1548,7 @@ }, { "cell_type": "markdown", - "id": "e95c55b3", + "id": "63a2721e", "metadata": {}, "source": [ "These outcomes show that $ \\hat b $ does a remarkably good job of approximating $ \\bar b $.\n", @@ -1559,7 +1559,7 @@ { "cell_type": "code", "execution_count": null, - "id": "a087f420", + "id": "baaa5727", "metadata": { "hide-output": false }, @@ -1571,7 +1571,7 @@ }, { "cell_type": "markdown", - "id": "23a1880b", + "id": "fb1692ed", "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", @@ -1583,7 +1583,7 @@ { "cell_type": "code", "execution_count": null, - "id": "400ab62e", + "id": "8cfc7616", "metadata": { "hide-output": false }, @@ -1596,7 +1596,7 @@ }, { "cell_type": "markdown", - "id": "e18b2610", + "id": "59fb7a01", "metadata": {}, "source": [ "Now let’s compute the implied meantime to get to within 0.01 of the limit" @@ -1605,7 +1605,7 @@ { "cell_type": "code", "execution_count": null, - "id": "99616761", + "id": "2ae1d412", "metadata": { "hide-output": false }, @@ -1617,7 +1617,7 @@ }, { "cell_type": "markdown", - "id": "9e1cb82f", + "id": "3f042710", "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", @@ -1628,7 +1628,7 @@ } ], "metadata": { - "date": 1734843460.1328585, + "date": 1735958029.7308733, "filename": "amss2.md", "kernelspec": { "display_name": "Python", diff --git a/amss3.ipynb b/amss3.ipynb index a1c3731..0f601bd 100644 --- a/amss3.ipynb +++ b/amss3.ipynb @@ -2,7 +2,7 @@ "cells": [ { "cell_type": "markdown", - "id": "a0dbfed0", + "id": "a356c30f", "metadata": {}, "source": [ "\n", @@ -11,7 +11,7 @@ }, { "cell_type": "markdown", - "id": "858035eb", + "id": "d8cbc942", "metadata": {}, "source": [ "# Fiscal Risk and Government Debt\n", @@ -22,7 +22,7 @@ { "cell_type": "code", "execution_count": null, - "id": "ea99c307", + "id": "64d761a0", "metadata": { "hide-output": false }, @@ -33,7 +33,7 @@ }, { "cell_type": "markdown", - "id": "f4a06870", + "id": "4444f292", "metadata": {}, "source": [ "## Overview\n", @@ -81,7 +81,7 @@ { "cell_type": "code", "execution_count": null, - "id": "e36f1411", + "id": "c5046863", "metadata": { "hide-output": false }, @@ -93,7 +93,7 @@ }, { "cell_type": "markdown", - "id": "d2b54c86", + "id": "c869e3ed", "metadata": {}, "source": [ "## The Economy\n", @@ -138,7 +138,7 @@ { "cell_type": "code", "execution_count": null, - "id": "dbe4df14", + "id": "615bdb3f", "metadata": { "hide-output": false }, @@ -186,7 +186,7 @@ }, { "cell_type": "markdown", - "id": "36ff6157", + "id": "8a195f17", "metadata": {}, "source": [ "### First and Second Moments\n", @@ -199,7 +199,7 @@ { "cell_type": "code", "execution_count": null, - "id": "e80c78dd", + "id": "e357833d", "metadata": { "hide-output": false }, @@ -221,7 +221,7 @@ }, { "cell_type": "markdown", - "id": "e655bd30", + "id": "2970724e", "metadata": {}, "source": [ "## Long Simulation\n", @@ -236,7 +236,7 @@ { "cell_type": "code", "execution_count": null, - "id": "bc4cfb18", + "id": "f8e9966d", "metadata": { "hide-output": false }, @@ -405,7 +405,7 @@ { "cell_type": "code", "execution_count": null, - "id": "275f68ba", + "id": "1abfbf83", "metadata": { "hide-output": false }, @@ -714,7 +714,7 @@ { "cell_type": "code", "execution_count": null, - "id": "897874d1", + "id": "39e10205", "metadata": { "hide-output": false }, @@ -793,7 +793,7 @@ }, { "cell_type": "markdown", - "id": "c75d5f6d", + "id": "a8e48edf", "metadata": {}, "source": [ "Next, we show the code that we use to generate a very long simulation starting from initial\n", @@ -805,7 +805,7 @@ { "cell_type": "code", "execution_count": null, - "id": "9948e911", + "id": "20042e1d", "metadata": { "hide-output": false }, @@ -846,7 +846,7 @@ }, { "cell_type": "markdown", - "id": "0a1d0645", + "id": "5461180b", "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", @@ -878,7 +878,7 @@ { "cell_type": "code", "execution_count": null, - "id": "a52f506f", + "id": "7c688c19", "metadata": { "hide-output": false }, @@ -906,7 +906,7 @@ }, { "cell_type": "markdown", - "id": "86064bfc", + "id": "e5f69374", "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", @@ -922,7 +922,7 @@ }, { "cell_type": "markdown", - "id": "e3fe25b5", + "id": "0cf02f93", "metadata": {}, "source": [ "## Asymptotic Mean and Rate of Convergence\n", @@ -976,7 +976,7 @@ }, { "cell_type": "markdown", - "id": "d65bb9a9", + "id": "50b3579f", "metadata": {}, "source": [ "### Asymptotic Mean\n", @@ -1019,7 +1019,7 @@ }, { "cell_type": "markdown", - "id": "0be7048c", + "id": "886e390d", "metadata": {}, "source": [ "### Rate of Convergence\n", @@ -1038,7 +1038,7 @@ }, { "cell_type": "markdown", - "id": "008ece78", + "id": "1085299a", "metadata": {}, "source": [ "### More Advanced Topic\n", @@ -1050,7 +1050,7 @@ }, { "cell_type": "markdown", - "id": "4a2819ad", + "id": "63ac6a3b", "metadata": {}, "source": [ "### Chicken and Egg\n", @@ -1075,7 +1075,7 @@ }, { "cell_type": "markdown", - "id": "99f6ecca", + "id": "8d09f5ac", "metadata": {}, "source": [ "### Approximating the Ergodic Mean\n", @@ -1097,7 +1097,7 @@ }, { "cell_type": "markdown", - "id": "f77b7c52", + "id": "4802d116", "metadata": {}, "source": [ "### Step by Step\n", @@ -1240,7 +1240,7 @@ }, { "cell_type": "markdown", - "id": "4f65736e", + "id": "6e18f5c3", "metadata": {}, "source": [ "### Execution\n", @@ -1250,7 +1250,7 @@ }, { "cell_type": "markdown", - "id": "1908234f", + "id": "3ae096bb", "metadata": {}, "source": [ "#### Step 1" @@ -1259,7 +1259,7 @@ { "cell_type": "code", "execution_count": null, - "id": "5e36fb43", + "id": "6f9befb3", "metadata": { "hide-output": false }, @@ -1283,7 +1283,7 @@ { "cell_type": "code", "execution_count": null, - "id": "48d10f5a", + "id": "c7289d98", "metadata": { "hide-output": false }, @@ -1294,7 +1294,7 @@ }, { "cell_type": "markdown", - "id": "49338739", + "id": "a36f053c", "metadata": {}, "source": [ "#### Step 2" @@ -1303,7 +1303,7 @@ { "cell_type": "code", "execution_count": null, - "id": "f7d9577a", + "id": "fb86dfe2", "metadata": { "hide-output": false }, @@ -1314,7 +1314,7 @@ }, { "cell_type": "markdown", - "id": "00b5581e", + "id": "175032ca", "metadata": {}, "source": [ "### Note about Code\n", @@ -1331,7 +1331,7 @@ }, { "cell_type": "markdown", - "id": "98eaffbe", + "id": "2729c468", "metadata": {}, "source": [ "### Running the code\n", @@ -1345,7 +1345,7 @@ { "cell_type": "code", "execution_count": null, - "id": "df2ec7b2", + "id": "d1df0fd1", "metadata": { "hide-output": false }, @@ -1364,7 +1364,7 @@ { "cell_type": "code", "execution_count": null, - "id": "d8424b16", + "id": "b55548d2", "metadata": { "hide-output": false }, @@ -1376,7 +1376,7 @@ { "cell_type": "code", "execution_count": null, - "id": "d319dea2", + "id": "21e1d969", "metadata": { "hide-output": false }, @@ -1387,7 +1387,7 @@ }, { "cell_type": "markdown", - "id": "a537ebcb", + "id": "76e32962", "metadata": {}, "source": [ "We only want unconditional expectations because we are in an IID case.\n", @@ -1399,7 +1399,7 @@ { "cell_type": "code", "execution_count": null, - "id": "647e7527", + "id": "d68583a2", "metadata": { "hide-output": false }, @@ -1412,7 +1412,7 @@ }, { "cell_type": "markdown", - "id": "83d89746", + "id": "14cc11a5", "metadata": {}, "source": [ "Let’s look at the random variables $ {\\mathcal R}, {\\mathcal X} $" @@ -1421,7 +1421,7 @@ { "cell_type": "code", "execution_count": null, - "id": "3635cdda", + "id": "30c4fd47", "metadata": { "hide-output": false }, @@ -1433,7 +1433,7 @@ { "cell_type": "code", "execution_count": null, - "id": "a9fd6ac0", + "id": "72ef64f0", "metadata": { "hide-output": false }, @@ -1445,7 +1445,7 @@ { "cell_type": "code", "execution_count": null, - "id": "67d667fe", + "id": "ee30e0d3", "metadata": { "hide-output": false }, @@ -1457,7 +1457,7 @@ { "cell_type": "code", "execution_count": null, - "id": "f4b2a2fa", + "id": "4ff14bd1", "metadata": { "hide-output": false }, @@ -1469,7 +1469,7 @@ { "cell_type": "code", "execution_count": null, - "id": "e998df7e", + "id": "b431c759", "metadata": { "hide-output": false }, @@ -1480,7 +1480,7 @@ }, { "cell_type": "markdown", - "id": "8f4b31e4", + "id": "e4407644", "metadata": {}, "source": [ "#### Step 3" @@ -1489,7 +1489,7 @@ { "cell_type": "code", "execution_count": null, - "id": "005bc60f", + "id": "0b221747", "metadata": { "hide-output": false }, @@ -1502,7 +1502,7 @@ }, { "cell_type": "markdown", - "id": "645c6369", + "id": "d9bd1438", "metadata": {}, "source": [ "Note that $ B $ is a scalar.\n", @@ -1513,7 +1513,7 @@ { "cell_type": "code", "execution_count": null, - "id": "97f183c2", + "id": "32797dc3", "metadata": { "hide-output": false }, @@ -1528,7 +1528,7 @@ }, { "cell_type": "markdown", - "id": "f0965564", + "id": "4b564398", "metadata": {}, "source": [ "In the above cell, B is fixed at 1 and $ \\tau $ is to be computed as\n", @@ -1540,7 +1540,7 @@ }, { "cell_type": "markdown", - "id": "e5f18f4d", + "id": "d6fdbc35", "metadata": {}, "source": [ "#### Step 4" @@ -1549,7 +1549,7 @@ { "cell_type": "code", "execution_count": null, - "id": "b6b2c4ef", + "id": "a697b3ba", "metadata": { "hide-output": false }, @@ -1565,7 +1565,7 @@ { "cell_type": "code", "execution_count": null, - "id": "08dde7b4", + "id": "2400a714", "metadata": { "hide-output": false }, @@ -1576,7 +1576,7 @@ }, { "cell_type": "markdown", - "id": "7953ae43", + "id": "6771b063", "metadata": {}, "source": [ "#### Step 6" @@ -1585,7 +1585,7 @@ { "cell_type": "code", "execution_count": null, - "id": "adc45bf7", + "id": "a988fc15", "metadata": { "hide-output": false }, @@ -1598,7 +1598,7 @@ { "cell_type": "code", "execution_count": null, - "id": "fc501c13", + "id": "cd4b6b08", "metadata": { "hide-output": false }, @@ -1610,7 +1610,7 @@ { "cell_type": "code", "execution_count": null, - "id": "713699ce", + "id": "cf97d018", "metadata": { "hide-output": false }, @@ -1624,7 +1624,7 @@ { "cell_type": "code", "execution_count": null, - "id": "757a4558", + "id": "0cfeeae5", "metadata": { "hide-output": false }, @@ -1637,7 +1637,7 @@ { "cell_type": "code", "execution_count": null, - "id": "4aefe083", + "id": "20823fbb", "metadata": { "hide-output": false }, @@ -1650,7 +1650,7 @@ { "cell_type": "code", "execution_count": null, - "id": "2209e5f2", + "id": "1950f668", "metadata": { "hide-output": false }, @@ -1663,7 +1663,7 @@ { "cell_type": "code", "execution_count": null, - "id": "5151df33", + "id": "f8e61798", "metadata": { "hide-output": false }, @@ -1676,7 +1676,7 @@ { "cell_type": "code", "execution_count": null, - "id": "c38c6fcd", + "id": "dad1de79", "metadata": { "hide-output": false }, @@ -1687,7 +1687,7 @@ } ], "metadata": { - "date": 1734843460.1956766, + "date": 1735958029.9262686, "filename": "amss3.md", "kernelspec": { "display_name": "Python", diff --git a/arellano.ipynb b/arellano.ipynb index ae48a8f..ec4b659 100644 --- a/arellano.ipynb +++ b/arellano.ipynb @@ -2,7 +2,7 @@ "cells": [ { "cell_type": "markdown", - "id": "a6cc1970", + "id": "5c2ee11b", "metadata": {}, "source": [ "\n", @@ -11,7 +11,7 @@ }, { "cell_type": "markdown", - "id": "6166ccf8", + "id": "b3e85f82", "metadata": {}, "source": [ "# Default Risk and Income Fluctuations\n", @@ -22,7 +22,7 @@ { "cell_type": "code", "execution_count": null, - "id": "a37f0ba3", + "id": "f90cc26d", "metadata": { "hide-output": false }, @@ -33,7 +33,7 @@ }, { "cell_type": "markdown", - "id": "8094958a", + "id": "2e134101", "metadata": {}, "source": [ "## Overview\n", @@ -85,7 +85,7 @@ { "cell_type": "code", "execution_count": null, - "id": "eef610f8", + "id": "885ee3a3", "metadata": { "hide-output": false }, @@ -99,7 +99,7 @@ }, { "cell_type": "markdown", - "id": "769c5ef7", + "id": "cf7fbdfb", "metadata": {}, "source": [ "## Structure\n", @@ -109,7 +109,7 @@ }, { "cell_type": "markdown", - "id": "2b795605", + "id": "37be3c26", "metadata": {}, "source": [ "### Output, Consumption and Debt\n", @@ -151,7 +151,7 @@ }, { "cell_type": "markdown", - "id": "19a1eb24", + "id": "a90f255c", "metadata": {}, "source": [ "### Asset Markets\n", @@ -193,7 +193,7 @@ }, { "cell_type": "markdown", - "id": "3dfae24c", + "id": "ba12ec54", "metadata": {}, "source": [ "### Financial Markets\n", @@ -225,7 +225,7 @@ }, { "cell_type": "markdown", - "id": "43238f42", + "id": "f32d252c", "metadata": {}, "source": [ "### Government’s Decisions\n", @@ -251,7 +251,7 @@ }, { "cell_type": "markdown", - "id": "a0316b67", + "id": "bead13e1", "metadata": {}, "source": [ "### Reentering International Credit Market\n", @@ -262,7 +262,7 @@ }, { "cell_type": "markdown", - "id": "8dd3cf73", + "id": "cdd3c741", "metadata": {}, "source": [ "## Equilibrium\n", @@ -354,7 +354,7 @@ }, { "cell_type": "markdown", - "id": "4f7c78cf", + "id": "eb4863cb", "metadata": {}, "source": [ "### Definition of Equilibrium\n", @@ -379,7 +379,7 @@ }, { "cell_type": "markdown", - "id": "f2ace5f6", + "id": "235ef1c7", "metadata": {}, "source": [ "## Computation\n", @@ -425,7 +425,7 @@ { "cell_type": "code", "execution_count": null, - "id": "e19ea54e", + "id": "cc9fbc72", "metadata": { "hide-output": false }, @@ -472,7 +472,7 @@ }, { "cell_type": "markdown", - "id": "4e3d1628", + "id": "9ff4a23b", "metadata": {}, "source": [ "Notice how the class returns the data it stores as simple numerical values and\n", @@ -488,7 +488,7 @@ { "cell_type": "code", "execution_count": null, - "id": "84ff8840", + "id": "f81162f3", "metadata": { "hide-output": false }, @@ -501,7 +501,7 @@ }, { "cell_type": "markdown", - "id": "f82dd66f", + "id": "f384dba8", "metadata": {}, "source": [ "Here is a function to compute the bond price at each state, given $ v_c $ and\n", @@ -511,7 +511,7 @@ { "cell_type": "code", "execution_count": null, - "id": "33614ae9", + "id": "55e1a178", "metadata": { "hide-output": false }, @@ -538,7 +538,7 @@ }, { "cell_type": "markdown", - "id": "d7c6c629", + "id": "245a3ed5", "metadata": {}, "source": [ "Next we introduce Bellman operators that updated $ v_d $ and $ v_c $." @@ -547,7 +547,7 @@ { "cell_type": "code", "execution_count": null, - "id": "49bd1cb1", + "id": "b5e8f9bc", "metadata": { "hide-output": false }, @@ -599,7 +599,7 @@ }, { "cell_type": "markdown", - "id": "6903d8da", + "id": "25c49725", "metadata": {}, "source": [ "Here is a fast function that calls these operators in the right sequence." @@ -608,7 +608,7 @@ { "cell_type": "code", "execution_count": null, - "id": "13f6bdbc", + "id": "6ad8de08", "metadata": { "hide-output": false }, @@ -645,7 +645,7 @@ }, { "cell_type": "markdown", - "id": "e20f7e4f", + "id": "071a7ccf", "metadata": {}, "source": [ "We can now write a function that will use the `Arellano_Economy` class and the\n", @@ -662,7 +662,7 @@ { "cell_type": "code", "execution_count": null, - "id": "ef03b266", + "id": "ccc80e61", "metadata": { "hide-output": false }, @@ -706,7 +706,7 @@ }, { "cell_type": "markdown", - "id": "87feb74e", + "id": "1829612f", "metadata": {}, "source": [ "Finally, we write a function that will allow us to simulate the economy once\n", @@ -716,7 +716,7 @@ { "cell_type": "code", "execution_count": null, - "id": "7f956ebd", + "id": "c4d79c6b", "metadata": { "hide-output": false }, @@ -786,7 +786,7 @@ }, { "cell_type": "markdown", - "id": "c54aad07", + "id": "d8fa2df9", "metadata": {}, "source": [ "## Results\n", @@ -857,7 +857,7 @@ }, { "cell_type": "markdown", - "id": "3e4b5065", + "id": "882ee087", "metadata": {}, "source": [ "## Exercises\n", @@ -868,7 +868,7 @@ }, { "cell_type": "markdown", - "id": "cac1ff51", + "id": "e6d13b83", "metadata": {}, "source": [ "## Exercise 13.1\n", @@ -881,7 +881,7 @@ }, { "cell_type": "markdown", - "id": "db656e08", + "id": "d4e947b5", "metadata": {}, "source": [ "## Solution to[ Exercise 13.1](https://python-advanced.quantecon.org/#arella_ex1)\n", @@ -892,7 +892,7 @@ { "cell_type": "code", "execution_count": null, - "id": "f4dd490d", + "id": "2fc9e0f6", "metadata": { "hide-output": false }, @@ -904,7 +904,7 @@ { "cell_type": "code", "execution_count": null, - "id": "ecab2272", + "id": "d8df18c9", "metadata": { "hide-output": false }, @@ -915,7 +915,7 @@ }, { "cell_type": "markdown", - "id": "e5087ed5", + "id": "753ca9f3", "metadata": {}, "source": [ "Compute the bond price schedule as seen in figure 3 of Arellano (2008)" @@ -924,7 +924,7 @@ { "cell_type": "code", "execution_count": null, - "id": "69667e7b", + "id": "32202bc6", "metadata": { "hide-output": false }, @@ -960,7 +960,7 @@ }, { "cell_type": "markdown", - "id": "fe78ee06", + "id": "699f46f1", "metadata": {}, "source": [ "Draw a plot of the value functions" @@ -969,7 +969,7 @@ { "cell_type": "code", "execution_count": null, - "id": "58000089", + "id": "2a66396a", "metadata": { "hide-output": false }, @@ -989,7 +989,7 @@ }, { "cell_type": "markdown", - "id": "d2504902", + "id": "69013d2b", "metadata": {}, "source": [ "Draw a heat map for default probability" @@ -998,7 +998,7 @@ { "cell_type": "code", "execution_count": null, - "id": "9283e570", + "id": "e030cf1b", "metadata": { "hide-output": false }, @@ -1023,7 +1023,7 @@ }, { "cell_type": "markdown", - "id": "f3aa5057", + "id": "fa09d960", "metadata": {}, "source": [ "Plot a time series of major variables simulated from the model" @@ -1032,7 +1032,7 @@ { "cell_type": "code", "execution_count": null, - "id": "51b79669", + "id": "a2478096", "metadata": { "hide-output": false }, @@ -1081,7 +1081,7 @@ } ], "metadata": { - "date": 1734843460.2292593, + "date": 1735958029.9606364, "filename": "arellano.md", "kernelspec": { "display_name": "Python", diff --git a/arma.ipynb b/arma.ipynb index 095bcb9..dabafae 100644 --- a/arma.ipynb +++ b/arma.ipynb @@ -2,7 +2,7 @@ "cells": [ { "cell_type": "markdown", - "id": "e8de625d", + "id": "8dcfe889", "metadata": {}, "source": [ "\n", @@ -11,7 +11,7 @@ }, { "cell_type": "markdown", - "id": "59f86100", + "id": "85944175", "metadata": {}, "source": [ "# Covariance Stationary Processes\n", @@ -22,7 +22,7 @@ { "cell_type": "code", "execution_count": null, - "id": "2b135a30", + "id": "5cf299d4", "metadata": { "hide-output": false }, @@ -33,7 +33,7 @@ }, { "cell_type": "markdown", - "id": "d40ece26", + "id": "99594e5b", "metadata": {}, "source": [ "## Overview\n", @@ -52,7 +52,7 @@ }, { "cell_type": "markdown", - "id": "181a4437", + "id": "73ea7fb8", "metadata": {}, "source": [ "### ARMA Processes\n", @@ -68,7 +68,7 @@ }, { "cell_type": "markdown", - "id": "9fec396b", + "id": "8c51288e", "metadata": {}, "source": [ "### Spectral Analysis\n", @@ -89,7 +89,7 @@ }, { "cell_type": "markdown", - "id": "0ca88903", + "id": "dec7c814", "metadata": {}, "source": [ "### Other Reading\n", @@ -102,7 +102,7 @@ { "cell_type": "code", "execution_count": null, - "id": "829733cb", + "id": "bc3c74ec", "metadata": { "hide-output": false }, @@ -115,7 +115,7 @@ }, { "cell_type": "markdown", - "id": "293671f3", + "id": "4d2b5b04", "metadata": {}, "source": [ "## Introduction\n", @@ -137,7 +137,7 @@ }, { "cell_type": "markdown", - "id": "1cc959a4", + "id": "19848b27", "metadata": {}, "source": [ "### Definitions\n", @@ -159,7 +159,7 @@ }, { "cell_type": "markdown", - "id": "a5515f09", + "id": "6926e0fd", "metadata": {}, "source": [ "### Example 1: White Noise\n", @@ -182,7 +182,7 @@ }, { "cell_type": "markdown", - "id": "d6d17334", + "id": "b0bae18a", "metadata": {}, "source": [ "### Example 2: General Linear Processes\n", @@ -221,7 +221,7 @@ }, { "cell_type": "markdown", - "id": "7a8f1849", + "id": "b03e277f", "metadata": {}, "source": [ "### Wold Representation\n", @@ -249,7 +249,7 @@ }, { "cell_type": "markdown", - "id": "4ec61576", + "id": "f0c45719", "metadata": {}, "source": [ "### AR and MA\n", @@ -292,7 +292,7 @@ { "cell_type": "code", "execution_count": null, - "id": "2e78a651", + "id": "ed4494da", "metadata": { "hide-output": false }, @@ -316,7 +316,7 @@ }, { "cell_type": "markdown", - "id": "87e9d3d1", + "id": "6ce27806", "metadata": {}, "source": [ "Another very simple process is the MA(1) process (here MA means “moving average”)\n", @@ -342,7 +342,7 @@ }, { "cell_type": "markdown", - "id": "a5926358", + "id": "beee4736", "metadata": {}, "source": [ "### ARMA Processes\n", @@ -411,7 +411,7 @@ }, { "cell_type": "markdown", - "id": "2e6d295a", + "id": "219e7798", "metadata": {}, "source": [ "## Spectral Analysis\n", @@ -429,7 +429,7 @@ }, { "cell_type": "markdown", - "id": "a20c9166", + "id": "925e801f", "metadata": {}, "source": [ "### Complex Numbers\n", @@ -470,7 +470,7 @@ }, { "cell_type": "markdown", - "id": "fe704a3c", + "id": "9229d5da", "metadata": {}, "source": [ "### Spectral Densities\n", @@ -512,7 +512,7 @@ }, { "cell_type": "markdown", - "id": "f65a7c5f", + "id": "3fa4e7f0", "metadata": {}, "source": [ "### Example 1: White Noise\n", @@ -528,7 +528,7 @@ }, { "cell_type": "markdown", - "id": "9a5d8263", + "id": "ad5e49a7", "metadata": {}, "source": [ "### Example 2: AR and MA and ARMA\n", @@ -576,7 +576,7 @@ }, { "cell_type": "markdown", - "id": "4b6cab4c", + "id": "321db189", "metadata": {}, "source": [ "### Interpreting the Spectral Density\n", @@ -589,7 +589,7 @@ { "cell_type": "code", "execution_count": null, - "id": "a47a3b93", + "id": "99b66bd6", "metadata": { "hide-output": false }, @@ -616,7 +616,7 @@ }, { "cell_type": "markdown", - "id": "372b6605", + "id": "45fb6dd4", "metadata": {}, "source": [ "These spectral densities correspond to the autocovariance functions for the\n", @@ -650,7 +650,7 @@ { "cell_type": "code", "execution_count": null, - "id": "a88efbe2", + "id": "0126b2e1", "metadata": { "hide-output": false }, @@ -693,7 +693,7 @@ }, { "cell_type": "markdown", - "id": "7f775679", + "id": "16c75ffd", "metadata": {}, "source": [ "On the other hand, if we evaluate $ f(\\omega) $ at $ \\omega = \\pi / 3 $, then the cycles are\n", @@ -704,7 +704,7 @@ { "cell_type": "code", "execution_count": null, - "id": "e50ec2a5", + "id": "528da7e7", "metadata": { "hide-output": false }, @@ -747,7 +747,7 @@ }, { "cell_type": "markdown", - "id": "dca77829", + "id": "b041e06e", "metadata": {}, "source": [ "In summary, the spectral density is large at frequencies $ \\omega $ where the autocovariance function exhibits damped cycles." @@ -755,7 +755,7 @@ }, { "cell_type": "markdown", - "id": "59beae45", + "id": "78453a63", "metadata": {}, "source": [ "### Inverting the Transformation\n", @@ -781,7 +781,7 @@ }, { "cell_type": "markdown", - "id": "4e92f55a", + "id": "80d9ed3b", "metadata": {}, "source": [ "### Mathematical Theory\n", @@ -870,7 +870,7 @@ }, { "cell_type": "markdown", - "id": "89f649ac", + "id": "7b498e54", "metadata": {}, "source": [ "## Implementation\n", @@ -891,7 +891,7 @@ }, { "cell_type": "markdown", - "id": "db1f016c", + "id": "c915b916", "metadata": {}, "source": [ "### Application\n", @@ -904,7 +904,7 @@ { "cell_type": "code", "execution_count": null, - "id": "f70f666e", + "id": "3eab4c16", "metadata": { "hide-output": false }, @@ -965,7 +965,7 @@ }, { "cell_type": "markdown", - "id": "9a95f503", + "id": "81c7e597", "metadata": {}, "source": [ "Now let’s call these functions to generate plots.\n", @@ -976,7 +976,7 @@ { "cell_type": "code", "execution_count": null, - "id": "3f40a1e1", + "id": "573d48ad", "metadata": { "hide-output": false }, @@ -990,7 +990,7 @@ }, { "cell_type": "markdown", - "id": "9513a147", + "id": "dad3275b", "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", @@ -1012,7 +1012,7 @@ { "cell_type": "code", "execution_count": null, - "id": "a82df476", + "id": "73b8ef67", "metadata": { "hide-output": false }, @@ -1026,7 +1026,7 @@ }, { "cell_type": "markdown", - "id": "a85ce569", + "id": "9ae9df8e", "metadata": {}, "source": [ "Ljungqvist and Sargent’s second model is $ X_t = .9 X_{t-1} + \\epsilon_t $" @@ -1035,7 +1035,7 @@ { "cell_type": "code", "execution_count": null, - "id": "8ac3f857", + "id": "65201b79", "metadata": { "hide-output": false }, @@ -1049,7 +1049,7 @@ }, { "cell_type": "markdown", - "id": "7b4bbab2", + "id": "d9f0fdba", "metadata": {}, "source": [ "Ljungqvist and Sargent’s third model is $ X_t = .8 X_{t-4} + \\epsilon_t $" @@ -1058,7 +1058,7 @@ { "cell_type": "code", "execution_count": null, - "id": "a7b6022a", + "id": "d1108108", "metadata": { "hide-output": false }, @@ -1072,7 +1072,7 @@ }, { "cell_type": "markdown", - "id": "f8ef6bae", + "id": "f07efb4b", "metadata": {}, "source": [ "Ljungqvist and Sargent’s fourth model is $ X_t = .98 X_{t-1} + \\epsilon_t -.7 \\epsilon_{t-1} $" @@ -1081,7 +1081,7 @@ { "cell_type": "code", "execution_count": null, - "id": "90bf43e2", + "id": "090a5857", "metadata": { "hide-output": false }, @@ -1095,7 +1095,7 @@ }, { "cell_type": "markdown", - "id": "d3bad03a", + "id": "b85744d9", "metadata": {}, "source": [ "### Explanation\n", @@ -1153,7 +1153,7 @@ }, { "cell_type": "markdown", - "id": "4093aed6", + "id": "87117c7a", "metadata": {}, "source": [ "### Computing the Autocovariance Function\n", @@ -1198,7 +1198,7 @@ } ], "metadata": { - "date": 1734843460.2828276, + "date": 1735958030.0157995, "filename": "arma.md", "kernelspec": { "display_name": "Python", diff --git a/asset_pricing_lph.ipynb b/asset_pricing_lph.ipynb index 7b15058..9a8af26 100644 --- a/asset_pricing_lph.ipynb +++ b/asset_pricing_lph.ipynb @@ -2,7 +2,7 @@ "cells": [ { "cell_type": "markdown", - "id": "1678b8fe", + "id": "7942fd5c", "metadata": {}, "source": [ "# Elementary Asset Pricing Theory\n", @@ -13,7 +13,7 @@ }, { "cell_type": "markdown", - "id": "d518d734", + "id": "68544312", "metadata": {}, "source": [ "## Overview\n", @@ -58,7 +58,7 @@ }, { "cell_type": "markdown", - "id": "178f6cf2", + "id": "16081826", "metadata": {}, "source": [ "## Key Equation\n", @@ -102,7 +102,7 @@ }, { "cell_type": "markdown", - "id": "36b968fe", + "id": "0a24486c", "metadata": {}, "source": [ "## Implications of Key Equation\n", @@ -178,7 +178,7 @@ }, { "cell_type": "markdown", - "id": "d690d358", + "id": "842ab678", "metadata": {}, "source": [ "## Expected Return - Beta Representation\n", @@ -297,7 +297,7 @@ }, { "cell_type": "markdown", - "id": "2468be3c", + "id": "825f0fab", "metadata": {}, "source": [ "## Mean-Variance Frontier\n", @@ -371,7 +371,7 @@ { "cell_type": "code", "execution_count": null, - "id": "245b7d4b", + "id": "e95b7e4e", "metadata": { "hide-output": false }, @@ -419,7 +419,7 @@ }, { "cell_type": "markdown", - "id": "5ecf40c9", + "id": "76ddd023", "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", @@ -454,7 +454,7 @@ }, { "cell_type": "markdown", - "id": "6ca6681f", + "id": "abd3d8f4", "metadata": {}, "source": [ "## Sharpe Ratios and the Price of Risk\n", @@ -479,7 +479,7 @@ }, { "cell_type": "markdown", - "id": "51c9b12c", + "id": "1a9c94b7", "metadata": {}, "source": [ "## Mathematical Structure of Frontier\n", @@ -511,7 +511,7 @@ }, { "cell_type": "markdown", - "id": "ee6a81ad", + "id": "d4fd53d8", "metadata": {}, "source": [ "## Multi-factor Models\n", @@ -549,7 +549,7 @@ }, { "cell_type": "markdown", - "id": "7ad8e6c9", + "id": "06c22a30", "metadata": {}, "source": [ "## Empirical Implementations\n", @@ -613,7 +613,7 @@ }, { "cell_type": "markdown", - "id": "d1a26a2e", + "id": "048a8bb0", "metadata": {}, "source": [ "## Exercises\n", @@ -624,7 +624,7 @@ { "cell_type": "code", "execution_count": null, - "id": "71167bb0", + "id": "6a30612f", "metadata": { "hide-output": false }, @@ -637,7 +637,7 @@ }, { "cell_type": "markdown", - "id": "0fe7f966", + "id": "0a2f2033", "metadata": {}, "source": [ "Lots of our calculations will involve computing population and sample OLS regressions.\n", @@ -648,7 +648,7 @@ { "cell_type": "code", "execution_count": null, - "id": "2bdf772a", + "id": "186b0f0e", "metadata": { "hide-output": false }, @@ -670,7 +670,7 @@ }, { "cell_type": "markdown", - "id": "0ec35c41", + "id": "9a446a12", "metadata": {}, "source": [ "## Exercise 36.1\n", @@ -686,7 +686,7 @@ }, { "cell_type": "markdown", - "id": "9c056995", + "id": "9687cbb5", "metadata": {}, "source": [ "## Solution to[ Exercise 36.1](https://python-advanced.quantecon.org/#apl_ex1)\n", @@ -712,7 +712,7 @@ }, { "cell_type": "markdown", - "id": "be826059", + "id": "b0d769ce", "metadata": {}, "source": [ "## Exercise 36.2\n", @@ -722,7 +722,7 @@ }, { "cell_type": "markdown", - "id": "c891bd75", + "id": "9510e6c9", "metadata": {}, "source": [ "## Solution to[ Exercise 36.2](https://python-advanced.quantecon.org/#apl_ex2)\n", @@ -736,7 +736,7 @@ }, { "cell_type": "markdown", - "id": "8fcde9e3", + "id": "d621a420", "metadata": {}, "source": [ "## Exercise 36.3\n", @@ -791,7 +791,7 @@ }, { "cell_type": "markdown", - "id": "28789e63", + "id": "bf28199d", "metadata": {}, "source": [ "## Solution to[ Exercise 36.3](https://python-advanced.quantecon.org/#apl_ex3)\n", @@ -802,7 +802,7 @@ { "cell_type": "code", "execution_count": null, - "id": "f89c150f", + "id": "8cbccdc8", "metadata": { "hide-output": false }, @@ -822,7 +822,7 @@ { "cell_type": "code", "execution_count": null, - "id": "dfd2e359", + "id": "34434258", "metadata": { "hide-output": false }, @@ -837,7 +837,7 @@ { "cell_type": "code", "execution_count": null, - "id": "dbd05d3f", + "id": "70e1a4af", "metadata": { "hide-output": false }, @@ -852,7 +852,7 @@ { "cell_type": "code", "execution_count": null, - "id": "62378134", + "id": "475e324e", "metadata": { "hide-output": false }, @@ -873,7 +873,7 @@ }, { "cell_type": "markdown", - "id": "4b9a1b11", + "id": "8b1a2ec7", "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." @@ -882,7 +882,7 @@ { "cell_type": "code", "execution_count": null, - "id": "d416944b", + "id": "b5c7e00e", "metadata": { "hide-output": false }, @@ -893,7 +893,7 @@ }, { "cell_type": "markdown", - "id": "ffdf8223", + "id": "7674a9f9", "metadata": {}, "source": [ "**Inverse Problem:**\n", @@ -906,7 +906,7 @@ { "cell_type": "code", "execution_count": null, - "id": "9cb77d45", + "id": "8a52b1c3", "metadata": { "hide-output": false }, @@ -918,7 +918,7 @@ { "cell_type": "code", "execution_count": null, - "id": "af0552a9", + "id": "b24a1cc3", "metadata": { "hide-output": false }, @@ -929,7 +929,7 @@ }, { "cell_type": "markdown", - "id": "285155e8", + "id": "257d86e8", "metadata": {}, "source": [ "Let’s compare these with the *true* population parameter values." @@ -938,7 +938,7 @@ { "cell_type": "code", "execution_count": null, - "id": "58f4486b", + "id": "21ff90ee", "metadata": { "hide-output": false }, @@ -949,7 +949,7 @@ }, { "cell_type": "markdown", - "id": "d617df51", + "id": "1462b2fb", "metadata": {}, "source": [ "1. $ \\xi $ and $ \\lambda $ " @@ -958,7 +958,7 @@ { "cell_type": "code", "execution_count": null, - "id": "c0d1d904", + "id": "d9f35bfb", "metadata": { "hide-output": false }, @@ -970,7 +970,7 @@ { "cell_type": "code", "execution_count": null, - "id": "6d48de01", + "id": "0d9eab7e", "metadata": { "hide-output": false }, @@ -982,7 +982,7 @@ { "cell_type": "code", "execution_count": null, - "id": "be06f709", + "id": "aff513f4", "metadata": { "hide-output": false }, @@ -993,7 +993,7 @@ }, { "cell_type": "markdown", - "id": "1308b5a7", + "id": "e1fdfd96", "metadata": {}, "source": [ "1. $ \\beta_{i, R^m} $ and $ \\sigma_i $ " @@ -1002,7 +1002,7 @@ { "cell_type": "code", "execution_count": null, - "id": "3af80ab6", + "id": "4446a3ff", "metadata": { "hide-output": false }, @@ -1018,7 +1018,7 @@ { "cell_type": "code", "execution_count": null, - "id": "a0e51147", + "id": "0bcd3d9b", "metadata": { "hide-output": false }, @@ -1030,7 +1030,7 @@ { "cell_type": "code", "execution_count": null, - "id": "2e957ead", + "id": "2aa01b03", "metadata": { "hide-output": false }, @@ -1041,7 +1041,7 @@ }, { "cell_type": "markdown", - "id": "4eb64026", + "id": "45c45f2c", "metadata": {}, "source": [ "Q: How close did your estimates come to the parameters we specified?" @@ -1049,7 +1049,7 @@ }, { "cell_type": "markdown", - "id": "0ea5ce04", + "id": "63534063", "metadata": {}, "source": [ "## Exercise 36.4\n", @@ -1063,7 +1063,7 @@ }, { "cell_type": "markdown", - "id": "306b7e45", + "id": "84b957db", "metadata": {}, "source": [ "## Solution to[ Exercise 36.4](https://python-advanced.quantecon.org/#apl_ex4)\n", @@ -1081,7 +1081,7 @@ { "cell_type": "code", "execution_count": null, - "id": "c4dd6607", + "id": "87a1b282", "metadata": { "hide-output": false }, @@ -1104,7 +1104,7 @@ }, { "cell_type": "markdown", - "id": "c2d84a7b", + "id": "918ed1a0", "metadata": {}, "source": [ "Let’s try to solve $ a $ and $ b $ using the actual model parameters." @@ -1113,7 +1113,7 @@ { "cell_type": "code", "execution_count": null, - "id": "b503bde5", + "id": "83c7701c", "metadata": { "hide-output": false }, @@ -1125,7 +1125,7 @@ { "cell_type": "code", "execution_count": null, - "id": "3f0f79db", + "id": "a1c5c4c4", "metadata": { "hide-output": false }, @@ -1136,7 +1136,7 @@ }, { "cell_type": "markdown", - "id": "158e4333", + "id": "38d83c46", "metadata": {}, "source": [ "## Exercise 36.5\n", @@ -1146,7 +1146,7 @@ }, { "cell_type": "markdown", - "id": "1ebd0792", + "id": "891629f6", "metadata": {}, "source": [ "## Solution to[ Exercise 36.5](https://python-advanced.quantecon.org/#apl_ex5)\n", @@ -1157,7 +1157,7 @@ { "cell_type": "code", "execution_count": null, - "id": "dcd58918", + "id": "0a67f513", "metadata": { "hide-output": false }, @@ -1169,7 +1169,7 @@ { "cell_type": "code", "execution_count": null, - "id": "ffe45f80", + "id": "d1063e30", "metadata": { "hide-output": false }, @@ -1180,7 +1180,7 @@ } ], "metadata": { - "date": 1734843460.3333347, + "date": 1735958030.0668058, "filename": "asset_pricing_lph.md", "kernelspec": { "display_name": "Python", diff --git a/black_litterman.ipynb b/black_litterman.ipynb index e120b2c..59fd793 100644 --- a/black_litterman.ipynb +++ b/black_litterman.ipynb @@ -2,7 +2,7 @@ "cells": [ { "cell_type": "markdown", - "id": "e1da98a7", + "id": "9ddec3e9", "metadata": {}, "source": [ "\n", @@ -13,7 +13,7 @@ }, { "cell_type": "markdown", - "id": "a3cf7985", + "id": "6392ece8", "metadata": {}, "source": [ "# Two Modifications of Mean-Variance Portfolio Theory" @@ -21,7 +21,7 @@ }, { "cell_type": "markdown", - "id": "6f2fbd78", + "id": "3355b014", "metadata": {}, "source": [ "## Overview\n", @@ -81,7 +81,7 @@ { "cell_type": "code", "execution_count": null, - "id": "699e93c0", + "id": "d7988a78", "metadata": { "hide-output": false }, @@ -95,7 +95,7 @@ }, { "cell_type": "markdown", - "id": "8a8f9976", + "id": "d25abd3a", "metadata": {}, "source": [ "## Mean-Variance Portfolio Choice\n", @@ -158,7 +158,7 @@ }, { "cell_type": "markdown", - "id": "4455772c", + "id": "dab22904", "metadata": {}, "source": [ "## Estimating Mean and Variance\n", @@ -178,7 +178,7 @@ }, { "cell_type": "markdown", - "id": "a0c84570", + "id": "a3515760", "metadata": {}, "source": [ "## Black-Litterman Starting Point\n", @@ -196,7 +196,7 @@ { "cell_type": "code", "execution_count": null, - "id": "0ada42b3", + "id": "c5a18a6b", "metadata": { "hide-output": false }, @@ -249,7 +249,7 @@ }, { "cell_type": "markdown", - "id": "e2c34702", + "id": "b2caba58", "metadata": {}, "source": [ "Black and Litterman’s responded to this situation in the following way:\n", @@ -277,7 +277,7 @@ }, { "cell_type": "markdown", - "id": "bfe7144b", + "id": "5696f036", "metadata": {}, "source": [ "## Details\n", @@ -349,7 +349,7 @@ { "cell_type": "code", "execution_count": null, - "id": "a7f4837c", + "id": "71ec2d77", "metadata": { "hide-output": false }, @@ -385,7 +385,7 @@ }, { "cell_type": "markdown", - "id": "54964e66", + "id": "992ca211", "metadata": {}, "source": [ "## Adding Views\n", @@ -448,7 +448,7 @@ { "cell_type": "code", "execution_count": null, - "id": "4208e571", + "id": "73c1b77c", "metadata": { "hide-output": false }, @@ -476,7 +476,7 @@ { "cell_type": "code", "execution_count": null, - "id": "c5a795a0", + "id": "952cb608", "metadata": { "hide-output": false }, @@ -521,7 +521,7 @@ }, { "cell_type": "markdown", - "id": "d58d45c6", + "id": "b3573dbe", "metadata": {}, "source": [ "## Bayesian Interpretation\n", @@ -571,7 +571,7 @@ }, { "cell_type": "markdown", - "id": "241f3644", + "id": "61a72975", "metadata": {}, "source": [ "## Curve Decolletage\n", @@ -701,7 +701,7 @@ { "cell_type": "code", "execution_count": null, - "id": "6a6858a3", + "id": "87e4e99f", "metadata": { "hide-output": false }, @@ -746,7 +746,7 @@ { "cell_type": "code", "execution_count": null, - "id": "5a714b2d", + "id": "cd5e1e92", "metadata": { "hide-output": false }, @@ -786,7 +786,7 @@ }, { "cell_type": "markdown", - "id": "a4022d30", + "id": "0d8796bd", "metadata": {}, "source": [ "Note that the line that connects the two points\n", @@ -807,7 +807,7 @@ { "cell_type": "code", "execution_count": null, - "id": "80c03d13", + "id": "ab19cf73", "metadata": { "hide-output": false }, @@ -822,7 +822,7 @@ { "cell_type": "code", "execution_count": null, - "id": "36b6f142", + "id": "ce875364", "metadata": { "hide-output": false }, @@ -863,7 +863,7 @@ }, { "cell_type": "markdown", - "id": "64d03c66", + "id": "c4b89bae", "metadata": {}, "source": [ "## Black-Litterman Recommendation as Regularization\n", @@ -1019,7 +1019,7 @@ }, { "cell_type": "markdown", - "id": "e87073ce", + "id": "cef11c71", "metadata": {}, "source": [ "## A Robust Control Operator\n", @@ -1159,7 +1159,7 @@ }, { "cell_type": "markdown", - "id": "2649a58f", + "id": "8975b12a", "metadata": {}, "source": [ "## A Robust Mean-Variance Portfolio Model\n", @@ -1230,7 +1230,7 @@ }, { "cell_type": "markdown", - "id": "b3ec3eb6", + "id": "e88c6a16", "metadata": {}, "source": [ "## Appendix\n", @@ -1306,7 +1306,7 @@ }, { "cell_type": "markdown", - "id": "648a489b", + "id": "39beb974", "metadata": {}, "source": [ "## Special Case – IID Sample\n", @@ -1349,7 +1349,7 @@ }, { "cell_type": "markdown", - "id": "72c837bc", + "id": "348d964d", "metadata": {}, "source": [ "## Dependence and Sampling Frequency\n", @@ -1414,7 +1414,7 @@ { "cell_type": "code", "execution_count": null, - "id": "a694f3b1", + "id": "fb5fd856", "metadata": { "hide-output": false }, @@ -1445,7 +1445,7 @@ }, { "cell_type": "markdown", - "id": "cc258de7", + "id": "4b52af49", "metadata": {}, "source": [ "## Frequency and the Mean Estimator\n", @@ -1527,7 +1527,7 @@ { "cell_type": "code", "execution_count": null, - "id": "5388b3c3", + "id": "a1239928", "metadata": { "hide-output": false }, @@ -1556,7 +1556,7 @@ { "cell_type": "code", "execution_count": null, - "id": "1e31d98f", + "id": "3b575e27", "metadata": { "hide-output": false }, @@ -1602,7 +1602,7 @@ }, { "cell_type": "markdown", - "id": "33abdda7", + "id": "c01db56b", "metadata": {}, "source": [ "The above figure illustrates the relationship between the asymptotic\n", @@ -1620,7 +1620,7 @@ } ], "metadata": { - "date": 1734843460.3814168, + "date": 1735958030.1160924, "filename": "black_litterman.md", "kernelspec": { "display_name": "Python", diff --git a/calvo.ipynb b/calvo.ipynb index 6aae483..e8d5f20 100644 --- a/calvo.ipynb +++ b/calvo.ipynb @@ -2,7 +2,7 @@ "cells": [ { "cell_type": "markdown", - "id": "0b2da8d1", + "id": "16bb7da2", "metadata": {}, "source": [ "\n", @@ -11,7 +11,7 @@ }, { "cell_type": "markdown", - "id": "a48cd811", + "id": "171c7a49", "metadata": {}, "source": [ "# Time Inconsistency of Ramsey Plans\n", @@ -24,7 +24,7 @@ { "cell_type": "code", "execution_count": null, - "id": "58d73f8f", + "id": "557a4422", "metadata": { "hide-output": false }, @@ -35,34 +35,34 @@ }, { "cell_type": "markdown", - "id": "7ea4c73b", + "id": "66fa7dc1", "metadata": {}, "source": [ "## Overview\n", "\n", - "This lecture describes several linear-quadratic versions of a model that Guillermo Calvo [[Calvo, 1978](https://python-advanced.quantecon.org/zreferences.html#id142)] used to illustrate the **time inconsistency** of optimal government\n", + "This lecture describes a linear-quadratic version of a model that Guillermo Calvo [[Calvo, 1978](https://python-advanced.quantecon.org/zreferences.html#id142)] used to analyze the **time inconsistency** of optimal government\n", "plans.\n", "\n", - "Like Chang [[Chang, 1998](https://python-advanced.quantecon.org/zreferences.html#id218)], we use these models as laboratories in which to explore consequences of timing protocols for government decision making.\n", + "We use the model as a laboratory in which we explore consequences of different timing protocols for government decision making.\n", "\n", - "The models focus attention on intertemporal tradeoffs between\n", + "The model focuses on intertemporal tradeoffs between\n", "\n", - "- welfare benefits that anticipations of future deflation generate by decreasing costs of holding real money balances and thereby increasing a representative agent’s *liquidity*, as measured by his or her holdings of real money balances, and \n", + "- benefits that anticipations of future deflation generate by decreasing costs of holding real money balances and thereby increasing a representative agent’s *liquidity*, as measured by his or her holdings of real money balances, and \n", "- costs associated with the distorting taxes that the government must levy in order to acquire the paper money that it will destroy in order to generate anticipated deflation \n", "\n", "\n", - "The models feature\n", + "Model features include\n", "\n", "- rational expectations \n", - "- several explicit timing protocols \n", + "- alternative possible timing protocols for government choices of a sequence of money growth rates \n", "- costly government actions at all dates $ t \\geq 1 $ that increase household utilities at dates before $ t $ \n", - "- sets of Bellman equations, one set for each timing protocol \n", + "- alternative possible sets of Bellman equations, one set for each timing protocol \n", " - for example, in a timing protocol used to pose a **Ramsey plan**, a government chooses an infinite sequence of money supply growth rates once and for all at time $ 0 $. \n", " - in this timing protocol, there are two value functions and associated Bellman equations, one that expresses a representative private expectation of future inflation as a function of current and future government actions, another that describes the value function of a Ramsey planner \n", " - in other timing protocols, other Bellman equations and associated value functions will appear \n", "\n", "\n", - "A theme of this lecture is that timing protocols affect outcomes.\n", + "A theme of this lecture is that timing protocols for government decisions affect outcomes.\n", "\n", "We’ll use ideas from papers by Cagan [[Cagan, 1956](https://python-advanced.quantecon.org/zreferences.html#id81)], Calvo [[Calvo, 1978](https://python-advanced.quantecon.org/zreferences.html#id142)], and Chang [[Chang, 1998](https://python-advanced.quantecon.org/zreferences.html#id218)] as\n", "well as from chapter 19 of [[Ljungqvist and Sargent, 2018](https://python-advanced.quantecon.org/zreferences.html#id176)].\n", @@ -84,7 +84,7 @@ { "cell_type": "code", "execution_count": null, - "id": "34ba4130", + "id": "467ab346", "metadata": { "hide-output": false }, @@ -95,7 +95,7 @@ }, { "cell_type": "markdown", - "id": "8ce53efd", + "id": "ee4f271d", "metadata": {}, "source": [ "We’ll start with some imports:" @@ -104,7 +104,7 @@ { "cell_type": "code", "execution_count": null, - "id": "ea1f3a98", + "id": "60aa9636", "metadata": { "hide-output": false }, @@ -120,7 +120,7 @@ }, { "cell_type": "markdown", - "id": "02a03a01", + "id": "a93624c6", "metadata": {}, "source": [ "## Model Components\n", @@ -149,12 +149,11 @@ "related to the public’s expected rate of inflation, which equals\n", "the actual rate of inflation because there is no uncertainty here.\n", "\n", - "(When there is no uncertainty, an assumption of **rational expectations** becomes equivalent to **perfect foresight**).\n", - "\n", - "([[Sargent, 1977](https://python-advanced.quantecon.org/zreferences.html#id82)] presents a rational expectations version of the model when there is uncertainty.)\n", + ">**Note**\n", + ">\n", + ">When there is no uncertainty, an assumption of **rational expectations** becomes equivalent to **perfect foresight**. [[Sargent, 1977](https://python-advanced.quantecon.org/zreferences.html#id82)] presents a rational expectations version of the model when there is uncertainty.\n", "\n", - "Subtracting the demand function [(43.1)](#equation-eq-old1) at time $ t $ from the demand\n", - "function at $ t+1 $ gives:\n", + "Subtracting the demand function [(43.1)](#equation-eq-old1) at time $ t $ from the time $ t+1 $ version of this demand function gives\n", "\n", "$$\n", "\\mu_t - \\theta_t = -\\alpha \\theta_{t+1} + \\alpha \\theta_t\n", @@ -170,7 +169,7 @@ "\n", "Because $ \\alpha > 0 $, $ 0 < \\frac{\\alpha}{1+\\alpha} < 1 $.\n", "\n", - "**Definition:** For scalar $ b_t $, let $ L^2 $ be the space of sequences\n", + "**Definition:** For scalar $ b_t $, let $ L^2 $ be the space of sequences\n", "$ \\{b_t\\}_{t=0}^\\infty $ satisfying\n", "\n", "$$\n", @@ -188,18 +187,16 @@ "\\theta_t = \\frac{1}{1+\\alpha} \\sum_{j=0}^\\infty \\left(\\frac{\\alpha}{1+\\alpha}\\right)^j \\mu_{t+j} \\tag{43.3}\n", "$$\n", "\n", - "**Insight:** In the spirit of Chang [[Chang, 1998](https://python-advanced.quantecon.org/zreferences.html#id218)], equations [(43.1)](#equation-eq-old1) and [(43.3)](#equation-eq-old3) show that $ \\theta_t $ intermediates\n", - "how choices of $ \\mu_{t+j}, \\ j=0, 1, \\ldots $ impinge on time $ t $\n", - "real balances $ m_t - p_t = -\\alpha \\theta_t $.\n", + "**Insight:** Chang [[Chang, 1998](https://python-advanced.quantecon.org/zreferences.html#id218)] noted that equations [(43.1)](#equation-eq-old1) and [(43.3)](#equation-eq-old3) show that $ \\theta_t $ intermediates how choices of $ \\mu_{t+j}, \\ j=0, 1, \\ldots $ impinge on time $ t $ real balances $ m_t - p_t = -\\alpha \\theta_t $.\n", "\n", "An equivalence class of continuation money growth sequences $ \\{\\mu_{t+j}\\}_{j=0}^\\infty $ deliver the same $ \\theta_t $.\n", "\n", - "We shall use this insight to help us simplify our analysis of alternative government policy problems.\n", + "We shall use this insight to simplify our analysis of alternative government policy problems.\n", "\n", "That future rates of money creation influence earlier rates of inflation\n", "makes timing protocols matter for modeling optimal government policies.\n", "\n", - "When $ \\vec \\theta = \\{\\theta_t\\}_{t=0}^\\infty $ is square summable, we can represent restriction [(43.3)](#equation-eq-old3) as\n", + "We can represent restriction [(43.3)](#equation-eq-old3) as\n", "\n", "\n", "\n", @@ -238,7 +235,9 @@ "\n", "Notice that $ \\frac{1+\\alpha}{\\alpha} > 1 $ is an eigenvalue of transition matrix $ A $ that threatens to destabilize the state-space system.\n", "\n", - "The Ramsey planner will design a decision rule for $ \\mu_t $ that stabilizes the system.\n", + "Indeed, for arbitrary, $ \\vec \\mu = \\{\\mu_t\\}_{t=0}^\\infty $ sequences, $ \\vec \\theta = \\{\\theta_t\\}_{t=0}^\\infty $ will not be square summable.\n", + "\n", + "But the government planner will design a decision rule for $ \\mu_t $ that stabilizes the system and renders $ \\vec \\theta $ square summable.\n", "\n", "The government values a representative household’s utility of real balances at time $ t $ according to the utility function\n", "\n", @@ -259,7 +258,7 @@ }, { "cell_type": "markdown", - "id": "fc163921", + "id": "38e3995c", "metadata": {}, "source": [ "## Friedman’s Optimal Rate of Deflation\n", @@ -285,35 +284,33 @@ "\n", "where $ \\theta^* $ is given by equation [(43.8)](#equation-eq-friedmantheta).\n", "\n", - "To deduce this recommendation, Milton Friedman assumed that the taxes that government must impose in order to acquire money at rate $ \\mu_t $ do not distort economic decisions.\n", - "\n", - "- for example, perhaps the government can impose lump sum taxes that distort no decisions by private agents " + "Milton Friedman assumed that the taxes that government imposes to collect money at rate $ \\mu_t $ do not distort economic decisions, e.g., they are lump-sum taxes." ] }, { "cell_type": "markdown", - "id": "f8eeeae9", + "id": "4ea7e4bc", "metadata": {}, "source": [ "## Calvo’s Distortion\n", "\n", "The starting point of Calvo [[Calvo, 1978](https://python-advanced.quantecon.org/zreferences.html#id142)] and Chang [[Chang, 1998](https://python-advanced.quantecon.org/zreferences.html#id218)]\n", - "is that such lump sum taxes are not available.\n", + "is that lump sum taxes are not available.\n", "\n", "Instead, the government acquires money by levying taxes that distort decisions and thereby impose costs on the representative consumer.\n", "\n", - "In the models of Calvo [[Calvo, 1978](https://python-advanced.quantecon.org/zreferences.html#id142)] and Chang [[Chang, 1998](https://python-advanced.quantecon.org/zreferences.html#id218)], the government takes those costs tax-distortion costs into account.\n", + "In the models of Calvo [[Calvo, 1978](https://python-advanced.quantecon.org/zreferences.html#id142)] and Chang [[Chang, 1998](https://python-advanced.quantecon.org/zreferences.html#id218)], the government takes those tax-distortion costs into account.\n", "\n", - "It balances the costs of imposing the distorting taxes needed to acquire the money that it destroys in order to generate deflation against the benefits that expected deflation generates by raising the representative households’ holdings of real balances.\n", + "The government balances the **costs** of imposing the distorting taxes needed to acquire the money that it destroys in order to generate deflation against the **benefits** that expected deflation generates by raising the representative household’s real money balances.\n", "\n", - "Let’s see how the government does that in our version of the models of Calvo [[Calvo, 1978](https://python-advanced.quantecon.org/zreferences.html#id142)] and Chang [[Chang, 1998](https://python-advanced.quantecon.org/zreferences.html#id218)].\n", + "Let’s see how the government does that.\n", "\n", "Via equation [(43.3)](#equation-eq-old3), a government plan\n", "$ \\vec \\mu = \\{\\mu_t \\}_{t=0}^\\infty $ leads to a\n", "sequence of inflation outcomes\n", "$ \\vec \\theta = \\{ \\theta_t \\}_{t=0}^\\infty $.\n", "\n", - "We assume that the government incurs social costs $ \\frac{c}{2} \\mu_t^2 $ at\n", + "The government incurs social costs $ \\frac{c}{2} \\mu_t^2 $ at\n", "$ t $ when it changes the stock of nominal money\n", "balances at rate $ \\mu_t $.\n", "\n", @@ -323,7 +320,7 @@ "\n", "\n", "$$\n", - "-s(\\theta_t, \\mu_t) \\equiv - r(x_t,\\mu_t) = \\begin{bmatrix} 1 \\\\ \\theta_t \\end{bmatrix}' \\begin{bmatrix} u_0 & -\\frac{u_1 \\alpha}{2} \\\\ -\\frac{u_1 \\alpha}{2} & -\\frac{u_2 \\alpha^2}{2} \\end{bmatrix} \\begin{bmatrix} 1 \\\\ \\theta_t \\end{bmatrix} - \\frac{c}{2} \\mu_t^2 = - x_t'Rx_t - Q \\mu_t^2 \\tag{43.10}\n", + "s(\\theta_t, \\mu_t) := - r(x_t,\\mu_t) = \\begin{bmatrix} 1 \\\\ \\theta_t \\end{bmatrix}' \\begin{bmatrix} u_0 & -\\frac{u_1 \\alpha}{2} \\\\ -\\frac{u_1 \\alpha}{2} & -\\frac{u_2 \\alpha^2}{2} \\end{bmatrix} \\begin{bmatrix} 1 \\\\ \\theta_t \\end{bmatrix} - \\frac{c}{2} \\mu_t^2 = - x_t'Rx_t - Q \\mu_t^2 \\tag{43.10}\n", "$$\n", "\n", "The government’s time $ 0 $ value is\n", @@ -331,26 +328,33 @@ "\n", "\n", "$$\n", - "v_0 = - \\sum_{t=0}^\\infty \\beta^t r(x_t,\\mu_t) = - \\sum_{t=0}^\\infty \\beta^t s(\\theta_t,\\mu_t) \\tag{43.11}\n", + "v_0 = - \\sum_{t=0}^\\infty \\beta^t r(x_t,\\mu_t) = \\sum_{t=0}^\\infty \\beta^t s(\\theta_t,\\mu_t) \\tag{43.11}\n", "$$\n", "\n", "where $ \\beta \\in (0,1) $ is a discount factor.\n", "\n", + ">**Note**\n", + ">\n", + ">We define $ r(x_t,\\mu_t) := - s(\\theta_t, \\mu_t) $ in order to represent the government’s **maximization** problem in terms of our Python code for solving linear quadratic discounted dynamic programs.\n", + "In [first LQ control lecture](https://python-intro.quantecon.org/lqcontrol.html) and some other quantecon lectures, we formulated these as **loss minimization** problems.\n", + "\n", "The government’s time $ t $ continuation value $ v_t $ is\n", "\n", + "\n", + "\n", "$$\n", - "v_t = - \\sum_{j=0}^\\infty \\beta^j s(\\theta_{t+j}, \\mu_{t+j}) .\n", + "v_t = \\sum_{j=0}^\\infty \\beta^j s(\\theta_{t+j}, \\mu_{t+j}) . \\tag{43.12}\n", "$$\n", "\n", - "We can represent dependence of $ v_0 $ on $ (\\vec \\theta, \\vec \\mu) $ recursively via the difference equation\n", + "We can represent dependence of $ v_0 $ on $ (\\vec \\theta, \\vec \\mu) $ recursively via the difference equation\n", "\n", "\n", "\n", "$$\n", - "v_t = - s(\\theta_t, \\mu_t) + \\beta v_{t+1} \\tag{43.12}\n", + "v_t = s(\\theta_t, \\mu_t) + \\beta v_{t+1} \\tag{43.13}\n", "$$\n", "\n", - "It is useful to evaluate [(43.12)](#equation-eq-old8) under a time-invariant money growth rate $ \\mu_t = \\bar \\mu $\n", + "It is useful to evaluate [(43.13)](#equation-eq-old8) under a time-invariant money growth rate $ \\mu_t = \\bar \\mu $\n", "that according to equation [(43.3)](#equation-eq-old3) would bring forth a constant inflation rate equal to $ \\bar \\mu $.\n", "\n", "Under that policy,\n", @@ -358,14 +362,14 @@ "\n", "\n", "$$\n", - "v_t = V(\\bar \\mu) = - \\frac{s(\\bar \\mu, \\bar \\mu)}{1-\\beta} \\tag{43.13}\n", + "v_t = V(\\bar \\mu) = \\frac{s(\\bar \\mu, \\bar \\mu)}{1-\\beta} \\tag{43.14}\n", "$$\n", "\n", "for all $ t \\geq 0 $.\n", "\n", - "Values of $ V(\\bar \\mu) $ computed according to formula [(43.13)](#equation-eq-barvdef) for three different values of $ \\bar \\mu $ will play important roles below.\n", + "Values of $ V(\\bar \\mu) $ computed according to formula [(43.14)](#equation-eq-barvdef) for three different values of $ \\bar \\mu $ will play important roles below.\n", "\n", - "- $ V(\\mu^{MP}) $ is the value of attained by the government in a **Markov perfect equilibrium** \n", + "- $ V(\\mu^{MPE}) $ is the value of attained by the government in a **Markov perfect equilibrium** \n", "- $ V(\\mu^R_\\infty) $ is the value that a continuation Ramsey planner attains at $ t \\rightarrow +\\infty $ \n", " - We shall discover that $ V(\\mu^R_\\infty) $ is the worst continuation value attained along a Ramsey plan \n", "- $ V(\\mu^{CR}) $ is the value of attained by the government in a **constrained to constant $ \\mu $ equilibrium** " @@ -373,7 +377,7 @@ }, { "cell_type": "markdown", - "id": "13634cb0", + "id": "917bda90", "metadata": {}, "source": [ "## Structure\n", @@ -385,18 +389,9 @@ "$ \\vec \\mu =\\{\\mu_t\\}_{t=0}^\\infty \\in L^2 $ into an inflation sequence\n", "$ \\vec \\theta = \\{\\theta_t\\}_{t=0}^\\infty \\in L^2 $.\n", "\n", - "These, in turn, induce a discounted value to a government sequence\n", - "$ \\vec v = \\{v_t\\}_{t=0}^\\infty \\in L^2 $ that satisfies the\n", - "recursion\n", - "\n", - "\n", - "\n", - "$$\n", - "v_t = - s(\\theta_t,\\mu_t) + \\beta v_{t+1} \\tag{43.14}\n", - "$$\n", - "\n", - "where we have called $ s(\\theta_t, \\mu_t) = r(x_t, \\mu_t) $, as\n", - "in [(43.11)](#equation-eq-old7).\n", + "These in turn induce a discounted value to a government sequence\n", + "$ \\vec v = \\{v_t\\}_{t=0}^\\infty \\in L^2 $ that satisfies\n", + "recursion [(43.13)](#equation-eq-old8).\n", "\n", "Thus, a triple of sequences\n", "$ (\\vec \\mu, \\vec \\theta, \\vec v) $ depends on a\n", @@ -405,12 +400,12 @@ "At this point $ \\vec \\mu \\in L^2 $ is an arbitrary exogenous policy.\n", "\n", "A theory of government\n", - "decisions will make $ \\vec \\mu $ endogenous, i.e., a theoretical *output* instead of an *input*." + "decisions will make $ \\vec \\mu $ endogenous, i.e., a theoretical **output** instead of an **input**." ] }, { "cell_type": "markdown", - "id": "7ac79272", + "id": "77f15cee", "metadata": {}, "source": [ "### Intertemporal Aspects\n", @@ -438,7 +433,7 @@ }, { "cell_type": "markdown", - "id": "0c8a8726", + "id": "c6129e0e", "metadata": {}, "source": [ "## Three Timing Protocols\n", @@ -447,7 +442,7 @@ "\n", "- *what* a policymaker chooses, either a sequence\n", " $ \\vec \\mu $ or just $ \\mu_t $ in a single period $ t $. \n", - "- *when* a policymaker chooses, either once and for all at time $ 0 $, or at some time or times $ t \\geq 0 $. \n", + "- *when* a policymaker chooses, either once and for all at time $ 0 $, or at one or more times $ t \\geq 0 $. \n", "- what a policymaker *assumes* about how its choice of $ \\mu_t $\n", " affects the representative agent’s expectations about earlier and later\n", " inflation rates. \n", @@ -460,8 +455,8 @@ "- these two models thus employ a **Ramsey** or **Stackelberg** timing protocol. \n", "\n", "\n", - "In a third model, there is a sequence of policymakers, each of whom\n", - "sets $ \\mu_t $ at one $ t $ only.\n", + "In a third model, there is a sequence of policymaker indexed by $ t \\in \\{0, 1, \\ldots\\} $, each of whom\n", + "sets only $ \\mu_t $.\n", "\n", "- a time $ t $ policymaker cares only about $ v_t $ and ignores effects that its choice of $ \\mu_t $ has on $ v_s $ at dates $ s = 0, 1, \\ldots, t-1 $. \n", "\n", @@ -485,21 +480,21 @@ "\n", "The first model describes a **Ramsey plan** chosen by a **Ramsey planner**\n", "\n", - "The second model describes a **Ramsey plan** chosen by a *Ramsey planner constrained to choose a time-invariant $ \\mu_t $*\n", + "The second model describes a **Ramsey plan** chosen by a **Ramsey planner constrained to choose a time-invariant $ \\mu $**\n", "\n", "The third model describes a **Markov perfect equilibrium**\n", "\n", ">**Note**\n", ">\n", - ">In the quantecon lecture [Sustainable Plans for a Calvo Model](https://python-advanced.quantecon.org/calvo_abreu.html), we’ll study outcomes under another timing protocol in where there is a sequence of separate policymakers and a time $ t $ policymaker chooses only $ \\mu_t $ but believes that its choice of $ \\mu_t $ shapes the representative agent’s beliefs about future rates of money creation and inflation, and through them, future government actions.\n", - "This is a model of a **credible government policy** also known as a **sustainable plan**.\n", + ">In the quantecon lecture [Sustainable Plans for a Calvo Model](https://python-advanced.quantecon.org/calvo_abreu.html), we’ll study outcomes under another timing protocol in which there is a sequence of separate policymakers. A time $ t $ policymaker chooses only $ \\mu_t $ but believes that its choice of $ \\mu_t $ shapes the representative agent’s beliefs about future rates of money creation and inflation, and through them, future government actions.\n", + "This is a model of a **credible government policy**, also called a **sustainable plan**.\n", "The relationship between outcomes in the first (Ramsey) timing protocol and the [Sustainable Plans for a Calvo Model](https://python-advanced.quantecon.org/calvo_abreu.html) timing protocol and belief structure is the subject of a literature on **sustainable** or **credible** public policies (Chari and Kehoe [[Chari and Kehoe, 1990](https://python-advanced.quantecon.org/zreferences.html#id219)]\n", "[[Stokey, 1989](https://python-advanced.quantecon.org/zreferences.html#id226)], and Stokey [[Stokey, 1991](https://python-advanced.quantecon.org/zreferences.html#id78)])." ] }, { "cell_type": "markdown", - "id": "eb2c4299", + "id": "d2e0ceb6", "metadata": {}, "source": [ "## Note on Dynamic Programming Squared\n", @@ -509,7 +504,7 @@ "\n", "The nickname refers to the feature that a value satisfying one Bellman equation appears as an argument in a value function associated with a second Bellman equation.\n", "\n", - "Thus, our models have involved two Bellman equations:\n", + "Thus, two Bellman equations appear:\n", "\n", "- equation [(43.1)](#equation-eq-old1) expresses how $ \\theta_t $ depends on $ \\mu_t $\n", " and $ \\theta_{t+1} $ \n", @@ -522,34 +517,36 @@ }, { "cell_type": "markdown", - "id": "27c2a0cf", + "id": "c0dc6f22", "metadata": {}, "source": [ "## A Ramsey Planner\n", "\n", - "Here we consider a Ramsey planner that chooses\n", + "A Ramsey planner chooses\n", "$ \\{\\mu_t, \\theta_t\\}_{t=0}^\\infty $ to maximize [(43.11)](#equation-eq-old7)\n", "subject to the law of motion [(43.5)](#equation-eq-old4).\n", "\n", - "We can split this problem into two stages, as in the lecture [Stackelberg plans](https://python-advanced.quantecon.org/dyn_stack.html) and [[Ljungqvist and Sargent, 2018](https://python-advanced.quantecon.org/zreferences.html#id176)] Chapter 19.\n", + "We split this problem into two stages, as in the lecture [Stackelberg plans](https://python-advanced.quantecon.org/dyn_stack.html) and [[Ljungqvist and Sargent, 2018](https://python-advanced.quantecon.org/zreferences.html#id176)] Chapter 19.\n", "\n", "In the first stage, we take the initial inflation rate $ \\theta_0 $ as given\n", - "and solve what looks like an ordinary LQ discounted dynamic programming problem.\n", + "and pose an ordinary discounted dynamic programming problem that in our setting becomes an LQ discounted dynamic programming problem.\n", "\n", "In the second stage, we choose an optimal initial inflation rate $ \\theta_0 $.\n", "\n", "Define a feasible set of\n", - "$ (\\overrightarrow x_1, \\overrightarrow \\mu_0) $ sequences, both of which must belong to $ L^2 $:\n", + "$ \\{x_{t+1}, \\mu_t \\}_{t=0}^\\infty $ sequences, with each sequence belonging to $ L^2 $:\n", "\n", "$$\n", - "\\Omega(x_0) = \\left \\lbrace ( \\overrightarrow x_1, \\overrightarrow \\mu_0) : x_{t+1}\n", - "= A x_t + B \\mu_t \\: , \\: \\forall t \\geq 0; (\\vec x_1, \\vec \\mu_0) \\in L^2 \\times L^2 \\right \\rbrace\n", - "$$" + "\\Omega(x_0) = \\{x_{t+1}, \\mu_t \\}_{t=0}^\\infty : x_{t+1}\n", + "= A x_t + B \\mu_t \\: , \\: \\forall t \\geq 0 ,\n", + "$$\n", + "\n", + "where we require that $ \\{x_{t+1}, \\mu_t \\}_{t=0}^\\infty \\in L^2 \\times L^2 . $" ] }, { "cell_type": "markdown", - "id": "0ff7c5d7", + "id": "67caf995", "metadata": {}, "source": [ "### Subproblem 1\n", @@ -559,14 +556,14 @@ "\n", "\n", "$$\n", - "J(x_0) = \\max_{(\\overrightarrow x_1, \\overrightarrow \\mu_0) \\in \\Omega(x_0)}\n", - "- \\sum_{t=0}^\\infty \\beta^t r(x_t,\\mu_t) \\tag{43.15}\n", + "J(x_0) = \\max_{\\{x_{t+1}, \\mu_t \\}_{t=0}^\\infty \\in \\Omega(x_0)}\n", + "\\sum_{t=0}^\\infty \\beta^t s(x_t,\\mu_t) \\tag{43.15}\n", "$$\n", "\n", "satisfies the Bellman equation\n", "\n", "$$\n", - "J(x) = \\max_{\\mu,x'}\\{-r(x,\\mu) + \\beta J(x')\\}\n", + "J(x) = \\max_{\\mu,x'}\\{s(x,\\mu) + \\beta J(x')\\}\n", "$$\n", "\n", "subject to:\n", @@ -651,7 +648,7 @@ "\\theta_{t+1} = d_0 + d_1 \\theta_t \\tag{43.19}\n", "$$\n", "\n", - "where $ \\begin{bmatrix} d_0 & d_1 \\end{bmatrix} $ is the second row of\n", + "where $ \\big[\\ d_0 \\ \\ d_1 \\ \\big] $ is the second row of\n", "the closed-loop matrix $ A - BF $ for computed in subproblem 1 above.\n", "\n", "The linear quadratic control problem [(43.15)](#equation-eq-subprob1lq) satisfies regularity conditions that\n", @@ -675,7 +672,7 @@ }, { "cell_type": "markdown", - "id": "784a27af", + "id": "baf14de7", "metadata": {}, "source": [ "### Subproblem 2\n", @@ -683,15 +680,20 @@ "The value of the Ramsey problem is\n", "\n", "$$\n", - "V^R = \\max_{\\theta} J(\\theta)\n", + "V^R = \\max_{x_0} J(x_0)\n", "$$\n", "\n", - "where $ V^R $ is the maximum value of $ v_0 $ defined in equation [(43.11)](#equation-eq-old7).\n", + "We abuse notation slightly by writing $ J(x) $ as $ J(\\theta) $ and rewrite the above equation as\n", "\n", - "We have taken the liberty of abusing notation slightly by writing $ J(x) $ as $ J(\\theta) $\n", + ">**Note**\n", + ">\n", + ">Since $ x = \\begin{bmatrix} 1 \\cr \\theta \\end{bmatrix} $, it follows that $ \\theta $ is the only component of $ x $ that can possibly vary.\n", "\n", - "- notice that $ x = \\begin{bmatrix} 1 \\cr \\theta \\end{bmatrix} $, so $ \\theta $ is the only component of $ x $ that can possibly vary \n", + "$$\n", + "V^R = \\max_{\\theta_0} J(\\theta_0)\n", + "$$\n", "\n", + "Evidently, $ V^R $ is the maximum value of $ v_0 $ defined in equation [(43.11)](#equation-eq-old7).\n", "\n", "Value function $ J(\\theta_0) $ satisfies\n", "\n", @@ -699,7 +701,7 @@ "J(\\theta_0) = -\\begin{bmatrix} 1 & \\theta_0 \\end{bmatrix} \\begin{bmatrix} P_{11} & P_{12} \\\\ P_{21} & P_{22} \\end{bmatrix} \\begin{bmatrix} 1 \\\\ \\theta_0 \\end{bmatrix} = -P_{11} - 2 P_{21} \\theta_0 - P_{22} \\theta_0^2\n", "$$\n", "\n", - "Maximizing $ J(\\theta_0) $ with respect to $ \\theta_0 $ yields the FOC:\n", + "The first-order necessary condition for maximizing $ J(\\theta_0) $ with respect to $ \\theta_0 $ is\n", "\n", "$$\n", "- 2 P_{21} - 2 P_{22} \\theta_0 =0\n", @@ -714,7 +716,7 @@ }, { "cell_type": "markdown", - "id": "b272e29c", + "id": "8b305988", "metadata": {}, "source": [ "## Representation of Ramsey Plan\n", @@ -762,7 +764,7 @@ "\\theta_t = d_0 \\left(\\frac{1 - d_1^t}{1 - d_1} \\right) + d_1^t \\theta_0^R , \\tag{43.22}\n", "$$\n", "\n", - "Because $ d_1 \\in (0,1) $, it follows from [(43.22)](#equation-eq-thetatimeinconsist) that as $ t \\to \\infty $ $ \\theta_t^R $ converges to\n", + "Because $ d_1 \\in (0,1) $, it follows from [(43.22)](#equation-eq-thetatimeinconsist) that as $ t \\to \\infty $, $ \\theta_t^R $ converges to\n", "\n", "\n", "\n", @@ -791,12 +793,12 @@ }, { "cell_type": "markdown", - "id": "78e27b80", + "id": "1020a072", "metadata": {}, "source": [ "## Multiple roles of $ \\theta_t $\n", "\n", - "The inflation rate $ \\theta_t $ plays three roles simultaneously:\n", + "The inflation rate $ \\theta_t $ plays three roles:\n", "\n", "- In equation [(43.3)](#equation-eq-old3), $ \\theta_t $ is the actual rate of inflation\n", " between $ t $ and $ t+1 $. \n", @@ -807,13 +809,15 @@ "\n", "\n", "That the same variable $ \\theta_t $ takes on these multiple roles brings insights about\n", - "commitment and forward guidance, about whether the government follows or leads the market, and\n", - "about dynamic or time inconsistency." + "\n", + "- whether the government follows or leads the market, \n", + "- forward guidance, and \n", + "- inflation targeting. " ] }, { "cell_type": "markdown", - "id": "09de2294", + "id": "c3e29f95", "metadata": {}, "source": [ "## Time inconsistency\n", @@ -822,45 +826,41 @@ "\n", "This is a concise way of characterizing the time inconsistency of a Ramsey plan.\n", "\n", - "The time inconsistency of a Ramsey plan has motivated other models of government decision making\n", - "that, relative to a Ramsey plan, alter either\n", + "In the present context, a symptom of time inconsistency is that the Ramsey plannner\n", + "chooses to make $ \\mu_t $ a non-constant function of time $ t $ despite the fact that, other than\n", + "time itself, there is no other state variable.\n", "\n", - "- the timing protocol and/or \n", - "- assumptions about how government decision makers think their decisions affect the representative agent’s beliefs about future government decisions " + "Thus, in our context, time-variation of $ \\vec \\mu $ chosen by a Ramsey planner\n", + "is the telltale sign of the Ramsey plan’s **time inconsistency**." ] }, { "cell_type": "markdown", - "id": "fc0aa902", + "id": "caaa913d", "metadata": {}, "source": [ "## Constrained-to-Constant-Growth-Rate Ramsey Plan\n", "\n", - "We now describe a model in which we restrict the Ramsey planner’s choice set.\n", - "\n", - "Instead of choosing a sequence of money growth rates $ \\vec \\mu \\in {\\bf L}^2 $, we restrict the\n", - "government to choose a time-invariant money growth rate $ \\bar \\mu $.\n", + "We can use brute force to create a government plan that **is** time consistent, i.e., that is a time-invariant function of time.\n", "\n", - "We created this version of the model to highlight an aspect of a Ramsey plan associated with its time inconsistency, namely, the feature that optimal settings of the policy instrument vary over time.\n", + "We simply constrain a planner to choose a time-invariant money growth rate $ \\bar \\mu $ so that\n", "\n", - "Thus, instead of allowing the government at time $ 0 $ to choose a different $ \\mu_t $ for each $ t \\geq 0 $, we now assume that a government at time $ 0 $ once and for all chooses a *constant* sequence $ \\mu_t = \\bar \\mu $ for all $ t \\geq 0 $.\n", + "$$\n", + "\\mu_t = \\bar \\mu, \\quad \\forall t \\geq 0.\n", + "$$\n", "\n", "We assume that the government knows the perfect foresight outcome implied by equation [(43.2)](#equation-eq-old2) that $ \\theta_t = \\bar \\mu $ when $ \\mu_t = \\bar \\mu $ for all $ t \\geq 0 $.\n", "\n", - "The government chooses $ \\bar \\mu $ to maximize\n", + "It follows that the value of such a plan is given by $ V(\\bar \\mu) $ defined inequation [(43.14)](#equation-eq-barvdef).\n", "\n", - "$$\n", - "V^{CR}(\\bar \\mu) = V(\\bar \\mu)\n", - "$$\n", - "\n", - "where $ V(\\bar \\mu) $ is defined in equation [(43.13)](#equation-eq-barvdef).\n", + "Then our restricted Ramsey planner chooses $ \\bar \\mu $ to maximize $ V(\\bar \\mu) $.\n", "\n", - "We can express $ V^{CR}(\\bar \\mu) $ as\n", + "We can express $ V(\\bar \\mu) $ as\n", "\n", "\n", "\n", "$$\n", - "V^{CR} (\\bar \\mu) = (1-\\beta)^{-1} \\left[ U (-\\alpha \\bar \\mu) - \\frac{c}{2} (\\bar \\mu)^2 \\right] \\tag{43.25}\n", + "V (\\bar \\mu) = (1-\\beta)^{-1} \\left[ U (-\\alpha \\bar \\mu) - \\frac{c}{2} (\\bar \\mu)^2 \\right] \\tag{43.25}\n", "$$\n", "\n", "With the quadratic form [(43.6)](#equation-eq-old5) for the utility function $ U $, the\n", @@ -869,7 +869,7 @@ "\n", "\n", "$$\n", - "\\mu^{CR} = - \\frac{\\alpha u_1}{\\alpha^2 u_2 + c } \\tag{43.26}\n", + "\\mu^{CR} = \\max_{\\bar \\mu} V (\\bar \\mu) = - \\frac{\\alpha u_1}{\\alpha^2 u_2 + c } \\tag{43.26}\n", "$$\n", "\n", "The optimal value attained by a *constrained to constant $ \\mu $* Ramsey planner is\n", @@ -877,24 +877,27 @@ "\n", "\n", "$$\n", - "V^{CR}(\\mu^{CR}) = v^{CR} = (1-\\beta)^{-1} \\left[ U (-\\alpha \\mu^{CR}) - \\frac{c}{2} (\\mu^{CR})^2 \\right] \\tag{43.27}\n", + "V(\\mu^{CR}) \\equiv V^{CR} = (1-\\beta)^{-1} \\left[ U (-\\alpha \\mu^{CR}) - \\frac{c}{2} (\\mu^{CR})^2 \\right] \\tag{43.27}\n", "$$\n", "\n", - "**Remark:** We have introduced the constrained-to-constant $ \\mu $\n", - "government in order eventually to highlight the time-variation of\n", - "$ \\mu_t $ that is a telltale sign of a Ramsey plan’s **time inconsistency**." + "Time-variation of $ \\vec \\mu $ chosen by a Ramsey planner\n", + "is the telltale sign of the Ramsey plan’s **time inconsistency**.\n", + "\n", + "Obviously, our constrained-to-constant $ \\mu $\n", + "Ramsey planner **must** must choose a plan that is time consistent." ] }, { "cell_type": "markdown", - "id": "52ace2d2", + "id": "f76791f3", "metadata": {}, "source": [ "## Markov Perfect Governments\n", "\n", - "We now describe yet another timing protocol.\n", + "To generate an alternative model of time-consistent government decision making,\n", + "we assume another timing protocol.\n", "\n", - "In this one, there is a sequence of government policymakers.\n", + "In this one, there is a sequence of government policymakers.\n", "\n", "A time $ t $ government chooses $ \\mu_t $ and expects all future governments to set\n", "$ \\mu_{t+j} = \\bar \\mu $.\n", @@ -921,11 +924,11 @@ "\n", "\n", "$$\n", - "Q(\\mu_t, \\bar \\mu) = U(-\\alpha \\theta_t) - \\frac{c}{2} \\mu_t^2 + \\beta V(\\bar \\mu) \\tag{43.29}\n", + "H(\\mu_t, \\bar \\mu) = U(-\\alpha \\theta_t) - \\frac{c}{2} \\mu_t^2 + \\beta V(\\bar \\mu) \\tag{43.29}\n", "$$\n", "\n", - "where $ V(\\bar \\mu) $ is given by formula [(43.13)](#equation-eq-barvdef) for the time $ 0 $ value $ v_0 $ of\n", - "recursion [(43.12)](#equation-eq-old8) under a money supply growth rate that is forever constant\n", + "where $ V(\\bar \\mu) $ is given by formula [(43.14)](#equation-eq-barvdef) for the time $ 0 $ value $ v_0 $ of\n", + "recursion [(43.13)](#equation-eq-old8) under a money supply growth rate that is forever constant\n", "at $ \\bar \\mu $.\n", "\n", "Substituting [(43.28)](#equation-eq-markov2) into [(43.29)](#equation-eq-markov3) and expanding gives:\n", @@ -934,12 +937,12 @@ "\n", "$$\n", "\\begin{aligned}\n", - "Q(\\mu_t, \\bar \\mu) & = u_0 + u_1\\left(-\\frac{\\alpha^2}{1+\\alpha} \\bar \\mu - \\frac{\\alpha}{1+\\alpha} \\mu_t\\right) - \\frac{u_2}{2}\\left(-\\frac{\\alpha^2}{1+\\alpha} \\bar \\mu - \\frac{\\alpha}{1+\\alpha} \\mu_t\\right)^2 \\\\ \n", + "H(\\mu_t, \\bar \\mu) & = u_0 + u_1\\left(-\\frac{\\alpha^2}{1+\\alpha} \\bar \\mu - \\frac{\\alpha}{1+\\alpha} \\mu_t\\right) - \\frac{u_2}{2}\\left(-\\frac{\\alpha^2}{1+\\alpha} \\bar \\mu - \\frac{\\alpha}{1+\\alpha} \\mu_t\\right)^2 \\\\ \n", "& \\quad \\quad \\quad - \\frac{c}{2} \\mu_t^2 + \\beta V(\\bar \\mu)\n", "\\end{aligned} \\tag{43.30}\n", "$$\n", "\n", - "The first-order necessary condition for maximing $ Q(\\mu_t, \\bar \\mu) $ with respect to $ \\mu_t $ is:\n", + "The first-order necessary condition for maximizing $ H(\\mu_t, \\bar \\mu) $ with respect to $ \\mu_t $ is:\n", "\n", "$$\n", "- \\frac{\\alpha}{1+\\alpha} u_1 - u_2(-\\frac{\\alpha^2}{1+\\alpha} \\bar \\mu - \\frac{\\alpha}{1+\\alpha} \\mu_t)(- \\frac{\\alpha}{1+\\alpha}) - c \\mu_t = 0\n", @@ -982,7 +985,7 @@ "\n", "\n", "$$\n", - "V^{MPE} = -\\frac{s(\\mu^{MPE}, \\mu^{MPE})}{1-\\beta} \\tag{43.32}\n", + "V^{MPE} = \\frac{s(\\mu^{MPE}, \\mu^{MPE})}{1-\\beta} \\tag{43.32}\n", "$$\n", "\n", "or\n", @@ -991,7 +994,7 @@ "V^{MPE} = V(\\mu^{MPE})\n", "$$\n", "\n", - "where $ V(\\cdot) $ is given by formula [(43.13)](#equation-eq-barvdef).\n", + "where $ V(\\cdot) $ is given by formula [(43.14)](#equation-eq-barvdef).\n", "\n", "Under the Markov perfect timing protocol\n", "\n", @@ -1005,16 +1008,16 @@ }, { "cell_type": "markdown", - "id": "2e3bc019", + "id": "50da87f4", "metadata": {}, "source": [ "## Outcomes under Three Timing Protocols\n", "\n", - "We want to compare outcome sequences $ \\{ \\theta_t,\\mu_t \\} $ under three timing protocols associated with\n", + "We want to compare outcome sequences $ \\{ \\theta_t,\\mu_t \\} $ under three timing protocols associated with\n", "\n", - "- a standard Ramsey plan with its time varying $ \\{ \\theta_t,\\mu_t \\} $ sequences \n", - "- a Markov perfect equilibrium \n", - "- our nonstandard Ramsey plan in which the planner is restricted to choose a time-invariant $ \\mu_t = \\mu $ for all $ t \\geq 0 $. \n", + "- a standard Ramsey plan with its time-varying $ \\{ \\theta_t,\\mu_t \\} $ sequences \n", + "- a Markov perfect equilibrium, with its time-invariant $ \\{ \\theta_t,\\mu_t \\} $ sequences \n", + "- a nonstandard Ramsey plan in which the planner is restricted to choose a time-invariant $ \\mu_t = \\mu $ for all $ t \\geq 0 $. \n", "\n", "\n", "We have computed closed form formulas for several of these outcomes, which we find it convenient to repeat here.\n", @@ -1045,7 +1048,7 @@ "\n", "We’ll illustrate the third equality that equates $ \\theta_0^R $ to $ \\theta_\\infty^R $ with some quantitative examples below.\n", "\n", - "Proposition 1 draws attention to how a positive tax distortion parameter $ c $ alters the optimal rate of deflation that Milton Friedman financed by imposing a lump sum tax.\n", + "Proposition 1 draws attention to how a positive tax distortion parameter $ c $ alters the optimal rate of deflation that Milton Friedman financed by imposing a lump sum tax.\n", "\n", "We’ll compute\n", "\n", @@ -1061,7 +1064,7 @@ { "cell_type": "code", "execution_count": null, - "id": "668ddf8b", + "id": "bf8b9dd5", "metadata": { "hide-output": false }, @@ -1182,7 +1185,7 @@ }, { "cell_type": "markdown", - "id": "5c46de9f", + "id": "052d6643", "metadata": {}, "source": [ "Let’s create an instance of ChangLQ with the following parameters:" @@ -1191,7 +1194,7 @@ { "cell_type": "code", "execution_count": null, - "id": "17b6608b", + "id": "fb293eba", "metadata": { "hide-output": false }, @@ -1202,17 +1205,17 @@ }, { "cell_type": "markdown", - "id": "009dc024", + "id": "798f1a4c", "metadata": {}, "source": [ - "The following code plots value functions for a continuation Ramsey\n", + "The following code plots policy functions for a continuation Ramsey\n", "planner." ] }, { "cell_type": "code", "execution_count": null, - "id": "cde31259", + "id": "2f4e41ac", "metadata": { "hide-output": false }, @@ -1282,7 +1285,7 @@ }, { "cell_type": "markdown", - "id": "5cb94521", + "id": "c0092b46", "metadata": {}, "source": [ "The dotted line in the above graph is the 45-degree line.\n", @@ -1305,18 +1308,19 @@ "\n", "It follows that under the Ramsey plan $ \\{\\theta_t\\} $ and $ \\{\\mu_t\\} $ both converge monotonically from above to $ \\theta_\\infty^R $.\n", "\n", - "The next code plots the Ramsey planner’s value function $ J(\\theta) $, which we know is maximized at $ \\theta^R_0 $, the promised inflation that the Ramsey planner sets\n", - "at time $ t=0 $.\n", + "The next code plots the Ramsey planner’s value function $ J(\\theta) $.\n", + "\n", + "We know that $ J (\\theta) $ is maximized at $ \\theta^R_0 $, the best time $ 0 $ promised inflation rate.\n", "\n", - "The figure also plots the limiting value $ \\theta_\\infty^R $ to which the promised inflation rate $ \\theta_t $ converges under the Ramsey plan.\n", + "The figure also plots the limiting value $ \\theta_\\infty^R $, the limiting value of promised inflation rate $ \\theta_t $ under the Ramsey plan as $ t \\rightarrow +\\infty $.\n", "\n", - "In addition, the figure indicates an MPE inflation rate $ \\theta^{MPE} $, $ \\theta^{CR} $, and a bliss inflation $ \\theta^* $." + "The figure also indicates an MPE inflation rate $ \\theta^{MPE} $, the inflation $ \\theta^{CR} $ under a Ramsey plan constrained to a constant money creation rate, and a bliss inflation $ \\theta^* $." ] }, { "cell_type": "code", "execution_count": null, - "id": "9d58f618", + "id": "039c295b", "metadata": { "hide-output": false }, @@ -1357,10 +1361,15 @@ }, { "cell_type": "markdown", - "id": "7f63482e", + "id": "a866ab92", "metadata": {}, "source": [ - "In the above graph, notice that $ \\theta^* < \\theta_\\infty^R < \\theta^{CR} < \\theta_0^R < \\theta^{MPE} . $\n", + "In the above graph, notice that $ \\theta^* < \\theta_\\infty^R < \\theta^{CR} < \\theta_0^R < \\theta^{MPE} $:\n", + "\n", + "- $ \\theta_0^R < \\theta^{MPE} $: the initial Ramsey inflation rate exceeds the MPE inflation rate \n", + "- $ \\theta_\\infty^R < \\theta^{CR} <\\theta_0^R $: the initial Ramsey deflation rate, and the associated tax distortion cost $ c \\mu_0^2 $ is less than the limiting Ramsey inflation rate $ \\theta_\\infty^R $ and the associated tax distortion cost $ \\mu_\\infty^2 $ \n", + "- $ \\theta^* < \\theta^R_\\infty $: the limiting Ramsey inflation rate exceeds the bliss level of inflation \n", + "\n", "\n", "In some subsequent calculations, we’ll use our Python code to study how gaps between\n", "these outcome vary depending on parameters such as the cost parameter $ c $ and the discount factor $ \\beta $." @@ -1368,7 +1377,7 @@ }, { "cell_type": "markdown", - "id": "bb4e0495", + "id": "21f19c3b", "metadata": {}, "source": [ "## Ramsey Planner’s Value Function\n", @@ -1378,23 +1387,20 @@ "$ \\mu $.\n", "\n", "A time-invariant $ \\mu $ implies a time-invariant $ \\theta $, we take the liberty of\n", - "labeling this value function $ V^{CR}(\\theta) $.\n", + "labeling this value function $ V(\\theta) $.\n", "\n", - "We’ll use the code to plot $ J(\\theta) $ and $ V^{CR}(\\theta) $ for several values of the discount factor $ \\beta $ and the cost of $ \\mu_t^2 $ parameter $ c $.\n", + "We’ll use the code to plot $ J(\\theta) $ and $ V(\\theta) $ for several values of the discount factor $ \\beta $ and the cost parameter $ c $ that multiplies $ \\mu_t^2 $ in the Ramsey planner’s one-period payoff function.\n", "\n", "In all of the graphs below, we disarm the Proposition 1 equivalence results by setting $ c >0 $.\n", "\n", "The graphs reveal interesting relationships among $ \\theta $’s associated with various timing protocols:\n", "\n", - "- $ \\theta_0^R < \\theta^{MPE} $: the initial Ramsey inflation rate exceeds the MPE inflation rate \n", - "- $ \\theta_\\infty^R < \\theta^{CR} <\\theta_0^R $: the initial Ramsey deflation rate, and the associated tax distortion cost $ c \\mu_0^2 $ is less than the limiting Ramsey inflation rate $ \\theta_\\infty^R $ and the associated tax distortion cost $ \\mu_\\infty^2 $ \n", - "- $ \\theta^* < \\theta^R_\\infty $: the limiting Ramsey inflation rate exceeds the bliss level of inflation \n", - "- $ J(\\theta) \\geq V^{CR}(\\theta) $ \n", - "- $ J(\\theta_\\infty^R) = V^{CR}(\\theta_\\infty^R) $ \n", + "- $ J(\\theta) \\geq V(\\theta) $ \n", + "- $ J(\\theta_\\infty^R) = V(\\theta_\\infty^R) $ \n", "\n", "\n", "Before doing anything else, let’s write code to verify our claim that\n", - "$ J(\\theta_\\infty^R) = V^{CR}(\\theta_\\infty^R) $.\n", + "$ J(\\theta_\\infty^R) = V(\\theta_\\infty^R) $.\n", "\n", "Here is the code." ] @@ -1402,7 +1408,7 @@ { "cell_type": "code", "execution_count": null, - "id": "d5c230b5", + "id": "3c562a78", "metadata": { "hide-output": false }, @@ -1415,12 +1421,12 @@ }, { "cell_type": "markdown", - "id": "ff3a383b", + "id": "c6913628", "metadata": {}, "source": [ - "So our claim that $ J(\\theta_\\infty^R) = V^{CR}(\\theta_\\infty^R) $ is verified numerically.\n", + "So we have verified our claim that $ J(\\theta_\\infty^R) = V(\\theta_\\infty^R) $.\n", "\n", - "Since $ J(\\theta_\\infty^R) = V^{CR}(\\theta_\\infty^R) $ occurs at a tangency point at which\n", + "Since $ J(\\theta_\\infty^R) = V(\\theta_\\infty^R) $ occurs at a tangency point at which\n", "$ J(\\theta) $ is increasing in $ \\theta $, it follows that\n", "\n", "\n", @@ -1431,18 +1437,16 @@ "\n", "with strict inequality when $ c > 0 $.\n", "\n", - "Thus, the limiting continuation value of continuation Ramsey planners is worse that the\n", - "constant value attained by a constrained-to-constant $ \\mu_t $ Ramsey planner.\n", + "Thus, the value of the plan that sets the money growth rate $ \\mu_t = \\theta_\\infty^R $ for all $ t \\geq 0 $ is worse than the\n", + "value attained by a Ramsey planner who is constrained to set a constant $ \\mu_t $.\n", "\n", - "Now let’s write some code to plot outcomes under our three timing protocols.\n", - "\n", - "Then we’ll use the code to explore how key parameters affect outcomes." + "Now let’s write some code to plot outcomes under our three timing protocols." ] }, { "cell_type": "code", "execution_count": null, - "id": "6198803c", + "id": "91558602", "metadata": { "hide-output": false }, @@ -1456,21 +1460,21 @@ " \"\"\"\n", " \n", " # Calculate CR space range and bounds\n", - " min_CR, max_CR = min(clq.CR_space), max(clq.CR_space)\n", - " range_CR = max_CR - min_CR\n", - " l_CR, u_CR = min_CR - 0.05 * range_CR, max_CR + 0.05 * range_CR\n", + " min_J, max_J = min(clq.J_space), max(clq.J_space)\n", + " range_J = max_J - min_J\n", + " l_J, u_J = min_J - 0.05 * range_J, max_J + 0.05 * range_J\n", " \n", " # Set axis limits\n", " ax.set_xlim([clq.θ_LB, clq.θ_UB])\n", - " ax.set_ylim([l_CR, u_CR])\n", + " ax.set_ylim([l_J, u_J])\n", "\n", " # Plot J(θ) and v^CR(θ)\n", + " CR_line, = ax.plot(clq.θ_space, clq.CR_space, lw=2, label=r\"$V(\\theta)$\")\n", " J_line, = ax.plot(clq.θ_space, clq.J_space, lw=2, label=r\"$J(\\theta)$\")\n", - " CR_line, = ax.plot(clq.θ_space, clq.CR_space, lw=2, label=r\"$V^{CR}(\\theta)$\")\n", - "\n", + " \n", " # Mark key points\n", " θ_points, labels, θ_colors = compute_θs(clq)\n", - " markers = [ax.scatter(θ, l_CR + 0.02 * range_CR, 60, \n", + " markers = [ax.scatter(θ, l_J + 0.02 * range_J, 60, \n", " marker='v', label=label, color=color)\n", " for θ, label, color in zip(θ_points, labels, θ_colors)]\n", " \n", @@ -1495,6 +1499,8 @@ " axes is a list of Matplotlib axes\n", " \"\"\"\n", " line_handles, scatter_handles = {}, {}\n", + " \n", + " if not isinstance(clqs, list): clqs, axes = [clqs], [axes]\n", "\n", " for ax, clq in zip(axes, clqs):\n", " lines, markers = compare_ramsey_CR(clq, ax)\n", @@ -1553,47 +1559,86 @@ " display(Math(latex_code))" ] }, + { + "cell_type": "markdown", + "id": "4fe2c98a", + "metadata": {}, + "source": [ + "For some default parameter values, the next figure plots the Ramsey planner’s\n", + "continuation value function $ J(\\theta) $ (orange curve) and the restricted-to-constant-$ \\mu $ Ramsey\n", + "planner’s value function $ V(\\theta) $ (blue curve).\n", + "\n", + "The figure uses colored arrows to indicate locations of $ \\theta^*, \\theta_\\infty^R,\n", + "\\theta^{CR}, \\theta_0^R $, and $ \\theta^{MPE} $, ordered as they are from\n", + "left to right, on the $ \\theta $ axis." + ] + }, { "cell_type": "code", "execution_count": null, - "id": "caa54bb4", + "id": "a5c2e46e", "metadata": { "hide-output": false }, "outputs": [], "source": [ - "# Compare different β values\n", - "fig, axes = plt.subplots(1, 3, figsize=(12, 5))\n", - "β_values = [0.7, 0.8, 0.99]\n", + "fig, ax = plt.subplots()\n", + "plt_clqs(ChangLQ(β=0.8, c=2), ax)" + ] + }, + { + "cell_type": "markdown", + "id": "c9cb0ed3", + "metadata": {}, + "source": [ + "In the above figure, notice that\n", + "\n", + "- the orange $ J $ value function lies above the blue $ V $ value function except at $ \\theta = \\theta_\\infty^R $ \n", + "- the maximizer $ \\theta_0^R $ of $ J(\\theta) $ occurs at the top of the orange curve \n", + "- the maximizer $ \\theta^{CR} $ of $ V(\\theta) $ occurs at the top of the blue curve \n", + "- the “timeless perspective” inflation and money creation rate $ \\theta_\\infty^R $ occurs where $ J(\\theta) $ is tangent to $ V(\\theta) $ \n", + "- the Markov perfect inflation and money creation rate $ \\theta^{MPE} $ exceeds $ \\theta_0^R $. \n", + "- the value $ V(\\theta^{MPE}) $ of the Markov perfect rate of money creation rate $ \\theta^{MPE} $ is less than the value $ V(\\theta_\\infty^R) $ of the worst continuation Ramsey plan \n", + "- the continuation value $ J(\\theta^{MPE}) $ of the Markov perfect rate of money creation rate $ \\theta^{MPE} $ is greater than the value $ V(\\theta_\\infty^R) $ and of the continuation value $ J(\\theta_\\infty^R) $ of the worst continuation Ramsey plan " + ] + }, + { + "cell_type": "markdown", + "id": "5dd35e90", + "metadata": {}, + "source": [ + "## Perturbing Model Parameters\n", "\n", - "clqs = [ChangLQ(β=β, c=2) for β in β_values]\n", - "plt_clqs(clqs, axes)" + "Now let’s present some graphs that teach us how outcomes change when we assume different values of $ \\beta $" ] }, { "cell_type": "code", "execution_count": null, - "id": "fa23e405", + "id": "26cd43d7", "metadata": { "hide-output": false }, "outputs": [], "source": [ - "generate_table(clqs, dig=3)" + "# Compare different β values\n", + "fig, axes = plt.subplots(1, 3, figsize=(12, 5))\n", + "β_values = [0.7, 0.8, 0.99]\n", + "\n", + "clqs = [ChangLQ(β=β, c=2) for β in β_values]\n", + "plt_clqs(clqs, axes)" ] }, { "cell_type": "markdown", - "id": "685e9e96", + "id": "46b3a8e8", "metadata": {}, "source": [ - "The above graphs and table convey many useful things.\n", - "\n", "The horizontal dotted lines indicate values\n", "$ V(\\mu_\\infty^R), V(\\mu^{CR}), V(\\mu^{MPE}) $ of time-invariant money\n", "growth rates $ \\mu_\\infty^R, \\mu^{CR} $ and $ \\mu^{MPE} $, respectfully.\n", "\n", - "Notice how $ J(\\theta) $ and $ V^{CR}(\\theta) $ are tangent and increasing at\n", + "Notice how $ J(\\theta) $ and $ V(\\theta) $ are tangent and increasing at\n", "$ \\theta = \\theta_\\infty^R $, which implies that $ \\theta^{CR} > \\theta_\\infty^R $\n", "and $ J(\\theta^{CR}) > J(\\theta_\\infty^R) $.\n", "\n", @@ -1609,13 +1654,33 @@ "\\end{aligned}\n", "$$\n", "\n", + "The following table summarizes some outcomes." + ] + }, + { + "cell_type": "code", + "execution_count": null, + "id": "1b2e8013", + "metadata": { + "hide-output": false + }, + "outputs": [], + "source": [ + "generate_table(clqs, dig=3)" + ] + }, + { + "cell_type": "markdown", + "id": "bffda18c", + "metadata": {}, + "source": [ "But let’s see what happens when we change $ c $." ] }, { "cell_type": "code", "execution_count": null, - "id": "0bdf3aa0", + "id": "97380b73", "metadata": { "hide-output": false }, @@ -1632,7 +1697,7 @@ { "cell_type": "code", "execution_count": null, - "id": "04ea7354", + "id": "aa6e48f9", "metadata": { "hide-output": false }, @@ -1643,7 +1708,7 @@ }, { "cell_type": "markdown", - "id": "1e17bb37", + "id": "e42945f4", "metadata": {}, "source": [ "The above table and figures show how\n", @@ -1661,7 +1726,7 @@ { "cell_type": "code", "execution_count": null, - "id": "946d671d", + "id": "fb9c53a5", "metadata": { "hide-output": false }, @@ -1677,7 +1742,7 @@ }, { "cell_type": "markdown", - "id": "92437ee0", + "id": "92f6842d", "metadata": {}, "source": [ "The above graphs indicate that as $ c $ approaches zero, $ \\theta_\\infty^R, \\theta_0^R, \\theta^{CR} $,\n", @@ -1701,7 +1766,7 @@ { "cell_type": "code", "execution_count": null, - "id": "b37f3b9f", + "id": "be5867be", "metadata": { "hide-output": false }, @@ -1768,7 +1833,7 @@ { "cell_type": "code", "execution_count": null, - "id": "06f4db7b", + "id": "97fd0f4f", "metadata": { "hide-output": false }, @@ -1782,7 +1847,7 @@ }, { "cell_type": "markdown", - "id": "d750b602", + "id": "60a4037e", "metadata": {}, "source": [ "Notice how $ d_1 $ changes as we raise the discount factor parameter $ \\beta $.\n", @@ -1793,7 +1858,7 @@ { "cell_type": "code", "execution_count": null, - "id": "dd18932a", + "id": "b6190699", "metadata": { "hide-output": false }, @@ -1808,7 +1873,7 @@ }, { "cell_type": "markdown", - "id": "0f718504", + "id": "34521217", "metadata": {}, "source": [ "Evidently, increasing $ c $ causes the decay factor $ d_1 $ to increase.\n", @@ -1820,7 +1885,7 @@ { "cell_type": "code", "execution_count": null, - "id": "40bf9683", + "id": "f55d748d", "metadata": { "hide-output": false }, @@ -1835,7 +1900,7 @@ }, { "cell_type": "markdown", - "id": "b75eb091", + "id": "b254a11d", "metadata": {}, "source": [ "The above panels for an $ \\alpha = 4 $ setting indicate that $ \\alpha $ and $ c $ affect outcomes\n", @@ -1846,133 +1911,28 @@ }, { "cell_type": "markdown", - "id": "fce2f1e2", - "metadata": {}, - "source": [ - "### Time Inconsistency of Ramsey Plan\n", - "\n", - "The variation over time in $ \\vec \\mu $ chosen by the Ramsey planner\n", - "is a symptom of time inconsistency.\n", - "\n", - "- The Ramsey planner reaps immediate benefits from promising lower\n", - " inflation later to be achieved by costly distorting taxes. \n", - "- These benefits are intermediated by reductions in expected inflation\n", - " that precede the reductions in money creation rates that rationalize them, as indicated by\n", - " equation [(43.3)](#equation-eq-old3). \n", - "- A government authority offered the opportunity to ignore effects on\n", - " past utilities and to reoptimize at date $ t \\geq 1 $ would, if allowed, want\n", - " to deviate from a Ramsey plan. \n", - "\n", - "\n", - ">**Note**\n", - ">\n", - ">A constrained-to-constant-$ \\mu $ Ramsey plan is time consistent by construction. So is a Markov perfect plan." - ] - }, - { - "cell_type": "markdown", - "id": "99b99e2c", + "id": "2007cd09", "metadata": {}, "source": [ "### Implausibility of Ramsey Plan\n", "\n", - "Many economists regard a time inconsistent plan as implausible because they question the plausibility of timing protocol in\n", - "which a plan for setting a sequence of policy variables is chosen once-and-for-all at time $ 0 $.\n", + "Many economists regard a time inconsistent plan as implausible because they question the plausibility of timing protocol in which a plan for setting a sequence of policy variables is chosen once-and-for-all at time $ 0 $.\n", "\n", "For that reason, the Markov perfect equilibrium concept attracts many\n", "economists.\n", "\n", - "- A Markov perfect equilibrium plan is constructed to insure that a sequence of government policymakers who choose sequentially do not want to deviate from it. \n", - "\n", - "\n", - "The property of a Markov perfect equilibrium that there is *no incentive to deviate from the plan* makes it attractive." - ] - }, - { - "cell_type": "markdown", - "id": "e24aae97", - "metadata": {}, - "source": [ - "## Comparison of Equilibrium Values\n", - "\n", - "We have computed plans for\n", - "\n", - "- an ordinary (unrestricted) Ramsey planner who chooses a sequence\n", - " $ \\{\\mu_t\\}_{t=0}^\\infty $ at time $ 0 $ \n", - "- a Ramsey planner restricted to choose a constant $ \\mu $ for all\n", - " $ t \\geq 0 $ \n", - "- a Markov perfect sequence of governments \n", - "\n", - "\n", - "Below we compare equilibrium time zero values for these three.\n", - "\n", - "We confirm that the value delivered by the unrestricted Ramsey planner\n", - "exceeds the value delivered by the restricted Ramsey planner which in\n", - "turn exceeds the value delivered by the Markov perfect sequence of\n", - "governments." - ] - }, - { - "cell_type": "code", - "execution_count": null, - "id": "3500435f", - "metadata": { - "hide-output": false - }, - "outputs": [], - "source": [ - "clq.J_series[0]" - ] - }, - { - "cell_type": "code", - "execution_count": null, - "id": "6c1a26db", - "metadata": { - "hide-output": false - }, - "outputs": [], - "source": [ - "clq.J_CR" - ] - }, - { - "cell_type": "code", - "execution_count": null, - "id": "a7d6e1f7", - "metadata": { - "hide-output": false - }, - "outputs": [], - "source": [ - "clq.J_MPE" - ] - }, - { - "cell_type": "markdown", - "id": "a865f426", - "metadata": {}, - "source": [ - "## Digression on Timeless Perspective\n", - "\n", - "Our calculations have confirmed that $ \\vec \\mu^R, \\vec \\theta^R, \\vec v^R $ are each monotone sequences that are bounded below and converge from above to limiting values.\n", - "\n", - "Some authors are fond of focusing only on these limiting values.\n", - "\n", - "They justify that by saying that they are taking a **timeless perspective** that ignores the transient movements in $ \\vec \\mu^R, \\vec \\theta^R, \\vec v^R $ that are destined eventually to fade away as $ \\theta_t $ described by Ramsey plan system [(43.21)](#equation-eq-old9) converges from above.\n", - "\n", - "- the timeless perspective pretends that Ramsey plan was actually solved long ago, and that we are stuck with it. " + "- A Markov perfect equilibrium plan is constructed to insure that a sequence of government policymakers who choose sequentially do not want to deviate from it. " ] }, { "cell_type": "markdown", - "id": "58fb4e14", + "id": "a6ab3f55", "metadata": {}, "source": [ "### Ramsey Plan Strikes Back\n", "\n", "Research by Abreu [[Abreu, 1988](https://python-advanced.quantecon.org/zreferences.html#id77)], Chari and Kehoe [[Chari and Kehoe, 1990](https://python-advanced.quantecon.org/zreferences.html#id219)]\n", - "[[Stokey, 1989](https://python-advanced.quantecon.org/zreferences.html#id226)], and Stokey [[Stokey, 1991](https://python-advanced.quantecon.org/zreferences.html#id78)] discovered conditions under which a Ramsey plan can be rescued from the complaint that it is not credible.\n", + "[[Stokey, 1989](https://python-advanced.quantecon.org/zreferences.html#id226)], and Stokey [[Stokey, 1991](https://python-advanced.quantecon.org/zreferences.html#id78)] described conditions under which a Ramsey plan can be rescued from the complaint that it is not credible.\n", "\n", "They accomplished this by expanding the\n", "description of a plan to include expectations about *adverse consequences* of deviating from\n", @@ -1983,7 +1943,7 @@ } ], "metadata": { - "date": 1734843460.6082804, + "date": 1735958030.3282402, "filename": "calvo.md", "kernelspec": { "display_name": "Python", diff --git a/calvo_abreu.ipynb b/calvo_abreu.ipynb index 28235b2..90e0aba 100644 --- a/calvo_abreu.ipynb +++ b/calvo_abreu.ipynb @@ -2,7 +2,7 @@ "cells": [ { "cell_type": "markdown", - "id": "6f433b75", + "id": "be3b7948", "metadata": {}, "source": [ "\n", @@ -11,7 +11,7 @@ }, { "cell_type": "markdown", - "id": "8b5dd867", + "id": "2b56160c", "metadata": {}, "source": [ "# Sustainable Plans for a Calvo Model\n", @@ -22,7 +22,7 @@ }, { "cell_type": "markdown", - "id": "968e7179", + "id": "505380ae", "metadata": {}, "source": [ "## Overview\n", @@ -51,7 +51,7 @@ }, { "cell_type": "markdown", - "id": "6d39b1aa", + "id": "27b50db7", "metadata": {}, "source": [ "## Model Components\n", @@ -134,7 +134,7 @@ }, { "cell_type": "markdown", - "id": "6f1aea9c", + "id": "970cbeae", "metadata": {}, "source": [ "## Another Timing Protocol\n", @@ -190,7 +190,7 @@ }, { "cell_type": "markdown", - "id": "87001470", + "id": "47f0e8d1", "metadata": {}, "source": [ "### Government Decisions\n", @@ -228,7 +228,7 @@ }, { "cell_type": "markdown", - "id": "3dd1ae3a", + "id": "1865f57a", "metadata": {}, "source": [ "### Temptation to Deviate from Plan\n", @@ -260,7 +260,7 @@ }, { "cell_type": "markdown", - "id": "3fa5898c", + "id": "dca6fea9", "metadata": {}, "source": [ "## Sustainable or Credible Plan\n", @@ -308,7 +308,7 @@ { "cell_type": "code", "execution_count": null, - "id": "07eee7b1", + "id": "053cb491", "metadata": { "hide-output": false }, @@ -319,7 +319,7 @@ }, { "cell_type": "markdown", - "id": "8c754b30", + "id": "4b26f858", "metadata": {}, "source": [ "We’ll start with some imports:" @@ -328,7 +328,7 @@ { "cell_type": "code", "execution_count": null, - "id": "380bc83f", + "id": "54d2b658", "metadata": { "hide-output": false }, @@ -342,7 +342,7 @@ }, { "cell_type": "markdown", - "id": "2078ae48", + "id": "c8be14d2", "metadata": {}, "source": [ "### Abreu’s Self-Enforcing Plan\n", @@ -414,7 +414,7 @@ }, { "cell_type": "markdown", - "id": "e4e6fb81", + "id": "51f59c13", "metadata": {}, "source": [ "### Abreu’s Carrot-Stick Plan\n", @@ -459,7 +459,7 @@ { "cell_type": "code", "execution_count": null, - "id": "c6ad1034", + "id": "fb48e00a", "metadata": { "hide-output": false }, @@ -580,7 +580,7 @@ }, { "cell_type": "markdown", - "id": "8838780b", + "id": "9eaf20fa", "metadata": {}, "source": [ "Let’s create an instance of ChangLQ with the following parameters:" @@ -589,7 +589,7 @@ { "cell_type": "code", "execution_count": null, - "id": "24f0e50c", + "id": "6d654f03", "metadata": { "hide-output": false }, @@ -600,7 +600,7 @@ }, { "cell_type": "markdown", - "id": "5d963d72", + "id": "e988a0b9", "metadata": {}, "source": [ "### Example of Self-Enforcing Plan\n", @@ -629,7 +629,7 @@ { "cell_type": "code", "execution_count": null, - "id": "6aae27bd", + "id": "34e680d2", "metadata": { "hide-output": false }, @@ -687,7 +687,7 @@ }, { "cell_type": "markdown", - "id": "4b957ca9", + "id": "6917759e", "metadata": {}, "source": [ "To confirm that the plan $ \\vec \\mu^A $ is **self-enforcing**, we\n", @@ -710,7 +710,7 @@ { "cell_type": "code", "execution_count": null, - "id": "15f7a03e", + "id": "072df692", "metadata": { "hide-output": false }, @@ -721,7 +721,7 @@ }, { "cell_type": "markdown", - "id": "c38949a2", + "id": "87f847f0", "metadata": {}, "source": [ "Given that plan $ \\vec \\mu^A $ is self-enforcing, we can check that\n", @@ -735,7 +735,7 @@ { "cell_type": "code", "execution_count": null, - "id": "ccb2b90f", + "id": "11199024", "metadata": { "hide-output": false }, @@ -756,7 +756,7 @@ }, { "cell_type": "markdown", - "id": "53cd590f", + "id": "d73d5353", "metadata": {}, "source": [ "### Recursive Representation of a Sustainable Plan\n", @@ -793,7 +793,7 @@ }, { "cell_type": "markdown", - "id": "84e30455", + "id": "62336bca", "metadata": {}, "source": [ "## Whose Plan is It?\n", @@ -825,7 +825,7 @@ } ], "metadata": { - "date": 1734843460.6527164, + "date": 1735958030.371933, "filename": "calvo_abreu.md", "kernelspec": { "display_name": "Python", diff --git a/calvo_machine_learn.ipynb b/calvo_machine_learn.ipynb index 194b5be..7aeed1c 100644 --- a/calvo_machine_learn.ipynb +++ b/calvo_machine_learn.ipynb @@ -2,7 +2,7 @@ "cells": [ { "cell_type": "markdown", - "id": "25e371d3", + "id": "0b5fae81", "metadata": {}, "source": [ "# Machine Learning a Ramsey Plan" @@ -10,7 +10,7 @@ }, { "cell_type": "markdown", - "id": "159331a4", + "id": "0e19a6df", "metadata": {}, "source": [ "## Introduction\n", @@ -74,7 +74,7 @@ }, { "cell_type": "markdown", - "id": "938575be", + "id": "bc7e21aa", "metadata": {}, "source": [ "## The Model\n", @@ -98,7 +98,7 @@ }, { "cell_type": "markdown", - "id": "95256001", + "id": "2a4ddee1", "metadata": {}, "source": [ "## Model Components\n", @@ -150,7 +150,7 @@ }, { "cell_type": "markdown", - "id": "35a4047a", + "id": "0970f419", "metadata": {}, "source": [ "## \n", @@ -249,7 +249,7 @@ }, { "cell_type": "markdown", - "id": "79776324", + "id": "99662e51", "metadata": {}, "source": [ "## Parameters and Variables\n", @@ -271,7 +271,7 @@ }, { "cell_type": "markdown", - "id": "f7b54541", + "id": "59a358f8", "metadata": {}, "source": [ "### Basic Objects\n", @@ -326,7 +326,7 @@ }, { "cell_type": "markdown", - "id": "2502e238", + "id": "e902e449", "metadata": {}, "source": [ "### Timing protocol\n", @@ -340,7 +340,7 @@ }, { "cell_type": "markdown", - "id": "0d4bf0a2", + "id": "fd12ce9b", "metadata": {}, "source": [ "## Approximation and Truncation parameter $ T $\n", @@ -420,7 +420,7 @@ }, { "cell_type": "markdown", - "id": "5eac154b", + "id": "552c0137", "metadata": {}, "source": [ "## A Gradient Descent Algorithm\n", @@ -434,7 +434,7 @@ }, { "cell_type": "markdown", - "id": "9a9cbf54", + "id": "f70750ee", "metadata": {}, "source": [ "### Implementation\n", @@ -447,7 +447,7 @@ { "cell_type": "code", "execution_count": null, - "id": "7c75ff33", + "id": "bfd0900b", "metadata": { "hide-output": false }, @@ -461,7 +461,7 @@ { "cell_type": "code", "execution_count": null, - "id": "94ebed8c", + "id": "f9a868e9", "metadata": { "hide-output": false }, @@ -478,7 +478,7 @@ }, { "cell_type": "markdown", - "id": "a64039dc", + "id": "14b9df4f", "metadata": {}, "source": [ "We’ll eventually want to compare the results we obtain here to those that we obtain in those obtained in this quantecon lecture [Time Inconsistency of Ramsey Plans](https://python-advanced.quantecon.org/calvo.html).\n", @@ -491,7 +491,7 @@ { "cell_type": "code", "execution_count": null, - "id": "caa9c734", + "id": "40fec859", "metadata": { "hide-output": false }, @@ -612,7 +612,7 @@ }, { "cell_type": "markdown", - "id": "3e9999f3", + "id": "92422731", "metadata": {}, "source": [ "Now we compute the value of $ V $ under this setup, and compare it against those obtained in this section [Outcomes under Three Timing Protocols](https://python-advanced.quantecon.org/calvo.html#compute-lq) of the sister quantecon lecture [Time Inconsistency of Ramsey Plans](https://python-advanced.quantecon.org/calvo.html)." @@ -621,7 +621,7 @@ { "cell_type": "code", "execution_count": null, - "id": "2389241b", + "id": "f777abdd", "metadata": { "hide-output": false }, @@ -635,7 +635,7 @@ { "cell_type": "code", "execution_count": null, - "id": "dd552d15", + "id": "f39ad3b0", "metadata": { "hide-output": false }, @@ -693,7 +693,7 @@ { "cell_type": "code", "execution_count": null, - "id": "1da38499", + "id": "ee928fc1", "metadata": { "hide-output": false }, @@ -707,7 +707,7 @@ }, { "cell_type": "markdown", - "id": "8ba664de", + "id": "32dc2dc6", "metadata": {}, "source": [ "Now we want to maximize the function $ V $ by choice of $ \\mu $.\n", @@ -718,7 +718,7 @@ { "cell_type": "code", "execution_count": null, - "id": "52dd4f39", + "id": "fa7a4372", "metadata": { "hide-output": false }, @@ -758,7 +758,7 @@ }, { "cell_type": "markdown", - "id": "527da02e", + "id": "1c0f1f6d", "metadata": {}, "source": [ "Here we use automatic differentiation functionality in JAX with `grad`." @@ -767,7 +767,7 @@ { "cell_type": "code", "execution_count": null, - "id": "4973656a", + "id": "3a9f78fe", "metadata": { "hide-output": false }, @@ -784,7 +784,7 @@ { "cell_type": "code", "execution_count": null, - "id": "869f192b", + "id": "5e50a129", "metadata": { "hide-output": false }, @@ -801,7 +801,7 @@ { "cell_type": "code", "execution_count": null, - "id": "f2f1af1a", + "id": "548a3e39", "metadata": { "hide-output": false }, @@ -813,7 +813,7 @@ { "cell_type": "code", "execution_count": null, - "id": "0599e440", + "id": "278f12b8", "metadata": { "hide-output": false }, @@ -825,7 +825,7 @@ { "cell_type": "code", "execution_count": null, - "id": "680c7fff", + "id": "75452f18", "metadata": { "hide-output": false }, @@ -837,7 +837,7 @@ { "cell_type": "code", "execution_count": null, - "id": "1c71c550", + "id": "97dfc666", "metadata": { "hide-output": false }, @@ -848,7 +848,7 @@ }, { "cell_type": "markdown", - "id": "8cf38e56", + "id": "f8925cb2", "metadata": {}, "source": [ "### Restricting $ \\mu_t = \\bar \\mu $ for all $ t $\n", @@ -866,7 +866,7 @@ { "cell_type": "code", "execution_count": null, - "id": "406b70b5", + "id": "14c184f8", "metadata": { "hide-output": false }, @@ -887,7 +887,7 @@ }, { "cell_type": "markdown", - "id": "62506906", + "id": "64585f76", "metadata": {}, "source": [ "Comparing it to $ \\mu^{CR} $ in [Time Inconsistency of Ramsey Plans](https://python-advanced.quantecon.org/calvo.html), we again obtained very close answers." @@ -896,7 +896,7 @@ { "cell_type": "code", "execution_count": null, - "id": "2ebdb877", + "id": "2c6f22ca", "metadata": { "hide-output": false }, @@ -908,7 +908,7 @@ { "cell_type": "code", "execution_count": null, - "id": "145cf233", + "id": "e40bfe2a", "metadata": { "hide-output": false }, @@ -921,7 +921,7 @@ { "cell_type": "code", "execution_count": null, - "id": "1d77e57f", + "id": "dd25122d", "metadata": { "hide-output": false }, @@ -932,7 +932,7 @@ }, { "cell_type": "markdown", - "id": "e4cda646", + "id": "74ecf44a", "metadata": {}, "source": [ "## A More Structured ML Algorithm\n", @@ -1017,7 +1017,7 @@ { "cell_type": "code", "execution_count": null, - "id": "680f3933", + "id": "485fb34e", "metadata": { "hide-output": false }, @@ -1036,7 +1036,7 @@ { "cell_type": "code", "execution_count": null, - "id": "affcd45b", + "id": "4573047a", "metadata": { "hide-output": false }, @@ -1050,7 +1050,7 @@ { "cell_type": "code", "execution_count": null, - "id": "2dbfc9d8", + "id": "ce9e6975", "metadata": { "hide-output": false }, @@ -1064,7 +1064,7 @@ { "cell_type": "code", "execution_count": null, - "id": "e81b97f7", + "id": "5c016880", "metadata": { "hide-output": false }, @@ -1075,7 +1075,7 @@ }, { "cell_type": "markdown", - "id": "1fe51222", + "id": "710b2d2b", "metadata": {}, "source": [ "As before, the Ramsey planner’s criterion is\n", @@ -1161,7 +1161,7 @@ }, { "cell_type": "markdown", - "id": "0aace0f3", + "id": "fbae29c6", "metadata": {}, "source": [ "### Two implementations\n", @@ -1172,7 +1172,7 @@ { "cell_type": "code", "execution_count": null, - "id": "b79dfa22", + "id": "36aced14", "metadata": { "hide-output": false }, @@ -1200,7 +1200,7 @@ { "cell_type": "code", "execution_count": null, - "id": "021a28d2", + "id": "fae13aed", "metadata": { "hide-output": false }, @@ -1217,7 +1217,7 @@ { "cell_type": "code", "execution_count": null, - "id": "26da1e79", + "id": "f15ca358", "metadata": { "hide-output": false }, @@ -1234,7 +1234,7 @@ { "cell_type": "code", "execution_count": null, - "id": "a7a509ab", + "id": "8389c703", "metadata": { "hide-output": false }, @@ -1246,7 +1246,7 @@ { "cell_type": "code", "execution_count": null, - "id": "de9a67d3", + "id": "b0152ab8", "metadata": { "hide-output": false }, @@ -1258,7 +1258,7 @@ { "cell_type": "code", "execution_count": null, - "id": "bbf98166", + "id": "b26cdc9a", "metadata": { "hide-output": false }, @@ -1270,7 +1270,7 @@ }, { "cell_type": "markdown", - "id": "e7498b7a", + "id": "e46615e5", "metadata": {}, "source": [ "We find that by exploiting more knowledge about the structure of the problem, we can significantly speed up our computation.\n", @@ -1281,7 +1281,7 @@ { "cell_type": "code", "execution_count": null, - "id": "a25a3569", + "id": "178803bb", "metadata": { "hide-output": false }, @@ -1308,7 +1308,7 @@ { "cell_type": "code", "execution_count": null, - "id": "cd64d7aa", + "id": "845993a2", "metadata": { "hide-output": false }, @@ -1320,7 +1320,7 @@ { "cell_type": "code", "execution_count": null, - "id": "1004ded2", + "id": "5fde0ed3", "metadata": { "hide-output": false }, @@ -1332,7 +1332,7 @@ { "cell_type": "code", "execution_count": null, - "id": "c0287f5f", + "id": "e91076eb", "metadata": { "hide-output": false }, @@ -1343,7 +1343,7 @@ }, { "cell_type": "markdown", - "id": "9364ab22", + "id": "fc158db1", "metadata": {}, "source": [ "We can check the gradient of the analytical solution against the `JAX` computed version" @@ -1352,7 +1352,7 @@ { "cell_type": "code", "execution_count": null, - "id": "8c0d654d", + "id": "a3d98efc", "metadata": { "hide-output": false }, @@ -1380,7 +1380,7 @@ { "cell_type": "code", "execution_count": null, - "id": "1fbfa64c", + "id": "d711166f", "metadata": { "hide-output": false }, @@ -1392,7 +1392,7 @@ { "cell_type": "code", "execution_count": null, - "id": "4a826b8c", + "id": "f2afd350", "metadata": { "hide-output": false }, @@ -1404,7 +1404,7 @@ { "cell_type": "code", "execution_count": null, - "id": "5a70f5f1", + "id": "b34334d1", "metadata": { "hide-output": false }, @@ -1415,7 +1415,7 @@ }, { "cell_type": "markdown", - "id": "7bc68968", + "id": "4dbdf42f", "metadata": {}, "source": [ "Let’s plot the Ramsey plan’s $ \\mu_t $ and $ \\theta_t $ for $ t =0, \\ldots, T $ against $ t $." @@ -1424,7 +1424,7 @@ { "cell_type": "code", "execution_count": null, - "id": "a4e3613f", + "id": "3ea2b180", "metadata": { "hide-output": false }, @@ -1446,7 +1446,7 @@ }, { "cell_type": "markdown", - "id": "943fd3a0", + "id": "e00f1e1e", "metadata": {}, "source": [ "Note that while $ \\theta_t $ is less than $ \\mu_t $for low $ t $’s, it eventually converges to\n", @@ -1457,7 +1457,7 @@ }, { "cell_type": "markdown", - "id": "31df13ea", + "id": "80d54e3d", "metadata": {}, "source": [ "## Continuation Values\n", @@ -1482,7 +1482,7 @@ { "cell_type": "code", "execution_count": null, - "id": "a2611b41", + "id": "6686d2d0", "metadata": { "hide-output": false }, @@ -1519,7 +1519,7 @@ }, { "cell_type": "markdown", - "id": "530707f5", + "id": "ab524d8b", "metadata": {}, "source": [ "The initial continuation value $ v_0 $ should equal the optimized value of the Ramsey planner’s criterion $ V $ defined\n", @@ -1531,7 +1531,7 @@ { "cell_type": "code", "execution_count": null, - "id": "1afacf16", + "id": "350a14d4", "metadata": { "hide-output": false }, @@ -1542,7 +1542,7 @@ }, { "cell_type": "markdown", - "id": "8f24264d", + "id": "75024ff4", "metadata": {}, "source": [ "We can also verify approximate equality by inspecting a graph of $ v_t $ against $ t $ for $ t=0, \\ldots, T $ along with the value attained by a restricted Ramsey planner $ V^{CR} $ and the optimized value of the ordinary Ramsey planner $ V^R $" @@ -1551,7 +1551,7 @@ { "cell_type": "code", "execution_count": null, - "id": "2f4cfcd7", + "id": "0be7ec5a", "metadata": { "hide-output": false }, @@ -1578,7 +1578,7 @@ }, { "cell_type": "markdown", - "id": "1ef39ca8", + "id": "e6c7f5f0", "metadata": {}, "source": [ "Figure Fig. 42.1 shows interesting patterns:\n", @@ -1597,7 +1597,7 @@ }, { "cell_type": "markdown", - "id": "2ec95953", + "id": "c5fc3fcb", "metadata": {}, "source": [ "## Adding Some Human Intelligence\n", @@ -1643,7 +1643,7 @@ { "cell_type": "code", "execution_count": null, - "id": "c2072dbb", + "id": "90738d3a", "metadata": { "hide-output": false }, @@ -1661,7 +1661,7 @@ }, { "cell_type": "markdown", - "id": "5ec2ea24", + "id": "5f82980b", "metadata": {}, "source": [ "Our regression tells us that the affine function\n", @@ -1682,7 +1682,7 @@ { "cell_type": "code", "execution_count": null, - "id": "aecf6d6e", + "id": "d6e009f9", "metadata": { "hide-output": false }, @@ -1698,7 +1698,7 @@ }, { "cell_type": "markdown", - "id": "e67dc30f", + "id": "b55dc67c", "metadata": {}, "source": [ "The time $ 0 $ pair $ (\\theta_0, \\mu_0) $ appears as the point on the upper right.\n", @@ -1711,7 +1711,7 @@ { "cell_type": "code", "execution_count": null, - "id": "e72b0778", + "id": "c7147466", "metadata": { "hide-output": false }, @@ -1731,7 +1731,7 @@ }, { "cell_type": "markdown", - "id": "71aafc9e", + "id": "dfa9543b", "metadata": {}, "source": [ "We find that the regression line fits perfectly and thus discover the affine relationship\n", @@ -1748,7 +1748,7 @@ { "cell_type": "code", "execution_count": null, - "id": "7e4c2c7a", + "id": "01848a3b", "metadata": { "hide-output": false }, @@ -1766,7 +1766,7 @@ }, { "cell_type": "markdown", - "id": "492a6c29", + "id": "29b3ed4e", "metadata": {}, "source": [ "Points for succeeding times appear further and further to the lower left and eventually converge to\n", @@ -1782,7 +1782,7 @@ { "cell_type": "code", "execution_count": null, - "id": "f7a77721", + "id": "452f9f3f", "metadata": { "hide-output": false }, @@ -1801,7 +1801,7 @@ }, { "cell_type": "markdown", - "id": "1754abc9", + "id": "ecdecff6", "metadata": {}, "source": [ "The regression has an $ R^2 $ equal to $ 1 $ and so fits perfectly.\n", @@ -1815,7 +1815,7 @@ { "cell_type": "code", "execution_count": null, - "id": "ba74e63b", + "id": "8b60a2e9", "metadata": { "hide-output": false }, @@ -1826,7 +1826,7 @@ }, { "cell_type": "markdown", - "id": "3591c69b", + "id": "1f163ebb", "metadata": {}, "source": [ "Let’s plot $ v_t $ against $ \\theta_t $ along with the nonlinear regression line." @@ -1835,7 +1835,7 @@ { "cell_type": "code", "execution_count": null, - "id": "4bdae787", + "id": "a86a8035", "metadata": { "hide-output": false }, @@ -1862,7 +1862,7 @@ }, { "cell_type": "markdown", - "id": "f6f86bb9", + "id": "c1133305", "metadata": {}, "source": [ "The highest continuation value $ v_0 $ at $ t=0 $ appears at the peak of the function quadratic function\n", @@ -1877,7 +1877,7 @@ }, { "cell_type": "markdown", - "id": "4960284a", + "id": "0576af70", "metadata": {}, "source": [ "## What has Machine Learning Taught Us?\n", @@ -1957,7 +1957,7 @@ { "cell_type": "code", "execution_count": null, - "id": "6e126f09", + "id": "e98b83d6", "metadata": { "hide-output": false }, @@ -1968,7 +1968,7 @@ }, { "cell_type": "markdown", - "id": "0025ee94", + "id": "64c82f1c", "metadata": {}, "source": [ "Now let’s print out the decision rule for $ \\mu_t $ uncovered by applying dynamic programming squared." @@ -1977,7 +1977,7 @@ { "cell_type": "code", "execution_count": null, - "id": "372519f7", + "id": "93f303ac", "metadata": { "hide-output": false }, @@ -1989,7 +1989,7 @@ }, { "cell_type": "markdown", - "id": "fa3e6400", + "id": "2de77dad", "metadata": {}, "source": [ "Now let’s print out the decision rule for $ \\theta_{t+1} $ uncovered by applying dynamic programming squared." @@ -1998,7 +1998,7 @@ { "cell_type": "code", "execution_count": null, - "id": "44d5f6aa", + "id": "31e4117d", "metadata": { "hide-output": false }, @@ -2010,7 +2010,7 @@ }, { "cell_type": "markdown", - "id": "9cf907d0", + "id": "b41bc244", "metadata": {}, "source": [ "Evidently, these agree with the relationships that we discovered by running regressions on the Ramsey outcomes $ \\vec \\mu^R, \\vec \\theta^R $ that we constructed with either of our machine learning algorithms.\n", @@ -2031,7 +2031,7 @@ } ], "metadata": { - "date": 1734843460.726207, + "date": 1735958030.4436655, "filename": "calvo_machine_learn.md", "kernelspec": { "display_name": "Python", diff --git a/cattle_cycles.ipynb b/cattle_cycles.ipynb index 1e4fd96..c18ecce 100644 --- a/cattle_cycles.ipynb +++ b/cattle_cycles.ipynb @@ -2,7 +2,7 @@ "cells": [ { "cell_type": "markdown", - "id": "4bcc0bd0", + "id": "c54371cf", "metadata": {}, "source": [ "\n", @@ -13,7 +13,7 @@ }, { "cell_type": "markdown", - "id": "b55807ca", + "id": "4a991af4", "metadata": {}, "source": [ "# Cattle Cycles\n", @@ -27,7 +27,7 @@ { "cell_type": "code", "execution_count": null, - "id": "993dd868", + "id": "8fb9548d", "metadata": { "hide-output": false }, @@ -38,7 +38,7 @@ }, { "cell_type": "markdown", - "id": "0cdb54da", + "id": "2345375c", "metadata": {}, "source": [ "This lecture uses the DLE class to construct instances of the “Cattle Cycles” model\n", @@ -53,7 +53,7 @@ { "cell_type": "code", "execution_count": null, - "id": "231536a7", + "id": "f6d27e98", "metadata": { "hide-output": false }, @@ -68,7 +68,7 @@ }, { "cell_type": "markdown", - "id": "c2fc6df3", + "id": "31687283", "metadata": {}, "source": [ "## The Model\n", @@ -130,7 +130,7 @@ }, { "cell_type": "markdown", - "id": "31b53044", + "id": "4ef20f66", "metadata": {}, "source": [ "## Mapping into HS2013 Framework" @@ -138,7 +138,7 @@ }, { "cell_type": "markdown", - "id": "2ccfba1f", + "id": "15822d5b", "metadata": {}, "source": [ "### Preferences\n", @@ -153,7 +153,7 @@ }, { "cell_type": "markdown", - "id": "234d1a66", + "id": "f556bb42", "metadata": {}, "source": [ "### Technology\n", @@ -203,7 +203,7 @@ }, { "cell_type": "markdown", - "id": "56901302", + "id": "a51809a6", "metadata": {}, "source": [ "### Information\n", @@ -242,7 +242,7 @@ { "cell_type": "code", "execution_count": null, - "id": "0cca3347", + "id": "2e495be8", "metadata": { "hide-output": false }, @@ -258,7 +258,7 @@ }, { "cell_type": "markdown", - "id": "02b6a2b1", + "id": "8696738b", "metadata": {}, "source": [ "We set parameters to those used by [[Rosen *et al.*, 1994](https://python-advanced.quantecon.org/zreferences.html#id73)]" @@ -267,7 +267,7 @@ { "cell_type": "code", "execution_count": null, - "id": "871173b0", + "id": "6578b0dc", "metadata": { "hide-output": false }, @@ -341,7 +341,7 @@ }, { "cell_type": "markdown", - "id": "e73fa1d3", + "id": "0252f2c9", "metadata": {}, "source": [ "Notice that we have set $ \\rho_1 = \\rho_2 = 0 $, so $ h_t $ and\n", @@ -358,7 +358,7 @@ { "cell_type": "code", "execution_count": null, - "id": "8bd5fb30", + "id": "32d9b2b1", "metadata": { "hide-output": false }, @@ -391,7 +391,7 @@ { "cell_type": "code", "execution_count": null, - "id": "872d94b7", + "id": "b456f5b3", "metadata": { "hide-output": false }, @@ -410,7 +410,7 @@ { "cell_type": "code", "execution_count": null, - "id": "fbbdddd9", + "id": "03430e99", "metadata": { "hide-output": false }, @@ -421,7 +421,7 @@ }, { "cell_type": "markdown", - "id": "68772bd8", + "id": "8a0148ec", "metadata": {}, "source": [ "[[Rosen *et al.*, 1994](https://python-advanced.quantecon.org/zreferences.html#id73)] use the model to understand the\n", @@ -434,7 +434,7 @@ { "cell_type": "code", "execution_count": null, - "id": "52e36b81", + "id": "16c67822", "metadata": { "hide-output": false }, @@ -451,7 +451,7 @@ }, { "cell_type": "markdown", - "id": "262c7f1a", + "id": "0666bd23", "metadata": {}, "source": [ "In their Figure 3, [[Rosen *et al.*, 1994](https://python-advanced.quantecon.org/zreferences.html#id73)] plot the impulse response functions\n", @@ -464,7 +464,7 @@ { "cell_type": "code", "execution_count": null, - "id": "7cadc079", + "id": "139c050e", "metadata": { "hide-output": false }, @@ -493,7 +493,7 @@ }, { "cell_type": "markdown", - "id": "d02667b4", + "id": "a78572fa", "metadata": {}, "source": [ "The above figures show how consumption patterns differ markedly,\n", @@ -516,7 +516,7 @@ { "cell_type": "code", "execution_count": null, - "id": "463cf825", + "id": "3d6041da", "metadata": { "hide-output": false }, @@ -538,7 +538,7 @@ }, { "cell_type": "markdown", - "id": "5f364e3b", + "id": "94b5b959", "metadata": {}, "source": [ "The fact that $ y_t $ is a weighted moving average of $ x_t $\n", @@ -549,7 +549,7 @@ } ], "metadata": { - "date": 1734843460.748682, + "date": 1735958030.4659188, "filename": "cattle_cycles.md", "kernelspec": { "display_name": "Python", diff --git a/chang_credible.ipynb b/chang_credible.ipynb index 9271094..20fd89a 100644 --- a/chang_credible.ipynb +++ b/chang_credible.ipynb @@ -2,7 +2,7 @@ "cells": [ { "cell_type": "markdown", - "id": "2a1cbb4f", + "id": "f8956024", "metadata": {}, "source": [ "\n", @@ -11,7 +11,7 @@ }, { "cell_type": "markdown", - "id": "ec718195", + "id": "624a8dac", "metadata": {}, "source": [ "# Credible Government Policies in a Model of Chang\n", @@ -22,7 +22,7 @@ { "cell_type": "code", "execution_count": null, - "id": "266ce3e0", + "id": "ba2c1a6d", "metadata": { "hide-output": false }, @@ -33,7 +33,7 @@ }, { "cell_type": "markdown", - "id": "5e200254", + "id": "7a418124", "metadata": {}, "source": [ "## Overview\n", @@ -92,7 +92,7 @@ { "cell_type": "code", "execution_count": null, - "id": "1d0584c8", + "id": "b7491d70", "metadata": { "hide-output": false }, @@ -105,7 +105,7 @@ }, { "cell_type": "markdown", - "id": "793fbbd9", + "id": "6b05d6c7", "metadata": {}, "source": [ "## The Setting\n", @@ -160,7 +160,7 @@ }, { "cell_type": "markdown", - "id": "d359a360", + "id": "a36dda0b", "metadata": {}, "source": [ "### The Household’s Problem\n", @@ -221,7 +221,7 @@ }, { "cell_type": "markdown", - "id": "343494d0", + "id": "58a19de6", "metadata": {}, "source": [ "### Government\n", @@ -279,7 +279,7 @@ }, { "cell_type": "markdown", - "id": "4aef29b3", + "id": "426243c4", "metadata": {}, "source": [ "### Within-period Timing Protocol\n", @@ -309,7 +309,7 @@ }, { "cell_type": "markdown", - "id": "114a3f3d", + "id": "024f67f2", "metadata": {}, "source": [ "### Household’s Problem\n", @@ -376,7 +376,7 @@ }, { "cell_type": "markdown", - "id": "625f29a6", + "id": "ecd3f074", "metadata": {}, "source": [ "### Competitive Equilibrium\n", @@ -402,7 +402,7 @@ }, { "cell_type": "markdown", - "id": "838c5451", + "id": "a6c4625f", "metadata": {}, "source": [ "### A Credible Government Policy\n", @@ -485,7 +485,7 @@ }, { "cell_type": "markdown", - "id": "b2bc91af", + "id": "ff257ddc", "metadata": {}, "source": [ "### Sustainable Plans\n", @@ -662,7 +662,7 @@ }, { "cell_type": "markdown", - "id": "0ae43156", + "id": "543abdc2", "metadata": {}, "source": [ "## Calculating the Set of Sustainable Promise-Value Pairs\n", @@ -878,7 +878,7 @@ { "cell_type": "code", "execution_count": null, - "id": "6aecc437", + "id": "05b9c765", "metadata": { "hide-output": false }, @@ -1386,7 +1386,7 @@ }, { "cell_type": "markdown", - "id": "5ffe01fb", + "id": "f2ec73d0", "metadata": {}, "source": [ "### Comparison of Sets\n", @@ -1401,7 +1401,7 @@ { "cell_type": "code", "execution_count": null, - "id": "d1fc3110", + "id": "1b670afc", "metadata": { "hide-output": false }, @@ -1413,7 +1413,7 @@ { "cell_type": "code", "execution_count": null, - "id": "704a30c6", + "id": "cec5406e", "metadata": { "hide-output": false }, @@ -1424,7 +1424,7 @@ }, { "cell_type": "markdown", - "id": "06a808c5", + "id": "51581c49", "metadata": {}, "source": [ "The following plot shows both the set of $ w,\\theta $ pairs associated with competitive equilibria (in red)\n", @@ -1434,7 +1434,7 @@ { "cell_type": "code", "execution_count": null, - "id": "668ac3ec", + "id": "19680c43", "metadata": { "hide-output": false }, @@ -1476,7 +1476,7 @@ }, { "cell_type": "markdown", - "id": "decacc20", + "id": "1f54e972", "metadata": {}, "source": [ "Evidently, the Ramsey plan, denoted by the $ R $, is not sustainable.\n", @@ -1487,7 +1487,7 @@ { "cell_type": "code", "execution_count": null, - "id": "f1474fa9", + "id": "1f7ea983", "metadata": { "hide-output": false }, @@ -1500,7 +1500,7 @@ { "cell_type": "code", "execution_count": null, - "id": "f10b923f", + "id": "4961b506", "metadata": { "hide-output": false }, @@ -1511,7 +1511,7 @@ }, { "cell_type": "markdown", - "id": "83a1d08b", + "id": "e0f6af13", "metadata": {}, "source": [ "Let’s plot both sets" @@ -1520,7 +1520,7 @@ { "cell_type": "code", "execution_count": null, - "id": "087e48b5", + "id": "bf1a4630", "metadata": { "hide-output": false }, @@ -1531,7 +1531,7 @@ }, { "cell_type": "markdown", - "id": "31446dcb", + "id": "c3b8a38d", "metadata": {}, "source": [ "Evidently, the Ramsey plan is now sustainable." @@ -1539,7 +1539,7 @@ } ], "metadata": { - "date": 1734843460.9392128, + "date": 1735958030.647375, "filename": "chang_credible.md", "kernelspec": { "display_name": "Python", diff --git a/chang_ramsey.ipynb b/chang_ramsey.ipynb index 69f0fbd..9582029 100644 --- a/chang_ramsey.ipynb +++ b/chang_ramsey.ipynb @@ -2,7 +2,7 @@ "cells": [ { "cell_type": "markdown", - "id": "f024514d", + "id": "285013dc", "metadata": {}, "source": [ "\n", @@ -11,7 +11,7 @@ }, { "cell_type": "markdown", - "id": "51ea91d5", + "id": "7a643ced", "metadata": {}, "source": [ "# Competitive Equilibria of a Model of Chang\n", @@ -22,7 +22,7 @@ { "cell_type": "code", "execution_count": null, - "id": "7e65ad15", + "id": "c75a15a2", "metadata": { "hide-output": false }, @@ -33,7 +33,7 @@ }, { "cell_type": "markdown", - "id": "3c9bf47b", + "id": "0a084aaf", "metadata": {}, "source": [ "## Overview\n", @@ -81,7 +81,7 @@ { "cell_type": "code", "execution_count": null, - "id": "7cea9f5f", + "id": "de232d6d", "metadata": { "hide-output": false }, @@ -94,7 +94,7 @@ }, { "cell_type": "markdown", - "id": "db678671", + "id": "19fd8dfc", "metadata": {}, "source": [ "### The Setting\n", @@ -152,7 +152,7 @@ }, { "cell_type": "markdown", - "id": "37520f30", + "id": "6186a6b4", "metadata": {}, "source": [ "## Decisions" @@ -160,7 +160,7 @@ }, { "cell_type": "markdown", - "id": "4e9ac262", + "id": "b5c46cb6", "metadata": {}, "source": [ "### The Household’s Problem\n", @@ -221,7 +221,7 @@ }, { "cell_type": "markdown", - "id": "a363416b", + "id": "ef34fc41", "metadata": {}, "source": [ "### Government\n", @@ -350,7 +350,7 @@ }, { "cell_type": "markdown", - "id": "6c79384c", + "id": "cd9190a5", "metadata": {}, "source": [ "### Household’s Problem\n", @@ -422,7 +422,7 @@ }, { "cell_type": "markdown", - "id": "631fd9b7", + "id": "6691641d", "metadata": {}, "source": [ "## Competitive Equilibrium\n", @@ -448,7 +448,7 @@ }, { "cell_type": "markdown", - "id": "4a6cb6ea", + "id": "97fe9c33", "metadata": {}, "source": [ "## Inventory of Objects in Play\n", @@ -507,7 +507,7 @@ }, { "cell_type": "markdown", - "id": "32066458", + "id": "3d94fd13", "metadata": {}, "source": [ "## Analysis\n", @@ -681,7 +681,7 @@ }, { "cell_type": "markdown", - "id": "38247e3f", + "id": "d1a04837", "metadata": {}, "source": [ "### Some Useful Notation\n", @@ -748,7 +748,7 @@ }, { "cell_type": "markdown", - "id": "5172cbaa", + "id": "17da2107", "metadata": {}, "source": [ "### Another Operator\n", @@ -850,7 +850,7 @@ }, { "cell_type": "markdown", - "id": "78fc015a", + "id": "3f6b5988", "metadata": {}, "source": [ "## Calculating all Promise-Value Pairs in CE\n", @@ -1003,7 +1003,7 @@ { "cell_type": "code", "execution_count": null, - "id": "e1e41abd", + "id": "b92181ba", "metadata": { "hide-output": false }, @@ -1512,7 +1512,7 @@ { "cell_type": "code", "execution_count": null, - "id": "8b6e9493", + "id": "4ca8f5cd", "metadata": { "hide-output": false }, @@ -1525,7 +1525,7 @@ { "cell_type": "code", "execution_count": null, - "id": "42d39e8e", + "id": "86339d9f", "metadata": { "hide-output": false }, @@ -1566,7 +1566,7 @@ { "cell_type": "code", "execution_count": null, - "id": "6bd662e4", + "id": "26427cc5", "metadata": { "hide-output": false }, @@ -1580,7 +1580,7 @@ { "cell_type": "code", "execution_count": null, - "id": "31ce2d00", + "id": "59c6f1f0", "metadata": { "hide-output": false }, @@ -1591,7 +1591,7 @@ }, { "cell_type": "markdown", - "id": "4e648c90", + "id": "134f3b68", "metadata": {}, "source": [ "## Solving a Continuation Ramsey Planner’s Bellman Equation\n", @@ -1652,7 +1652,7 @@ { "cell_type": "code", "execution_count": null, - "id": "2369db62", + "id": "ffacc190", "metadata": { "hide-output": false }, @@ -1667,7 +1667,7 @@ { "cell_type": "code", "execution_count": null, - "id": "d64d0cd1", + "id": "a3b7b1bd", "metadata": { "hide-output": false }, @@ -1679,7 +1679,7 @@ }, { "cell_type": "markdown", - "id": "dc0a7aa3", + "id": "b9bcf5a2", "metadata": {}, "source": [ "First, a quick check that our approximations of the value functions are\n", @@ -1691,7 +1691,7 @@ { "cell_type": "code", "execution_count": null, - "id": "fcf1485b", + "id": "ac09c4f2", "metadata": { "hide-output": false }, @@ -1702,7 +1702,7 @@ }, { "cell_type": "markdown", - "id": "4bbbde01", + "id": "2d4ebd67", "metadata": {}, "source": [ "The value functions plotted below trace out the right edges of the sets\n", @@ -1712,7 +1712,7 @@ { "cell_type": "code", "execution_count": null, - "id": "fc4a3ecb", + "id": "0db12369", "metadata": { "hide-output": false }, @@ -1731,7 +1731,7 @@ }, { "cell_type": "markdown", - "id": "6f6e4f9d", + "id": "6a2c5b1a", "metadata": {}, "source": [ "The next figure plots the optimal policy functions; values of\n", @@ -1741,7 +1741,7 @@ { "cell_type": "code", "execution_count": null, - "id": "39adad7d", + "id": "9138ed6b", "metadata": { "hide-output": false }, @@ -1766,7 +1766,7 @@ }, { "cell_type": "markdown", - "id": "7b26d4d9", + "id": "d33838d3", "metadata": {}, "source": [ "With the first set of parameter values, the value of $ \\theta' $ chosen by the Ramsey\n", @@ -1787,7 +1787,7 @@ { "cell_type": "code", "execution_count": null, - "id": "0fae7b4a", + "id": "b9c2a506", "metadata": { "hide-output": false }, @@ -1806,7 +1806,7 @@ }, { "cell_type": "markdown", - "id": "183d4980", + "id": "e8b282a2", "metadata": {}, "source": [ "Subproblem 2 is equivalent to the planner choosing the initial value of\n", @@ -1822,7 +1822,7 @@ { "cell_type": "code", "execution_count": null, - "id": "2b4f2c05", + "id": "d5e50095", "metadata": { "hide-output": false }, @@ -1845,7 +1845,7 @@ }, { "cell_type": "markdown", - "id": "ac43375f", + "id": "9c72e011", "metadata": {}, "source": [ "### Next Steps\n", @@ -1861,7 +1861,7 @@ } ], "metadata": { - "date": 1734843461.002651, + "date": 1735958030.7098303, "filename": "chang_ramsey.md", "kernelspec": { "display_name": "Python", diff --git a/classical_filtering.ipynb b/classical_filtering.ipynb index d7b5fdd..9f6f607 100644 --- a/classical_filtering.ipynb +++ b/classical_filtering.ipynb @@ -2,7 +2,7 @@ "cells": [ { "cell_type": "markdown", - "id": "a0ff9650", + "id": "69158334", "metadata": {}, "source": [ "\n", @@ -11,7 +11,7 @@ }, { "cell_type": "markdown", - "id": "6f2aa234", + "id": "e687b1f6", "metadata": {}, "source": [ "# Classical Prediction and Filtering With Linear Algebra" @@ -19,7 +19,7 @@ }, { "cell_type": "markdown", - "id": "5e4360e0", + "id": "49290d94", "metadata": {}, "source": [ "## Overview\n", @@ -72,7 +72,7 @@ { "cell_type": "code", "execution_count": null, - "id": "a58cc9bd", + "id": "9dae07c0", "metadata": { "hide-output": false }, @@ -83,7 +83,7 @@ }, { "cell_type": "markdown", - "id": "d5ff43c0", + "id": "1073c39e", "metadata": {}, "source": [ "### References\n", @@ -93,7 +93,7 @@ }, { "cell_type": "markdown", - "id": "facb020e", + "id": "8a0d0f0a", "metadata": {}, "source": [ "## Finite Dimensional Prediction\n", @@ -245,7 +245,7 @@ }, { "cell_type": "markdown", - "id": "81f8e77b", + "id": "905c7085", "metadata": {}, "source": [ "### Implementation\n", @@ -256,7 +256,7 @@ { "cell_type": "code", "execution_count": null, - "id": "3bd36576", + "id": "1647d8f2", "metadata": { "hide-output": false }, @@ -572,7 +572,7 @@ }, { "cell_type": "markdown", - "id": "90bef87f", + "id": "ca7d485d", "metadata": {}, "source": [ "Let’s use this code to tackle two interesting examples." @@ -580,7 +580,7 @@ }, { "cell_type": "markdown", - "id": "f8efdfd1", + "id": "ccf63f10", "metadata": {}, "source": [ "### Example 1\n", @@ -603,7 +603,7 @@ { "cell_type": "code", "execution_count": null, - "id": "88d01d0a", + "id": "5ac9a449", "metadata": { "hide-output": false }, @@ -619,7 +619,7 @@ }, { "cell_type": "markdown", - "id": "31ba0163", + "id": "652ab0bb", "metadata": {}, "source": [ "The Wold representation is computed by `example.coeffs_of_c()`.\n", @@ -630,7 +630,7 @@ { "cell_type": "code", "execution_count": null, - "id": "da6f3fab", + "id": "4d785d6b", "metadata": { "hide-output": false }, @@ -642,7 +642,7 @@ { "cell_type": "code", "execution_count": null, - "id": "22f2b5d4", + "id": "aaff9b19", "metadata": { "hide-output": false }, @@ -653,7 +653,7 @@ }, { "cell_type": "markdown", - "id": "be7c4af3", + "id": "5871eef9", "metadata": {}, "source": [ "Now let’s form the covariance matrix of a time series vector of length $ N $\n", @@ -666,7 +666,7 @@ { "cell_type": "code", "execution_count": null, - "id": "4cfaacc8", + "id": "261f29cb", "metadata": { "hide-output": false }, @@ -678,7 +678,7 @@ }, { "cell_type": "markdown", - "id": "3c8d4249", + "id": "8247b63b", "metadata": {}, "source": [ "Notice how the lower rows of the “moving average representations” are converging to the appropriate infinite history Wold representation\n", @@ -688,7 +688,7 @@ { "cell_type": "code", "execution_count": null, - "id": "8d1a9e1a", + "id": "e72d4f45", "metadata": { "hide-output": false }, @@ -700,7 +700,7 @@ }, { "cell_type": "markdown", - "id": "095b944f", + "id": "b2a0b778", "metadata": {}, "source": [ "Notice how the lower rows of the “autoregressive representations” are converging to the appropriate infinite-history\n", @@ -710,7 +710,7 @@ { "cell_type": "code", "execution_count": null, - "id": "8c170794", + "id": "e2f671bf", "metadata": { "hide-output": false }, @@ -722,7 +722,7 @@ }, { "cell_type": "markdown", - "id": "66854dfa", + "id": "044f226b", "metadata": {}, "source": [ "### Example 2\n", @@ -749,7 +749,7 @@ { "cell_type": "code", "execution_count": null, - "id": "3922274e", + "id": "3dd69b88", "metadata": { "hide-output": false }, @@ -767,7 +767,7 @@ { "cell_type": "code", "execution_count": null, - "id": "aaa26fa3", + "id": "114dea2d", "metadata": { "hide-output": false }, @@ -779,7 +779,7 @@ { "cell_type": "code", "execution_count": null, - "id": "2603fb88", + "id": "fbbc8bab", "metadata": { "hide-output": false }, @@ -792,7 +792,7 @@ { "cell_type": "code", "execution_count": null, - "id": "b7a83bc6", + "id": "a7a04061", "metadata": { "hide-output": false }, @@ -805,7 +805,7 @@ { "cell_type": "code", "execution_count": null, - "id": "abdd7882", + "id": "4337004c", "metadata": { "hide-output": false }, @@ -817,7 +817,7 @@ }, { "cell_type": "markdown", - "id": "b181faa5", + "id": "7b82d52f", "metadata": {}, "source": [ "### Prediction\n", @@ -899,7 +899,7 @@ }, { "cell_type": "markdown", - "id": "6f55b02b", + "id": "fc87b6c3", "metadata": {}, "source": [ "## Combined Finite Dimensional Control and Prediction\n", @@ -987,7 +987,7 @@ }, { "cell_type": "markdown", - "id": "16d7866c", + "id": "11160841", "metadata": {}, "source": [ "## Infinite Horizon Prediction and Filtering Problems\n", @@ -1053,7 +1053,7 @@ }, { "cell_type": "markdown", - "id": "7219388c", + "id": "bc93c229", "metadata": {}, "source": [ "### Problem Formulation\n", @@ -1433,7 +1433,7 @@ }, { "cell_type": "markdown", - "id": "de733a92", + "id": "11ed34ae", "metadata": {}, "source": [ "## Exercises" @@ -1441,7 +1441,7 @@ }, { "cell_type": "markdown", - "id": "a4067783", + "id": "878edbec", "metadata": {}, "source": [ "## Exercise 33.1\n", @@ -1476,7 +1476,7 @@ }, { "cell_type": "markdown", - "id": "721946f6", + "id": "ecad44ff", "metadata": {}, "source": [ "## Exercise 33.2\n", @@ -1556,7 +1556,7 @@ } ], "metadata": { - "date": 1734843461.0570405, + "date": 1735958030.7632103, "filename": "classical_filtering.md", "kernelspec": { "display_name": "Python", diff --git a/coase.ipynb b/coase.ipynb index bb0adc7..d026b8a 100644 --- a/coase.ipynb +++ b/coase.ipynb @@ -2,7 +2,7 @@ "cells": [ { "cell_type": "markdown", - "id": "6e98fa6b", + "id": "a52bae16", "metadata": {}, "source": [ "\n", @@ -11,7 +11,7 @@ }, { "cell_type": "markdown", - "id": "64ab08df", + "id": "ed7db12d", "metadata": {}, "source": [ "# Coase’s Theory of the Firm" @@ -19,7 +19,7 @@ }, { "cell_type": "markdown", - "id": "e20b6bf6", + "id": "719aff73", "metadata": {}, "source": [ "## Overview\n", @@ -50,7 +50,7 @@ { "cell_type": "code", "execution_count": null, - "id": "a02e35d9", + "id": "28ac2484", "metadata": { "hide-output": false }, @@ -63,7 +63,7 @@ }, { "cell_type": "markdown", - "id": "c7882174", + "id": "4b863f43", "metadata": {}, "source": [ "### Why Firms Exist\n", @@ -96,7 +96,7 @@ }, { "cell_type": "markdown", - "id": "58f8e2a2", + "id": "1bad30b1", "metadata": {}, "source": [ "### A Trade-Off\n", @@ -133,7 +133,7 @@ }, { "cell_type": "markdown", - "id": "83254af6", + "id": "66fb737a", "metadata": {}, "source": [ "### Summary\n", @@ -147,7 +147,7 @@ }, { "cell_type": "markdown", - "id": "403d208b", + "id": "099720e5", "metadata": {}, "source": [ "### A Quantitative Interpretation\n", @@ -165,7 +165,7 @@ }, { "cell_type": "markdown", - "id": "ae093667", + "id": "f942b0e2", "metadata": {}, "source": [ "## The Model\n", @@ -181,7 +181,7 @@ }, { "cell_type": "markdown", - "id": "b4f02a5e", + "id": "fac17ab7", "metadata": {}, "source": [ "### Subcontracting\n", @@ -224,7 +224,7 @@ }, { "cell_type": "markdown", - "id": "ef31057a", + "id": "f09d48b6", "metadata": {}, "source": [ "### Costs\n", @@ -254,7 +254,7 @@ }, { "cell_type": "markdown", - "id": "2932956d", + "id": "5ef740b7", "metadata": {}, "source": [ "## Equilibrium\n", @@ -277,7 +277,7 @@ }, { "cell_type": "markdown", - "id": "114e71d5", + "id": "e4610a4a", "metadata": {}, "source": [ "### Informal Definition of Equilibrium\n", @@ -291,7 +291,7 @@ }, { "cell_type": "markdown", - "id": "26fd7f03", + "id": "b5fef267", "metadata": {}, "source": [ "### Formal Definition of Equilibrium\n", @@ -349,7 +349,7 @@ }, { "cell_type": "markdown", - "id": "6adb58d6", + "id": "0f9e3b88", "metadata": {}, "source": [ "## Existence, Uniqueness and Computation of Equilibria\n", @@ -359,7 +359,7 @@ }, { "cell_type": "markdown", - "id": "42b8071c", + "id": "3a33e58f", "metadata": {}, "source": [ "### A Fixed Point Method\n", @@ -460,7 +460,7 @@ }, { "cell_type": "markdown", - "id": "2d156b2e", + "id": "54e4e3fc", "metadata": {}, "source": [ "### Marginal Conditions\n", @@ -514,7 +514,7 @@ }, { "cell_type": "markdown", - "id": "12719e53", + "id": "3b845f57", "metadata": {}, "source": [ "## Implementation\n", @@ -539,7 +539,7 @@ { "cell_type": "code", "execution_count": null, - "id": "ad566d46", + "id": "d0e20da5", "metadata": { "hide-output": false }, @@ -558,7 +558,7 @@ }, { "cell_type": "markdown", - "id": "6f45b53a", + "id": "52176a54", "metadata": {}, "source": [ "Now let’s implement and iterate with $ T $ until convergence.\n", @@ -570,7 +570,7 @@ { "cell_type": "code", "execution_count": null, - "id": "0ea9c35b", + "id": "7a3367d8", "metadata": { "hide-output": false }, @@ -609,7 +609,7 @@ }, { "cell_type": "markdown", - "id": "ac1b4258", + "id": "32c15181", "metadata": {}, "source": [ "The next function computes optimal choice of upstream boundary and range of\n", @@ -619,7 +619,7 @@ { "cell_type": "code", "execution_count": null, - "id": "9a2ceec8", + "id": "46816061", "metadata": { "hide-output": false }, @@ -646,7 +646,7 @@ }, { "cell_type": "markdown", - "id": "6b0755ca", + "id": "f503b19b", "metadata": {}, "source": [ "The allocation of firms can be computed by recursively stepping through firms’ choices of\n", @@ -658,7 +658,7 @@ { "cell_type": "code", "execution_count": null, - "id": "744ce12e", + "id": "e79fe4bf", "metadata": { "hide-output": false }, @@ -675,7 +675,7 @@ }, { "cell_type": "markdown", - "id": "62bc2849", + "id": "94dcc866", "metadata": {}, "source": [ "Let’s try this at the default parameters.\n", @@ -687,7 +687,7 @@ { "cell_type": "code", "execution_count": null, - "id": "7410b4be", + "id": "684223ac", "metadata": { "hide-output": false }, @@ -710,7 +710,7 @@ }, { "cell_type": "markdown", - "id": "f218d472", + "id": "5408e74b", "metadata": {}, "source": [ "Here’s the function $ \\ell^* $, which shows how large a firm with\n", @@ -720,7 +720,7 @@ { "cell_type": "code", "execution_count": null, - "id": "92ae4fc8", + "id": "92589dca", "metadata": { "hide-output": false }, @@ -739,7 +739,7 @@ }, { "cell_type": "markdown", - "id": "c1db1132", + "id": "fd884074", "metadata": {}, "source": [ "Note that downstream firms choose to be larger, a point we return to below." @@ -747,7 +747,7 @@ }, { "cell_type": "markdown", - "id": "b4ea1886", + "id": "fac0ae6d", "metadata": {}, "source": [ "## Exercises\n", @@ -758,7 +758,7 @@ }, { "cell_type": "markdown", - "id": "eaf5a770", + "id": "81a1a841", "metadata": {}, "source": [ "## Exercise 15.1\n", @@ -772,7 +772,7 @@ }, { "cell_type": "markdown", - "id": "89db2189", + "id": "d3069b98", "metadata": {}, "source": [ "## Solution to[ Exercise 15.1](https://python-advanced.quantecon.org/#coa_ex1)\n", @@ -783,7 +783,7 @@ { "cell_type": "code", "execution_count": null, - "id": "221ae45f", + "id": "3289b732", "metadata": { "hide-output": false }, @@ -800,7 +800,7 @@ }, { "cell_type": "markdown", - "id": "3fa8204d", + "id": "730bbe2c", "metadata": {}, "source": [ "## Exercise 15.2\n", @@ -816,7 +816,7 @@ }, { "cell_type": "markdown", - "id": "bd8b4034", + "id": "8f403e51", "metadata": {}, "source": [ "## Solution to[ Exercise 15.2](https://python-advanced.quantecon.org/#coa_ex2)\n", @@ -839,7 +839,7 @@ { "cell_type": "code", "execution_count": null, - "id": "f02ec9c0", + "id": "b8054a3f", "metadata": { "hide-output": false }, @@ -863,7 +863,7 @@ } ], "metadata": { - "date": 1734843461.0923426, + "date": 1735958030.7982855, "filename": "coase.md", "kernelspec": { "display_name": "Python", diff --git a/cons_news.ipynb b/cons_news.ipynb index d3e4fcf..c977bfb 100644 --- a/cons_news.ipynb +++ b/cons_news.ipynb @@ -2,7 +2,7 @@ "cells": [ { "cell_type": "markdown", - "id": "0cc57f3c", + "id": "f5aab42f", "metadata": {}, "source": [ "\n", @@ -11,7 +11,7 @@ }, { "cell_type": "markdown", - "id": "9d2fb1cc", + "id": "a15f16e0", "metadata": {}, "source": [ "# Information and Consumption Smoothing\n", @@ -22,7 +22,7 @@ { "cell_type": "code", "execution_count": null, - "id": "b7718e99", + "id": "34f44583", "metadata": { "hide-output": false }, @@ -33,7 +33,7 @@ }, { "cell_type": "markdown", - "id": "403699c3", + "id": "3e29d69a", "metadata": {}, "source": [ "## Overview\n", @@ -59,7 +59,7 @@ }, { "cell_type": "markdown", - "id": "fb441d0b", + "id": "db256585", "metadata": {}, "source": [ "### Same non-financial incomes, different information\n", @@ -120,7 +120,7 @@ }, { "cell_type": "markdown", - "id": "fd705efd", + "id": "d7f11b70", "metadata": {}, "source": [ "## Two Representations of One Nonfinancial Income Process\n", @@ -251,7 +251,7 @@ }, { "cell_type": "markdown", - "id": "5c95646c", + "id": "c131319c", "metadata": {}, "source": [ "## Application of Kalman filter\n", @@ -299,7 +299,7 @@ }, { "cell_type": "markdown", - "id": "0736c2ff", + "id": "2402f367", "metadata": {}, "source": [ "## News Shocks and Less Informative Shocks\n", @@ -398,7 +398,7 @@ }, { "cell_type": "markdown", - "id": "5ed33206", + "id": "eee9bd06", "metadata": {}, "source": [ "## Representation of $ \\epsilon_t $ Shock in Terms of Future $ y_t $\n", @@ -430,7 +430,7 @@ }, { "cell_type": "markdown", - "id": "3ba8702e", + "id": "80b80392", "metadata": {}, "source": [ "## Representation in Terms of $ a_t $ Shocks\n", @@ -459,7 +459,7 @@ }, { "cell_type": "markdown", - "id": "3d5dcbfc", + "id": "ba8171a1", "metadata": {}, "source": [ "## Permanent Income Consumption-Smoothing Model\n", @@ -515,7 +515,7 @@ }, { "cell_type": "markdown", - "id": "ecb5ab66", + "id": "0b8beace", "metadata": {}, "source": [ "## State Space Representations\n", @@ -557,7 +557,7 @@ }, { "cell_type": "markdown", - "id": "86cd770d", + "id": "82628e6b", "metadata": {}, "source": [ "## Computations\n", @@ -678,7 +678,7 @@ { "cell_type": "code", "execution_count": null, - "id": "350aab4c", + "id": "4dafad9c", "metadata": { "hide-output": false }, @@ -692,7 +692,7 @@ { "cell_type": "code", "execution_count": null, - "id": "4f731667", + "id": "1e069a14", "metadata": { "hide-output": false }, @@ -714,7 +714,7 @@ { "cell_type": "code", "execution_count": null, - "id": "b8b5f4eb", + "id": "88a1de8b", "metadata": { "hide-output": false }, @@ -735,7 +735,7 @@ { "cell_type": "code", "execution_count": null, - "id": "813f5f49", + "id": "6d8c0c28", "metadata": { "hide-output": false }, @@ -747,7 +747,7 @@ }, { "cell_type": "markdown", - "id": "d4d401c6", + "id": "7e955311", "metadata": {}, "source": [ "Evidently, optimal consumption and debt decision rules for the consumer\n", @@ -766,7 +766,7 @@ { "cell_type": "code", "execution_count": null, - "id": "ee9e31a7", + "id": "52f0cc8e", "metadata": { "hide-output": false }, @@ -786,7 +786,7 @@ { "cell_type": "code", "execution_count": null, - "id": "2bb777f4", + "id": "9e07ab47", "metadata": { "hide-output": false }, @@ -797,7 +797,7 @@ }, { "cell_type": "markdown", - "id": "f3b19c7d", + "id": "cccc6d28", "metadata": {}, "source": [ "For a consumer having access only to the information associated with the\n", @@ -850,7 +850,7 @@ { "cell_type": "code", "execution_count": null, - "id": "b3aa4a98", + "id": "89665794", "metadata": { "hide-output": false }, @@ -870,7 +870,7 @@ }, { "cell_type": "markdown", - "id": "3c8b5b25", + "id": "74b714f2", "metadata": {}, "source": [ "The following code computes impulse response functions of\n", @@ -880,7 +880,7 @@ { "cell_type": "code", "execution_count": null, - "id": "b3180b09", + "id": "0d180b19", "metadata": { "hide-output": false }, @@ -900,7 +900,7 @@ { "cell_type": "code", "execution_count": null, - "id": "c77601fd", + "id": "5c2be829", "metadata": { "hide-output": false }, @@ -912,7 +912,7 @@ { "cell_type": "code", "execution_count": null, - "id": "a5a96309", + "id": "fc58720b", "metadata": { "hide-output": false }, @@ -926,7 +926,7 @@ }, { "cell_type": "markdown", - "id": "29e22539", + "id": "33960667", "metadata": {}, "source": [ "The above two impulse response functions show that when the consumer has\n", @@ -942,7 +942,7 @@ { "cell_type": "code", "execution_count": null, - "id": "310c5c55", + "id": "29c1a117", "metadata": { "hide-output": false }, @@ -954,7 +954,7 @@ { "cell_type": "code", "execution_count": null, - "id": "42a00276", + "id": "c733878d", "metadata": { "hide-output": false }, @@ -969,7 +969,7 @@ }, { "cell_type": "markdown", - "id": "c9557642", + "id": "74dcda43", "metadata": {}, "source": [ "The above impulse responses show that when the consumer has only the\n", @@ -993,7 +993,7 @@ { "cell_type": "code", "execution_count": null, - "id": "7115f5c9", + "id": "1d256c06", "metadata": { "hide-output": false }, @@ -1006,7 +1006,7 @@ { "cell_type": "code", "execution_count": null, - "id": "2f078feb", + "id": "d9f321a4", "metadata": { "hide-output": false }, @@ -1023,7 +1023,7 @@ { "cell_type": "code", "execution_count": null, - "id": "c1ae7898", + "id": "ff419fde", "metadata": { "hide-output": false }, @@ -1039,7 +1039,7 @@ }, { "cell_type": "markdown", - "id": "7a9065d0", + "id": "16b2dcf1", "metadata": {}, "source": [ "## Simulating Income Process and Two Associated Shock Processes\n", @@ -1078,7 +1078,7 @@ }, { "cell_type": "markdown", - "id": "fb07a734", + "id": "bb14c910", "metadata": {}, "source": [ "## Calculating Innovations in Another Way\n", @@ -1106,7 +1106,7 @@ }, { "cell_type": "markdown", - "id": "cd1d48c8", + "id": "9239949c", "metadata": {}, "source": [ "## Another Invertibility Issue\n", @@ -1120,7 +1120,7 @@ } ], "metadata": { - "date": 1734843461.1359966, + "date": 1735958030.842242, "filename": "cons_news.md", "kernelspec": { "display_name": "Python", diff --git a/discrete_dp.ipynb b/discrete_dp.ipynb index 6c2e6c0..0eb6ff5 100644 --- a/discrete_dp.ipynb +++ b/discrete_dp.ipynb @@ -2,7 +2,7 @@ "cells": [ { "cell_type": "markdown", - "id": "114f068f", + "id": "6f9110d3", "metadata": {}, "source": [ "\n", @@ -11,7 +11,7 @@ }, { "cell_type": "markdown", - "id": "5cdf3024", + "id": "68f4b8f3", "metadata": {}, "source": [ "# Discrete State Dynamic Programming\n", @@ -22,7 +22,7 @@ { "cell_type": "code", "execution_count": null, - "id": "7f0e81d1", + "id": "937c0fdc", "metadata": { "hide-output": false }, @@ -33,7 +33,7 @@ }, { "cell_type": "markdown", - "id": "2cc066ac", + "id": "7c864c9b", "metadata": {}, "source": [ "## Overview\n", @@ -73,7 +73,7 @@ { "cell_type": "code", "execution_count": null, - "id": "e4a2c48e", + "id": "be66a70e", "metadata": { "hide-output": false }, @@ -89,7 +89,7 @@ }, { "cell_type": "markdown", - "id": "a99d8762", + "id": "cdb4340b", "metadata": {}, "source": [ "### How to Read this Lecture\n", @@ -105,7 +105,7 @@ }, { "cell_type": "markdown", - "id": "22404d4e", + "id": "b484c768", "metadata": {}, "source": [ "### Code\n", @@ -124,7 +124,7 @@ }, { "cell_type": "markdown", - "id": "4e009d3b", + "id": "b2f3186c", "metadata": {}, "source": [ "### References\n", @@ -146,7 +146,7 @@ }, { "cell_type": "markdown", - "id": "0ea7b0d2", + "id": "48a8fd11", "metadata": {}, "source": [ "## Discrete DPs\n", @@ -185,7 +185,7 @@ }, { "cell_type": "markdown", - "id": "44aa1aa1", + "id": "13caa10b", "metadata": {}, "source": [ "### Policies\n", @@ -216,7 +216,7 @@ }, { "cell_type": "markdown", - "id": "6029c6cf", + "id": "5ae8fa78", "metadata": {}, "source": [ "### Formal Definition\n", @@ -279,7 +279,7 @@ }, { "cell_type": "markdown", - "id": "6e2b7c7b", + "id": "df753f13", "metadata": {}, "source": [ "### Value and Optimality\n", @@ -324,7 +324,7 @@ }, { "cell_type": "markdown", - "id": "dcc1a312", + "id": "40b8e6c0", "metadata": {}, "source": [ "### Two Operators\n", @@ -376,7 +376,7 @@ }, { "cell_type": "markdown", - "id": "1fb485b5", + "id": "d13ce83a", "metadata": {}, "source": [ "### The Bellman Equation and the Principle of Optimality\n", @@ -412,7 +412,7 @@ }, { "cell_type": "markdown", - "id": "4364f1f2", + "id": "7836c367", "metadata": {}, "source": [ "## Solving Discrete DPs\n", @@ -433,7 +433,7 @@ }, { "cell_type": "markdown", - "id": "45728cc8", + "id": "c85d8002", "metadata": {}, "source": [ "### Value Function Iteration\n", @@ -449,7 +449,7 @@ }, { "cell_type": "markdown", - "id": "8df8b33b", + "id": "50d43f2e", "metadata": {}, "source": [ "### Policy Function Iteration\n", @@ -472,7 +472,7 @@ }, { "cell_type": "markdown", - "id": "450408d3", + "id": "3ebdb2da", "metadata": {}, "source": [ "### Modified Policy Function Iteration\n", @@ -491,7 +491,7 @@ }, { "cell_type": "markdown", - "id": "bd3c51fd", + "id": "70e273e9", "metadata": {}, "source": [ "## Example: A Growth Model\n", @@ -523,7 +523,7 @@ }, { "cell_type": "markdown", - "id": "b389334c", + "id": "92faba40", "metadata": {}, "source": [ "### Discrete DP Representation\n", @@ -556,7 +556,7 @@ }, { "cell_type": "markdown", - "id": "50595d8b", + "id": "822aa21f", "metadata": {}, "source": [ "### Defining a DiscreteDP Instance\n", @@ -585,7 +585,7 @@ { "cell_type": "code", "execution_count": null, - "id": "0207c7f3", + "id": "f15db7b9", "metadata": { "hide-output": false }, @@ -636,7 +636,7 @@ }, { "cell_type": "markdown", - "id": "66315158", + "id": "f93504d2", "metadata": {}, "source": [ "Let’s run this code and create an instance of `SimpleOG`." @@ -645,7 +645,7 @@ { "cell_type": "code", "execution_count": null, - "id": "ba9500b0", + "id": "6d9a187d", "metadata": { "hide-output": false }, @@ -656,7 +656,7 @@ }, { "cell_type": "markdown", - "id": "8a2d236c", + "id": "5aac21d8", "metadata": {}, "source": [ "Instances of `DiscreteDP` are created using the signature `DiscreteDP(R, Q, β)`.\n", @@ -667,7 +667,7 @@ { "cell_type": "code", "execution_count": null, - "id": "708d7544", + "id": "10be6355", "metadata": { "hide-output": false }, @@ -678,7 +678,7 @@ }, { "cell_type": "markdown", - "id": "a333b18e", + "id": "9828b912", "metadata": {}, "source": [ "Now that we have an instance `ddp` of `DiscreteDP` we can solve it as follows" @@ -687,7 +687,7 @@ { "cell_type": "code", "execution_count": null, - "id": "68c025e3", + "id": "d4ba1985", "metadata": { "hide-output": false }, @@ -698,7 +698,7 @@ }, { "cell_type": "markdown", - "id": "210b66f3", + "id": "99909e8f", "metadata": {}, "source": [ "Let’s see what we’ve got here" @@ -707,7 +707,7 @@ { "cell_type": "code", "execution_count": null, - "id": "f63ba478", + "id": "67b8cf13", "metadata": { "hide-output": false }, @@ -718,7 +718,7 @@ }, { "cell_type": "markdown", - "id": "6509a0c5", + "id": "33e33e12", "metadata": {}, "source": [ "(In IPython version 4.0 and above you can also type `results.` and hit the tab key)\n", @@ -729,7 +729,7 @@ { "cell_type": "code", "execution_count": null, - "id": "083befb1", + "id": "c435930a", "metadata": { "hide-output": false }, @@ -741,7 +741,7 @@ { "cell_type": "code", "execution_count": null, - "id": "a88e0ab2", + "id": "a78d58a6", "metadata": { "hide-output": false }, @@ -752,7 +752,7 @@ }, { "cell_type": "markdown", - "id": "e3b939ba", + "id": "0ff4bfad", "metadata": {}, "source": [ "Since we’ve used policy iteration, these results will be exact unless we hit the iteration bound `max_iter`.\n", @@ -763,7 +763,7 @@ { "cell_type": "code", "execution_count": null, - "id": "bc6418b1", + "id": "d4474835", "metadata": { "hide-output": false }, @@ -775,7 +775,7 @@ { "cell_type": "code", "execution_count": null, - "id": "91854bb9", + "id": "8cc6a25b", "metadata": { "hide-output": false }, @@ -786,7 +786,7 @@ }, { "cell_type": "markdown", - "id": "4f8866ca", + "id": "e8e0362e", "metadata": {}, "source": [ "Another interesting object is `results.mc`, which is the controlled chain defined by $ Q_{\\sigma^*} $, where $ \\sigma^* $ is the optimal policy.\n", @@ -800,7 +800,7 @@ { "cell_type": "code", "execution_count": null, - "id": "21485591", + "id": "8bae8031", "metadata": { "hide-output": false }, @@ -811,7 +811,7 @@ }, { "cell_type": "markdown", - "id": "6a9ea430", + "id": "52af8925", "metadata": {}, "source": [ "Here’s the same information in a bar graph\n", @@ -825,7 +825,7 @@ { "cell_type": "code", "execution_count": null, - "id": "e696624a", + "id": "99816e79", "metadata": { "hide-output": false }, @@ -838,7 +838,7 @@ }, { "cell_type": "markdown", - "id": "5cf36bca", + "id": "54991077", "metadata": {}, "source": [ "If we look at the bar graph we can see the rightward shift in probability mass\n", @@ -848,7 +848,7 @@ }, { "cell_type": "markdown", - "id": "62676030", + "id": "64158fa9", "metadata": {}, "source": [ "### State-Action Pair Formulation\n", @@ -872,7 +872,7 @@ { "cell_type": "code", "execution_count": null, - "id": "bcdf18cc", + "id": "8b59b66f", "metadata": { "hide-output": false }, @@ -905,7 +905,7 @@ }, { "cell_type": "markdown", - "id": "843783db", + "id": "e5513f0d", "metadata": {}, "source": [ "For larger problems, you might need to write this code more efficiently by vectorizing or using Numba." @@ -913,7 +913,7 @@ }, { "cell_type": "markdown", - "id": "f2ba4a26", + "id": "c8f43054", "metadata": {}, "source": [ "## Exercises\n", @@ -925,7 +925,7 @@ }, { "cell_type": "markdown", - "id": "8205f7c5", + "id": "500157cc", "metadata": {}, "source": [ "## Solutions" @@ -933,7 +933,7 @@ }, { "cell_type": "markdown", - "id": "0fbc3737", + "id": "847c353e", "metadata": {}, "source": [ "### Setup\n", @@ -947,7 +947,7 @@ { "cell_type": "code", "execution_count": null, - "id": "e28f4402", + "id": "429a37b9", "metadata": { "hide-output": false }, @@ -961,7 +961,7 @@ }, { "cell_type": "markdown", - "id": "a180ee33", + "id": "8cee6204", "metadata": {}, "source": [ "Here we want to solve a finite state version of the continuous state model above.\n", @@ -972,7 +972,7 @@ { "cell_type": "code", "execution_count": null, - "id": "0904bd45", + "id": "096c3e24", "metadata": { "hide-output": false }, @@ -985,7 +985,7 @@ }, { "cell_type": "markdown", - "id": "2cebb4ba", + "id": "08fab72b", "metadata": {}, "source": [ "We choose the action to be the amount of capital to save for the next\n", @@ -1014,7 +1014,7 @@ { "cell_type": "code", "execution_count": null, - "id": "9a467a41", + "id": "7da5c673", "metadata": { "hide-output": false }, @@ -1036,7 +1036,7 @@ }, { "cell_type": "markdown", - "id": "a2446d3e", + "id": "1ae4b23d", "metadata": {}, "source": [ "Reward vector `R` (of length `L`):" @@ -1045,7 +1045,7 @@ { "cell_type": "code", "execution_count": null, - "id": "52a0debe", + "id": "0385afec", "metadata": { "hide-output": false }, @@ -1056,7 +1056,7 @@ }, { "cell_type": "markdown", - "id": "e1d47d76", + "id": "81396f1e", "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):" @@ -1065,7 +1065,7 @@ { "cell_type": "code", "execution_count": null, - "id": "0ee7a7dc", + "id": "d954f1f5", "metadata": { "hide-output": false }, @@ -1077,7 +1077,7 @@ }, { "cell_type": "markdown", - "id": "9371b662", + "id": "676c4240", "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", @@ -1087,7 +1087,7 @@ { "cell_type": "code", "execution_count": null, - "id": "9ad51261", + "id": "9a4ab2ac", "metadata": { "hide-output": false }, @@ -1100,7 +1100,7 @@ }, { "cell_type": "markdown", - "id": "648d3488", + "id": "61c3d9ab", "metadata": {}, "source": [ "Discrete growth model:" @@ -1109,7 +1109,7 @@ { "cell_type": "code", "execution_count": null, - "id": "f8d221f1", + "id": "fbfc1005", "metadata": { "hide-output": false }, @@ -1120,7 +1120,7 @@ }, { "cell_type": "markdown", - "id": "fbdc09c0", + "id": "8403739b", "metadata": {}, "source": [ "**Notes**\n", @@ -1132,7 +1132,7 @@ }, { "cell_type": "markdown", - "id": "161d0aa7", + "id": "13a973df", "metadata": {}, "source": [ "### Solving the Model\n", @@ -1143,7 +1143,7 @@ { "cell_type": "code", "execution_count": null, - "id": "7b3d300c", + "id": "000a1b57", "metadata": { "hide-output": false }, @@ -1156,7 +1156,7 @@ }, { "cell_type": "markdown", - "id": "236161d5", + "id": "90e894eb", "metadata": {}, "source": [ "Note that `sigma` contains the *indices* of the optimal *capital\n", @@ -1167,7 +1167,7 @@ { "cell_type": "code", "execution_count": null, - "id": "d356626d", + "id": "c83a81c0", "metadata": { "hide-output": false }, @@ -1190,7 +1190,7 @@ }, { "cell_type": "markdown", - "id": "f197b264", + "id": "edd4195d", "metadata": {}, "source": [ "Let us compare the solution of the discrete model with that of the\n", @@ -1200,7 +1200,7 @@ { "cell_type": "code", "execution_count": null, - "id": "925f47fc", + "id": "a43c2ddc", "metadata": { "hide-output": false }, @@ -1229,7 +1229,7 @@ }, { "cell_type": "markdown", - "id": "9b726155", + "id": "785543ef", "metadata": {}, "source": [ "The outcomes appear very close to those of the continuous version.\n", @@ -1240,7 +1240,7 @@ { "cell_type": "code", "execution_count": null, - "id": "0cead5ab", + "id": "14395fa7", "metadata": { "hide-output": false }, @@ -1252,7 +1252,7 @@ { "cell_type": "code", "execution_count": null, - "id": "b73d592d", + "id": "e519ef39", "metadata": { "hide-output": false }, @@ -1263,7 +1263,7 @@ }, { "cell_type": "markdown", - "id": "e095c13a", + "id": "83c58b09", "metadata": {}, "source": [ "The optimal consumption functions are close as well:" @@ -1272,7 +1272,7 @@ { "cell_type": "code", "execution_count": null, - "id": "cca6028d", + "id": "6e487f19", "metadata": { "hide-output": false }, @@ -1283,7 +1283,7 @@ }, { "cell_type": "markdown", - "id": "64d837ce", + "id": "1d26e3b4", "metadata": {}, "source": [ "In fact, the optimal consumption obtained in the discrete version is not\n", @@ -1293,7 +1293,7 @@ { "cell_type": "code", "execution_count": null, - "id": "09756283", + "id": "b2b87dde", "metadata": { "hide-output": false }, @@ -1306,7 +1306,7 @@ { "cell_type": "code", "execution_count": null, - "id": "446184cd", + "id": "3f1b41db", "metadata": { "hide-output": false }, @@ -1319,7 +1319,7 @@ { "cell_type": "code", "execution_count": null, - "id": "22026c12", + "id": "19790095", "metadata": { "hide-output": false }, @@ -1330,7 +1330,7 @@ }, { "cell_type": "markdown", - "id": "64558463", + "id": "4b9f458e", "metadata": {}, "source": [ "The value function is monotone:" @@ -1339,7 +1339,7 @@ { "cell_type": "code", "execution_count": null, - "id": "6cbc3c46", + "id": "8ded650e", "metadata": { "hide-output": false }, @@ -1350,7 +1350,7 @@ }, { "cell_type": "markdown", - "id": "1600636c", + "id": "2366dc4e", "metadata": {}, "source": [ "### Comparison of the Solution Methods\n", @@ -1360,7 +1360,7 @@ }, { "cell_type": "markdown", - "id": "ab307ca1", + "id": "30f9bc46", "metadata": {}, "source": [ "#### Value Iteration" @@ -1369,7 +1369,7 @@ { "cell_type": "code", "execution_count": null, - "id": "916b8332", + "id": "f8cea225", "metadata": { "hide-output": false }, @@ -1384,7 +1384,7 @@ { "cell_type": "code", "execution_count": null, - "id": "79d6768c", + "id": "1e3b8082", "metadata": { "hide-output": false }, @@ -1395,7 +1395,7 @@ }, { "cell_type": "markdown", - "id": "d2e447f9", + "id": "a722750f", "metadata": {}, "source": [ "#### Modified Policy Iteration" @@ -1404,7 +1404,7 @@ { "cell_type": "code", "execution_count": null, - "id": "75f7678a", + "id": "63ed49d2", "metadata": { "hide-output": false }, @@ -1417,7 +1417,7 @@ { "cell_type": "code", "execution_count": null, - "id": "71e065a0", + "id": "4e49326b", "metadata": { "hide-output": false }, @@ -1428,7 +1428,7 @@ }, { "cell_type": "markdown", - "id": "c81c5bd9", + "id": "6d15041e", "metadata": {}, "source": [ "#### Speed Comparison" @@ -1437,7 +1437,7 @@ { "cell_type": "code", "execution_count": null, - "id": "4141ef62", + "id": "cbde5c5c", "metadata": { "hide-output": false }, @@ -1450,7 +1450,7 @@ }, { "cell_type": "markdown", - "id": "4617172d", + "id": "950277fd", "metadata": {}, "source": [ "As is often the case, policy iteration and modified policy iteration are\n", @@ -1459,7 +1459,7 @@ }, { "cell_type": "markdown", - "id": "396b9d4e", + "id": "908973af", "metadata": {}, "source": [ "### Replication of the Figures\n", @@ -1469,7 +1469,7 @@ }, { "cell_type": "markdown", - "id": "ce049fd1", + "id": "b8f500ef", "metadata": {}, "source": [ "#### Convergence of Value Iteration\n", @@ -1482,7 +1482,7 @@ { "cell_type": "code", "execution_count": null, - "id": "889795bc", + "id": "f94e73d0", "metadata": { "hide-output": false }, @@ -1507,7 +1507,7 @@ }, { "cell_type": "markdown", - "id": "62ad0a46", + "id": "e0ffb9cd", "metadata": {}, "source": [ "We next plot the consumption policies along with the value iteration" @@ -1516,7 +1516,7 @@ { "cell_type": "code", "execution_count": null, - "id": "c57aa4c9", + "id": "97dad2ff", "metadata": { "hide-output": false }, @@ -1549,7 +1549,7 @@ }, { "cell_type": "markdown", - "id": "a8ee8f47", + "id": "23b77520", "metadata": {}, "source": [ "#### Dynamics of the Capital Stock\n", @@ -1564,7 +1564,7 @@ { "cell_type": "code", "execution_count": null, - "id": "a8e36da3", + "id": "8be3fe98", "metadata": { "hide-output": false }, @@ -1599,7 +1599,7 @@ }, { "cell_type": "markdown", - "id": "cc83700d", + "id": "8a89c679", "metadata": {}, "source": [ "\n", @@ -1608,7 +1608,7 @@ }, { "cell_type": "markdown", - "id": "0b3acec9", + "id": "c4d64dc4", "metadata": {}, "source": [ "## Appendix: Algorithms\n", @@ -1623,7 +1623,7 @@ }, { "cell_type": "markdown", - "id": "9aa1fc6d", + "id": "194c83ee", "metadata": {}, "source": [ "### Value Iteration\n", @@ -1650,7 +1650,7 @@ }, { "cell_type": "markdown", - "id": "71c2a99c", + "id": "f432da53", "metadata": {}, "source": [ "### Policy Iteration\n", @@ -1676,7 +1676,7 @@ }, { "cell_type": "markdown", - "id": "a3397e9e", + "id": "ad9322ad", "metadata": {}, "source": [ "### Modified Policy Iteration\n", @@ -1702,7 +1702,7 @@ } ], "metadata": { - "date": 1734843461.3484547, + "date": 1735958031.041776, "filename": "discrete_dp.md", "kernelspec": { "display_name": "Python", diff --git a/dyn_stack.ipynb b/dyn_stack.ipynb index cd07cd6..ff64f53 100644 --- a/dyn_stack.ipynb +++ b/dyn_stack.ipynb @@ -2,7 +2,7 @@ "cells": [ { "cell_type": "markdown", - "id": "e73f1cb8", + "id": "cf08dd2e", "metadata": {}, "source": [ "\n", @@ -11,7 +11,7 @@ }, { "cell_type": "markdown", - "id": "6a5d764a", + "id": "12bafc2e", "metadata": {}, "source": [ "# Stackelberg Plans\n", @@ -22,7 +22,7 @@ { "cell_type": "code", "execution_count": null, - "id": "91958a5d", + "id": "501cb8b6", "metadata": { "hide-output": false }, @@ -33,7 +33,7 @@ }, { "cell_type": "markdown", - "id": "a1177322", + "id": "3e9078c2", "metadata": {}, "source": [ "## Overview\n", @@ -58,7 +58,7 @@ { "cell_type": "code", "execution_count": null, - "id": "63ecf425", + "id": "26d9965c", "metadata": { "hide-output": false }, @@ -73,7 +73,7 @@ }, { "cell_type": "markdown", - "id": "e2649a87", + "id": "efe77e8d", "metadata": {}, "source": [ "## Duopoly\n", @@ -123,7 +123,7 @@ }, { "cell_type": "markdown", - "id": "f5af5fcb", + "id": "2d29b21b", "metadata": {}, "source": [ "### Stackelberg Leader and Follower\n", @@ -149,7 +149,7 @@ }, { "cell_type": "markdown", - "id": "87858052", + "id": "1fddcff6", "metadata": {}, "source": [ "### Statement of Leader’s and Follower’s Problems\n", @@ -201,7 +201,7 @@ }, { "cell_type": "markdown", - "id": "8ad23b5d", + "id": "d7715340", "metadata": {}, "source": [ "### Firms’ Problems\n", @@ -358,7 +358,7 @@ }, { "cell_type": "markdown", - "id": "55be4fda", + "id": "9efb059f", "metadata": {}, "source": [ "## Stackelberg Problem\n", @@ -445,7 +445,7 @@ }, { "cell_type": "markdown", - "id": "1df719d1", + "id": "dff59d8a", "metadata": {}, "source": [ "### Interpretation of Second Block of Equations\n", @@ -480,7 +480,7 @@ }, { "cell_type": "markdown", - "id": "774c3506", + "id": "b70df873", "metadata": {}, "source": [ "### More Mechanical Details\n", @@ -507,7 +507,7 @@ }, { "cell_type": "markdown", - "id": "fe7a6a83", + "id": "b12bc6ce", "metadata": {}, "source": [ "### Two Subproblems\n", @@ -556,7 +556,7 @@ }, { "cell_type": "markdown", - "id": "c51cf308", + "id": "4e0c0212", "metadata": {}, "source": [ "## Two Bellman Equations\n", @@ -627,7 +627,7 @@ }, { "cell_type": "markdown", - "id": "6db00b34", + "id": "da12e007", "metadata": {}, "source": [ "## Stackelberg Plan for Duopoly\n", @@ -672,7 +672,7 @@ }, { "cell_type": "markdown", - "id": "5ba251b7", + "id": "0e516de0", "metadata": {}, "source": [ "### Calculations to Prepare Duopoly Model\n", @@ -690,7 +690,7 @@ }, { "cell_type": "markdown", - "id": "fc17b7a6", + "id": "fe11ccc8", "metadata": {}, "source": [ "### Firm 1’s Problem\n", @@ -788,7 +788,7 @@ }, { "cell_type": "markdown", - "id": "47b30e52", + "id": "d7d56a42", "metadata": {}, "source": [ "## Recursive Representation of Stackelberg Plan\n", @@ -879,7 +879,7 @@ }, { "cell_type": "markdown", - "id": "8e9ff2d6", + "id": "5424dbf8", "metadata": {}, "source": [ "### Comments and Interpretations\n", @@ -899,7 +899,7 @@ }, { "cell_type": "markdown", - "id": "58975e8d", + "id": "590f3ee3", "metadata": {}, "source": [ "## Dynamic Programming and Time Consistency of Follower’s Problem\n", @@ -918,7 +918,7 @@ }, { "cell_type": "markdown", - "id": "ae18e59f", + "id": "c3b17cd5", "metadata": {}, "source": [ "### Recursive Formulation of a Follower’s Problem\n", @@ -1041,7 +1041,7 @@ }, { "cell_type": "markdown", - "id": "d8e38cd4", + "id": "d0290181", "metadata": {}, "source": [ "### Time Consistency of Follower’s Plan\n", @@ -1059,7 +1059,7 @@ }, { "cell_type": "markdown", - "id": "48c48f67", + "id": "56836f02", "metadata": {}, "source": [ "## Computing Stackelberg Plan\n", @@ -1073,7 +1073,7 @@ { "cell_type": "code", "execution_count": null, - "id": "cd2a06c8", + "id": "a8614b94", "metadata": { "hide-output": false }, @@ -1097,7 +1097,7 @@ { "cell_type": "code", "execution_count": null, - "id": "31b883d1", + "id": "f7ad699f", "metadata": { "hide-output": false }, @@ -1157,7 +1157,7 @@ }, { "cell_type": "markdown", - "id": "61e226be", + "id": "d62292ca", "metadata": {}, "source": [ "## Time Series for Price and Quantities\n", @@ -1170,7 +1170,7 @@ { "cell_type": "code", "execution_count": null, - "id": "1660dc3e", + "id": "eafa17fd", "metadata": { "hide-output": false }, @@ -1193,7 +1193,7 @@ }, { "cell_type": "markdown", - "id": "942545b7", + "id": "787fe6a1", "metadata": {}, "source": [ "### Value of Stackelberg Leader\n", @@ -1208,7 +1208,7 @@ { "cell_type": "code", "execution_count": null, - "id": "11aecdf4", + "id": "38ecd8a5", "metadata": { "hide-output": false }, @@ -1226,7 +1226,7 @@ { "cell_type": "code", "execution_count": null, - "id": "923cbf1a", + "id": "6c474a3e", "metadata": { "hide-output": false }, @@ -1240,7 +1240,7 @@ { "cell_type": "code", "execution_count": null, - "id": "a4755065", + "id": "80a7b6be", "metadata": { "hide-output": false }, @@ -1255,7 +1255,7 @@ }, { "cell_type": "markdown", - "id": "de9f0ce8", + "id": "5862a2bb", "metadata": {}, "source": [ "## Time Inconsistency of Stackelberg Plan\n", @@ -1275,7 +1275,7 @@ { "cell_type": "code", "execution_count": null, - "id": "b8930c26", + "id": "cf001fca", "metadata": { "hide-output": false }, @@ -1296,7 +1296,7 @@ { "cell_type": "code", "execution_count": null, - "id": "0efc3b23", + "id": "a52d1a8f", "metadata": { "hide-output": false }, @@ -1325,7 +1325,7 @@ }, { "cell_type": "markdown", - "id": "ef726b91", + "id": "ec95b7b9", "metadata": {}, "source": [ "The figure above shows\n", @@ -1340,7 +1340,7 @@ }, { "cell_type": "markdown", - "id": "c0b3da04", + "id": "207e3fd2", "metadata": {}, "source": [ "## Recursive Formulation of Follower’s Problem\n", @@ -1355,7 +1355,7 @@ { "cell_type": "code", "execution_count": null, - "id": "3daffad6", + "id": "0f322661", "metadata": { "hide-output": false }, @@ -1383,7 +1383,7 @@ { "cell_type": "code", "execution_count": null, - "id": "4c366995", + "id": "65536325", "metadata": { "hide-output": false }, @@ -1400,7 +1400,7 @@ }, { "cell_type": "markdown", - "id": "961f0618", + "id": "d719472f", "metadata": {}, "source": [ "Note: Variables with `_tilde` are obtained from solving the follower’s\n", @@ -1410,7 +1410,7 @@ { "cell_type": "code", "execution_count": null, - "id": "3d4841c9", + "id": "e96d5ecb", "metadata": { "hide-output": false }, @@ -1424,7 +1424,7 @@ { "cell_type": "code", "execution_count": null, - "id": "8cf25cf6", + "id": "14d00dfa", "metadata": { "hide-output": false }, @@ -1436,7 +1436,7 @@ }, { "cell_type": "markdown", - "id": "178bf618", + "id": "3787534a", "metadata": {}, "source": [ "### Explanation of Alignment\n", @@ -1454,7 +1454,7 @@ { "cell_type": "code", "execution_count": null, - "id": "fa9d6f30", + "id": "120ec630", "metadata": { "hide-output": false }, @@ -1467,7 +1467,7 @@ { "cell_type": "code", "execution_count": null, - "id": "571d76d2", + "id": "1e55bf64", "metadata": { "hide-output": false }, @@ -1480,7 +1480,7 @@ { "cell_type": "code", "execution_count": null, - "id": "4c494bb9", + "id": "50d734ca", "metadata": { "hide-output": false }, @@ -1493,7 +1493,7 @@ { "cell_type": "code", "execution_count": null, - "id": "629e6a02", + "id": "975e9082", "metadata": { "hide-output": false }, @@ -1506,7 +1506,7 @@ { "cell_type": "code", "execution_count": null, - "id": "7c09bdc3", + "id": "dcec3dfd", "metadata": { "hide-output": false }, @@ -1525,7 +1525,7 @@ { "cell_type": "code", "execution_count": null, - "id": "a0bed495", + "id": "276242b0", "metadata": { "hide-output": false }, @@ -1538,7 +1538,7 @@ { "cell_type": "code", "execution_count": null, - "id": "94aa0b65", + "id": "53f764ed", "metadata": { "hide-output": false }, @@ -1551,7 +1551,7 @@ { "cell_type": "code", "execution_count": null, - "id": "0cb6514b", + "id": "2a4c8bc9", "metadata": { "hide-output": false }, @@ -1594,7 +1594,7 @@ { "cell_type": "code", "execution_count": null, - "id": "54ca3577", + "id": "5ec81f0f", "metadata": { "hide-output": false }, @@ -1620,7 +1620,7 @@ { "cell_type": "code", "execution_count": null, - "id": "2562f117", + "id": "6ae6f472", "metadata": { "hide-output": false }, @@ -1632,7 +1632,7 @@ }, { "cell_type": "markdown", - "id": "0a185de4", + "id": "af232488", "metadata": {}, "source": [ "## Markov Perfect Equilibrium\n", @@ -1672,7 +1672,7 @@ { "cell_type": "code", "execution_count": null, - "id": "04ffe12e", + "id": "a04b3813", "metadata": { "hide-output": false }, @@ -1715,7 +1715,7 @@ { "cell_type": "code", "execution_count": null, - "id": "361a130c", + "id": "8f6aa4e8", "metadata": { "hide-output": false }, @@ -1738,7 +1738,7 @@ { "cell_type": "code", "execution_count": null, - "id": "55e0e7c0", + "id": "5a98e22e", "metadata": { "hide-output": false }, @@ -1751,7 +1751,7 @@ { "cell_type": "code", "execution_count": null, - "id": "7858f0e7", + "id": "bb2527fa", "metadata": { "hide-output": false }, @@ -1779,7 +1779,7 @@ { "cell_type": "code", "execution_count": null, - "id": "de3ffa07", + "id": "56c2ce6b", "metadata": { "hide-output": false }, @@ -1797,7 +1797,7 @@ }, { "cell_type": "markdown", - "id": "15a5affb", + "id": "48c1ad37", "metadata": {}, "source": [ "## Comparing Markov Perfect Equilibrium and Stackelberg Outcome\n", @@ -1815,7 +1815,7 @@ { "cell_type": "code", "execution_count": null, - "id": "c3be753a", + "id": "90d81455", "metadata": { "hide-output": false }, @@ -1841,7 +1841,7 @@ { "cell_type": "code", "execution_count": null, - "id": "4e70d5cb", + "id": "bd69fc76", "metadata": { "hide-output": false }, @@ -1857,7 +1857,7 @@ { "cell_type": "code", "execution_count": null, - "id": "49de73a4", + "id": "db2a96d0", "metadata": { "hide-output": false }, @@ -1869,7 +1869,7 @@ } ], "metadata": { - "date": 1734843461.4055622, + "date": 1735958031.1001422, "filename": "dyn_stack.md", "kernelspec": { "display_name": "Python", diff --git a/entropy.ipynb b/entropy.ipynb index 1529aed..4ea0646 100644 --- a/entropy.ipynb +++ b/entropy.ipynb @@ -2,7 +2,7 @@ "cells": [ { "cell_type": "markdown", - "id": "3617261a", + "id": "c08c6a34", "metadata": {}, "source": [ "# Etymology of Entropy\n", @@ -26,7 +26,7 @@ }, { "cell_type": "markdown", - "id": "ae82b6fa", + "id": "0ee0e475", "metadata": {}, "source": [ "## Information Theory\n", @@ -65,7 +65,7 @@ }, { "cell_type": "markdown", - "id": "e6b8fc27", + "id": "ea31d140", "metadata": {}, "source": [ "## A Measure of Unpredictability\n", @@ -85,7 +85,7 @@ }, { "cell_type": "markdown", - "id": "49eb8798", + "id": "bbe0344a", "metadata": {}, "source": [ "### Example\n", @@ -119,7 +119,7 @@ }, { "cell_type": "markdown", - "id": "e041446e", + "id": "caf8d50a", "metadata": {}, "source": [ "### Example\n", @@ -142,7 +142,7 @@ }, { "cell_type": "markdown", - "id": "b71380cc", + "id": "82bcb65e", "metadata": {}, "source": [ "## Mathematical Properties of Entropy\n", @@ -160,7 +160,7 @@ }, { "cell_type": "markdown", - "id": "cae4893e", + "id": "04708c21", "metadata": {}, "source": [ "## Conditional Entropy\n", @@ -182,7 +182,7 @@ }, { "cell_type": "markdown", - "id": "f87b0bba", + "id": "77bdd09e", "metadata": {}, "source": [ "## Independence as Maximum Conditional Entropy\n", @@ -212,7 +212,7 @@ }, { "cell_type": "markdown", - "id": "f7d05f69", + "id": "8507e544", "metadata": {}, "source": [ "## Thermodynamics\n", @@ -235,7 +235,7 @@ }, { "cell_type": "markdown", - "id": "afd26f26", + "id": "72703bc8", "metadata": {}, "source": [ "## Statistical Divergence\n", @@ -270,7 +270,7 @@ }, { "cell_type": "markdown", - "id": "6dc4e9cb", + "id": "4ffbfb08", "metadata": {}, "source": [ "## Continuous distributions\n", @@ -284,7 +284,7 @@ }, { "cell_type": "markdown", - "id": "9bdc1303", + "id": "b80f8ebd", "metadata": {}, "source": [ "## Relative entropy and Gaussian distributions\n", @@ -375,7 +375,7 @@ }, { "cell_type": "markdown", - "id": "62464a5d", + "id": "abcf2cac", "metadata": {}, "source": [ "## Von Neumann Entropy\n", @@ -401,7 +401,7 @@ }, { "cell_type": "markdown", - "id": "730be088", + "id": "d6e43434", "metadata": {}, "source": [ "## Backus-Chernov-Zin Entropy\n", @@ -453,7 +453,7 @@ }, { "cell_type": "markdown", - "id": "853441c3", + "id": "e672e72c", "metadata": {}, "source": [ "## Wiener-Kolmogorov Prediction Error Formula as Entropy\n", @@ -500,7 +500,7 @@ }, { "cell_type": "markdown", - "id": "3cc5a545", + "id": "7d4f88f9", "metadata": {}, "source": [ "## Multivariate Processes\n", @@ -537,7 +537,7 @@ }, { "cell_type": "markdown", - "id": "bdc814fa", + "id": "4d06d345", "metadata": {}, "source": [ "## Frequency Domain Robust Control\n", @@ -570,7 +570,7 @@ }, { "cell_type": "markdown", - "id": "1d7b1dd9", + "id": "d2bb35d1", "metadata": {}, "source": [ "## Relative Entropy for a Continuous Random Variable\n", @@ -610,7 +610,7 @@ } ], "metadata": { - "date": 1734843461.459578, + "date": 1735958031.1558423, "filename": "entropy.md", "kernelspec": { "display_name": "Python", diff --git a/estspec.ipynb b/estspec.ipynb index 86957bb..4b31c5b 100644 --- a/estspec.ipynb +++ b/estspec.ipynb @@ -2,7 +2,7 @@ "cells": [ { "cell_type": "markdown", - "id": "29e8f03b", + "id": "b2b0270f", "metadata": {}, "source": [ "\n", @@ -11,7 +11,7 @@ }, { "cell_type": "markdown", - "id": "3c3f8e0a", + "id": "eb7f8391", "metadata": {}, "source": [ "# Estimation of Spectra\n", @@ -24,7 +24,7 @@ { "cell_type": "code", "execution_count": null, - "id": "a67777da", + "id": "4ff94998", "metadata": { "hide-output": false }, @@ -35,7 +35,7 @@ }, { "cell_type": "markdown", - "id": "45a45c74", + "id": "b57a5c9a", "metadata": {}, "source": [ "## Overview\n", @@ -61,7 +61,7 @@ { "cell_type": "code", "execution_count": null, - "id": "3c051cab", + "id": "c01b42b6", "metadata": { "hide-output": false }, @@ -74,7 +74,7 @@ }, { "cell_type": "markdown", - "id": "50a0f124", + "id": "7fe53b0a", "metadata": {}, "source": [ "\n", @@ -83,7 +83,7 @@ }, { "cell_type": "markdown", - "id": "565c0200", + "id": "5356943d", "metadata": {}, "source": [ "## Periodograms\n", @@ -136,7 +136,7 @@ }, { "cell_type": "markdown", - "id": "08e70a51", + "id": "3f891aa9", "metadata": {}, "source": [ "### Interpretation\n", @@ -203,7 +203,7 @@ }, { "cell_type": "markdown", - "id": "d6380d99", + "id": "4fa49732", "metadata": {}, "source": [ "### Calculation\n", @@ -261,7 +261,7 @@ { "cell_type": "code", "execution_count": null, - "id": "2cfd4aa4", + "id": "fea4ce19", "metadata": { "hide-output": false }, @@ -283,7 +283,7 @@ }, { "cell_type": "markdown", - "id": "0d0e0d9f", + "id": "e0f4a8b6", "metadata": {}, "source": [ "This estimate looks rather disappointing, but the data size is only 40, so\n", @@ -301,7 +301,7 @@ }, { "cell_type": "markdown", - "id": "653ea02d", + "id": "9ff4f2d5", "metadata": {}, "source": [ "## Smoothing\n", @@ -354,7 +354,7 @@ { "cell_type": "code", "execution_count": null, - "id": "920545b4", + "id": "84179640", "metadata": { "hide-output": false }, @@ -376,7 +376,7 @@ }, { "cell_type": "markdown", - "id": "4b4eb95e", + "id": "9af1a96e", "metadata": {}, "source": [ "### Estimation with Smoothing\n", @@ -422,7 +422,7 @@ }, { "cell_type": "markdown", - "id": "d67d2490", + "id": "c0935d92", "metadata": {}, "source": [ "### Pre-Filtering and Smoothing\n", @@ -472,7 +472,7 @@ }, { "cell_type": "markdown", - "id": "2fd221f2", + "id": "399b9690", "metadata": {}, "source": [ "### The AR(1) Setting\n", @@ -548,7 +548,7 @@ }, { "cell_type": "markdown", - "id": "ad199060", + "id": "15b64a9e", "metadata": {}, "source": [ "## Exercises\n", @@ -559,7 +559,7 @@ }, { "cell_type": "markdown", - "id": "738a8899", + "id": "d001ee0a", "metadata": {}, "source": [ "## Exercise 30.1\n", @@ -573,7 +573,7 @@ }, { "cell_type": "markdown", - "id": "ebcd94e1", + "id": "ace48f0b", "metadata": {}, "source": [ "## Solution to[ Exercise 30.1](https://python-advanced.quantecon.org/#est_ex1)" @@ -582,7 +582,7 @@ { "cell_type": "code", "execution_count": null, - "id": "16487226", + "id": "3faf71f3", "metadata": { "hide-output": false }, @@ -615,7 +615,7 @@ }, { "cell_type": "markdown", - "id": "c4fafd20", + "id": "570893ca", "metadata": {}, "source": [ "\n", @@ -624,7 +624,7 @@ }, { "cell_type": "markdown", - "id": "cdbde242", + "id": "33d6c24a", "metadata": {}, "source": [ "## Exercise 30.2\n", @@ -639,7 +639,7 @@ }, { "cell_type": "markdown", - "id": "7b5c3e15", + "id": "cd6ccd33", "metadata": {}, "source": [ "## Solution to[ Exercise 30.2](https://python-advanced.quantecon.org/#est_ex2)" @@ -648,7 +648,7 @@ { "cell_type": "code", "execution_count": null, - "id": "ec027e32", + "id": "e602a961", "metadata": { "hide-output": false }, @@ -682,7 +682,7 @@ } ], "metadata": { - "date": 1734843461.6268868, + "date": 1735958031.1811295, "filename": "estspec.md", "kernelspec": { "display_name": "Python", diff --git a/five_preferences.ipynb b/five_preferences.ipynb index 4ba58dd..e3bb2b4 100644 --- a/five_preferences.ipynb +++ b/five_preferences.ipynb @@ -2,7 +2,7 @@ "cells": [ { "cell_type": "markdown", - "id": "21d65c11", + "id": "a0c834f7", "metadata": {}, "source": [ "# Risk and Model Uncertainty" @@ -10,7 +10,7 @@ }, { "cell_type": "markdown", - "id": "bf686f03", + "id": "c5660ca8", "metadata": {}, "source": [ "## Overview\n", @@ -56,7 +56,7 @@ { "cell_type": "code", "execution_count": null, - "id": "6794c241", + "id": "4f5f0cd8", "metadata": { "hide-output": false }, @@ -78,7 +78,7 @@ { "cell_type": "code", "execution_count": null, - "id": "b2bcf873", + "id": "8ce952bf", "metadata": { "hide-output": false }, @@ -106,7 +106,7 @@ { "cell_type": "code", "execution_count": null, - "id": "5e568ff6", + "id": "4c2ef3b0", "metadata": { "hide-output": false }, @@ -164,7 +164,7 @@ }, { "cell_type": "markdown", - "id": "e1e411bc", + "id": "7f152d18", "metadata": {}, "source": [ "## Basic objects\n", @@ -229,7 +229,7 @@ { "cell_type": "code", "execution_count": null, - "id": "9e2d8557", + "id": "b7cdefd4", "metadata": { "hide-output": false }, @@ -261,7 +261,7 @@ { "cell_type": "code", "execution_count": null, - "id": "baab782a", + "id": "04750606", "metadata": { "hide-output": false }, @@ -276,7 +276,7 @@ }, { "cell_type": "markdown", - "id": "cb114f4d", + "id": "e50974a4", "metadata": {}, "source": [ "The heat maps in the next two figures vary both $ \\hat{\\pi}_1 $ and $ \\pi_1 $.\n", @@ -287,7 +287,7 @@ { "cell_type": "code", "execution_count": null, - "id": "b1fad4bc", + "id": "3c1e9aba", "metadata": { "hide-output": false }, @@ -316,7 +316,7 @@ { "cell_type": "code", "execution_count": null, - "id": "98169ad8", + "id": "4c54cddb", "metadata": { "hide-output": false }, @@ -334,7 +334,7 @@ }, { "cell_type": "markdown", - "id": "d2996438", + "id": "ba0602ce", "metadata": {}, "source": [ "The next figure plots the logarithm of entropy." @@ -343,7 +343,7 @@ { "cell_type": "code", "execution_count": null, - "id": "ff9629ab", + "id": "77e9c20b", "metadata": { "hide-output": false }, @@ -358,7 +358,7 @@ { "cell_type": "code", "execution_count": null, - "id": "7da76db4", + "id": "f2cc313e", "metadata": { "hide-output": false }, @@ -375,7 +375,7 @@ }, { "cell_type": "markdown", - "id": "b7e32495", + "id": "2eadbe93", "metadata": {}, "source": [ "## Five preference specifications\n", @@ -400,7 +400,7 @@ }, { "cell_type": "markdown", - "id": "d65e2277", + "id": "80be062f", "metadata": {}, "source": [ "## Expected utility\n", @@ -422,7 +422,7 @@ }, { "cell_type": "markdown", - "id": "aa0783a1", + "id": "0496073b", "metadata": {}, "source": [ "## Constraint preferences\n", @@ -547,7 +547,7 @@ }, { "cell_type": "markdown", - "id": "d4f7390a", + "id": "4f2a5d65", "metadata": {}, "source": [ "## Multiplier preferences\n", @@ -610,7 +610,7 @@ }, { "cell_type": "markdown", - "id": "f56337bc", + "id": "7520fba8", "metadata": {}, "source": [ "## Risk-sensitive preferences\n", @@ -639,7 +639,7 @@ { "cell_type": "code", "execution_count": null, - "id": "f87b6727", + "id": "87bebb3b", "metadata": { "hide-output": false }, @@ -671,7 +671,7 @@ { "cell_type": "code", "execution_count": null, - "id": "3415f9f4", + "id": "980b41ab", "metadata": { "hide-output": false }, @@ -687,7 +687,7 @@ }, { "cell_type": "markdown", - "id": "f30e1671", + "id": "419fde5e", "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", @@ -702,7 +702,7 @@ { "cell_type": "code", "execution_count": null, - "id": "883de164", + "id": "53def404", "metadata": { "hide-output": false }, @@ -745,7 +745,7 @@ { "cell_type": "code", "execution_count": null, - "id": "e4bd8536", + "id": "743fe003", "metadata": { "hide-output": false }, @@ -788,7 +788,7 @@ }, { "cell_type": "markdown", - "id": "61e664fc", + "id": "008d685e", "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", @@ -809,7 +809,7 @@ }, { "cell_type": "markdown", - "id": "c8a02bea", + "id": "c799729c", "metadata": {}, "source": [ "### Digression on moment generating functions\n", @@ -861,7 +861,7 @@ }, { "cell_type": "markdown", - "id": "9a9d71d4", + "id": "5a2fc457", "metadata": {}, "source": [ "## Ex post Bayesian preferences\n", @@ -881,7 +881,7 @@ }, { "cell_type": "markdown", - "id": "5290d918", + "id": "cee0a763", "metadata": {}, "source": [ "## Comparing preferences\n", @@ -906,7 +906,7 @@ { "cell_type": "code", "execution_count": null, - "id": "05fbe48a", + "id": "0f14b6b4", "metadata": { "hide-output": false }, @@ -936,7 +936,7 @@ { "cell_type": "code", "execution_count": null, - "id": "b0060a25", + "id": "f4fec896", "metadata": { "hide-output": false }, @@ -955,7 +955,7 @@ }, { "cell_type": "markdown", - "id": "c0a9da4d", + "id": "1fc8d071", "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", @@ -967,7 +967,7 @@ { "cell_type": "code", "execution_count": null, - "id": "a1d9c8de", + "id": "79db8c06", "metadata": { "hide-output": false }, @@ -995,7 +995,7 @@ { "cell_type": "code", "execution_count": null, - "id": "4bf987b6", + "id": "797078c6", "metadata": { "hide-output": false }, @@ -1033,7 +1033,7 @@ }, { "cell_type": "markdown", - "id": "b903c253", + "id": "ffba9ba3", "metadata": {}, "source": [ "Evidently, from this figure and also from formula [(25.12)](#equation-tom12), lower values of $ \\theta $ lead to lower,\n", @@ -1061,7 +1061,7 @@ }, { "cell_type": "markdown", - "id": "9b027f85", + "id": "ad56266a", "metadata": {}, "source": [ "## Risk aversion and misspecification aversion\n", @@ -1112,7 +1112,7 @@ }, { "cell_type": "markdown", - "id": "0d05baf3", + "id": "e2c90721", "metadata": {}, "source": [ "## Indifference curves\n", @@ -1156,7 +1156,7 @@ { "cell_type": "code", "execution_count": null, - "id": "49f5a7bb", + "id": "a757d07c", "metadata": { "hide-output": false }, @@ -1277,7 +1277,7 @@ { "cell_type": "code", "execution_count": null, - "id": "0d1df926", + "id": "301eceaa", "metadata": { "hide-output": false }, @@ -1325,7 +1325,7 @@ { "cell_type": "code", "execution_count": null, - "id": "41161f6c", + "id": "4e4b3fbc", "metadata": { "hide-output": false }, @@ -1353,7 +1353,7 @@ }, { "cell_type": "markdown", - "id": "ae8a499a", + "id": "e5def371", "metadata": {}, "source": [ "**Kink at 45 degree line**\n", @@ -1423,7 +1423,7 @@ { "cell_type": "code", "execution_count": null, - "id": "97e3bbc9", + "id": "ce4b6238", "metadata": { "hide-output": false }, @@ -1472,7 +1472,7 @@ { "cell_type": "code", "execution_count": null, - "id": "f645cb87", + "id": "60aa3289", "metadata": { "hide-output": false }, @@ -1500,7 +1500,7 @@ }, { "cell_type": "markdown", - "id": "6980eb09", + "id": "1b9e2856", "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", @@ -1537,7 +1537,7 @@ }, { "cell_type": "markdown", - "id": "a4ca82ea", + "id": "169d3d7b", "metadata": {}, "source": [ "## State price deflators\n", @@ -1577,7 +1577,7 @@ { "cell_type": "code", "execution_count": null, - "id": "52b72f4a", + "id": "68063f5c", "metadata": { "hide-output": false }, @@ -1607,7 +1607,7 @@ { "cell_type": "code", "execution_count": null, - "id": "ce239009", + "id": "2bf74707", "metadata": { "hide-output": false }, @@ -1630,7 +1630,7 @@ }, { "cell_type": "markdown", - "id": "6022e2fd", + "id": "13b1f400", "metadata": {}, "source": [ "Because budget constraints are linear, asset prices are identical under\n", @@ -1648,7 +1648,7 @@ }, { "cell_type": "markdown", - "id": "ce6ae87e", + "id": "af0d08d9", "metadata": {}, "source": [ "### Consumption-equivalent measures of uncertainty aversion\n", @@ -1663,7 +1663,7 @@ { "cell_type": "code", "execution_count": null, - "id": "8eda43bf", + "id": "bc5d53c0", "metadata": { "hide-output": false }, @@ -1695,7 +1695,7 @@ { "cell_type": "code", "execution_count": null, - "id": "cc791744", + "id": "f7f2e7fa", "metadata": { "hide-output": false }, @@ -1732,7 +1732,7 @@ }, { "cell_type": "markdown", - "id": "637a08bf", + "id": "79a97180", "metadata": {}, "source": [ "The figure indicates that the certainty equivalent\n", @@ -1760,7 +1760,7 @@ }, { "cell_type": "markdown", - "id": "856d0546", + "id": "ba3cad15", "metadata": {}, "source": [ "## Iso-utility and iso-entropy curves and expansion paths\n", @@ -1794,7 +1794,7 @@ { "cell_type": "code", "execution_count": null, - "id": "9907fff3", + "id": "9824fe6b", "metadata": { "hide-output": false }, @@ -1843,7 +1843,7 @@ { "cell_type": "code", "execution_count": null, - "id": "92e60fbb", + "id": "992599d6", "metadata": { "hide-output": false }, @@ -1918,7 +1918,7 @@ { "cell_type": "code", "execution_count": null, - "id": "6a1232af", + "id": "90c26d65", "metadata": { "hide-output": false }, @@ -1932,7 +1932,7 @@ { "cell_type": "code", "execution_count": null, - "id": "edf9f061", + "id": "c9539ca1", "metadata": { "hide-output": false }, @@ -1945,7 +1945,7 @@ }, { "cell_type": "markdown", - "id": "55c6da41", + "id": "740cde26", "metadata": {}, "source": [ "## Bounds on expected utility\n", @@ -2008,7 +2008,7 @@ { "cell_type": "code", "execution_count": null, - "id": "0724e175", + "id": "3c6dc184", "metadata": { "hide-output": false }, @@ -2074,7 +2074,7 @@ { "cell_type": "code", "execution_count": null, - "id": "4d9b62f4", + "id": "63f5faa9", "metadata": { "hide-output": false }, @@ -2101,7 +2101,7 @@ { "cell_type": "code", "execution_count": null, - "id": "094bb49c", + "id": "ee37291c", "metadata": { "hide-output": false }, @@ -2117,7 +2117,7 @@ { "cell_type": "code", "execution_count": null, - "id": "e65c8c4a", + "id": "a13b4bc0", "metadata": { "hide-output": false }, @@ -2134,7 +2134,7 @@ }, { "cell_type": "markdown", - "id": "2ac02edb", + "id": "3b850ea3", "metadata": {}, "source": [ "In this figure, expected utility is on the co-ordinate axis\n", @@ -2184,7 +2184,7 @@ }, { "cell_type": "markdown", - "id": "7f815245", + "id": "33de0676", "metadata": {}, "source": [ "## Why entropy?\n", @@ -2202,7 +2202,7 @@ }, { "cell_type": "markdown", - "id": "258caa62", + "id": "b9f106e3", "metadata": {}, "source": [ "### Entropy and statistical detection\n", @@ -2250,7 +2250,7 @@ { "cell_type": "code", "execution_count": null, - "id": "568222ad", + "id": "a415b958", "metadata": { "hide-output": false }, @@ -2268,7 +2268,7 @@ { "cell_type": "code", "execution_count": null, - "id": "f41386ec", + "id": "a33f9570", "metadata": { "hide-output": false }, @@ -2296,7 +2296,7 @@ { "cell_type": "code", "execution_count": null, - "id": "4b8417be", + "id": "2781cded", "metadata": { "hide-output": false }, @@ -2319,7 +2319,7 @@ { "cell_type": "code", "execution_count": null, - "id": "b5955912", + "id": "208c8cb0", "metadata": { "hide-output": false }, @@ -2330,7 +2330,7 @@ }, { "cell_type": "markdown", - "id": "d8548076", + "id": "dab8f7e0", "metadata": {}, "source": [ "The density for the approximating model is\n", @@ -2350,7 +2350,7 @@ }, { "cell_type": "markdown", - "id": "9602640a", + "id": "c48f7729", "metadata": {}, "source": [ "### Axiomatic justifications\n", @@ -2366,7 +2366,7 @@ } ], "metadata": { - "date": 1734843461.7072692, + "date": 1735958031.3990045, "filename": "five_preferences.md", "kernelspec": { "display_name": "Python", diff --git a/growth_in_dles.ipynb b/growth_in_dles.ipynb index f5127b4..1c90d38 100644 --- a/growth_in_dles.ipynb +++ b/growth_in_dles.ipynb @@ -2,7 +2,7 @@ "cells": [ { "cell_type": "markdown", - "id": "80f959d1", + "id": "9a8ae7b6", "metadata": {}, "source": [ "\n", @@ -13,7 +13,7 @@ }, { "cell_type": "markdown", - "id": "30936df3", + "id": "efb0dd03", "metadata": {}, "source": [ "# Growth in Dynamic Linear Economies\n", @@ -27,7 +27,7 @@ { "cell_type": "code", "execution_count": null, - "id": "dfa178e4", + "id": "c2b5919c", "metadata": { "hide-output": false }, @@ -38,7 +38,7 @@ }, { "cell_type": "markdown", - "id": "687870e8", + "id": "e00b20e2", "metadata": {}, "source": [ "This lecture describes several complete market economies having a\n", @@ -55,7 +55,7 @@ { "cell_type": "code", "execution_count": null, - "id": "a9785a3a", + "id": "0daa8e92", "metadata": { "hide-output": false }, @@ -68,7 +68,7 @@ }, { "cell_type": "markdown", - "id": "1af135ae", + "id": "55939d06", "metadata": {}, "source": [ "## Common Structure\n", @@ -132,7 +132,7 @@ }, { "cell_type": "markdown", - "id": "246dd78a", + "id": "e0796b73", "metadata": {}, "source": [ "## A Planning Problem\n", @@ -215,7 +215,7 @@ }, { "cell_type": "markdown", - "id": "75c9b051", + "id": "12e5ec4b", "metadata": {}, "source": [ "## Example Economies\n", @@ -300,7 +300,7 @@ }, { "cell_type": "markdown", - "id": "2ceab1ba", + "id": "dfe2ae0f", "metadata": {}, "source": [ "### Example 1: Hall (1978)\n", @@ -333,7 +333,7 @@ { "cell_type": "code", "execution_count": null, - "id": "afee522d", + "id": "17359f59", "metadata": { "hide-output": false }, @@ -376,7 +376,7 @@ }, { "cell_type": "markdown", - "id": "8c38bf0b", + "id": "52e1bbad", "metadata": {}, "source": [ "These parameter values are used to define an economy of the DLE class." @@ -385,7 +385,7 @@ { "cell_type": "code", "execution_count": null, - "id": "935ac476", + "id": "08175133", "metadata": { "hide-output": false }, @@ -396,7 +396,7 @@ }, { "cell_type": "markdown", - "id": "c0b671e2", + "id": "cbb964b7", "metadata": {}, "source": [ "We can then simulate the economy for a chosen length of time, from our\n", @@ -406,7 +406,7 @@ { "cell_type": "code", "execution_count": null, - "id": "ce3ea9be", + "id": "5f87d5f7", "metadata": { "hide-output": false }, @@ -417,7 +417,7 @@ }, { "cell_type": "markdown", - "id": "246b2b1a", + "id": "1f806166", "metadata": {}, "source": [ "The economy stores the simulated values for each variable. Below we plot\n", @@ -427,7 +427,7 @@ { "cell_type": "code", "execution_count": null, - "id": "2321c483", + "id": "097529e7", "metadata": { "hide-output": false }, @@ -442,7 +442,7 @@ }, { "cell_type": "markdown", - "id": "a9cb322e", + "id": "06aa0378", "metadata": {}, "source": [ "Inspection of the plot shows that the sample paths of consumption and\n", @@ -455,7 +455,7 @@ { "cell_type": "code", "execution_count": null, - "id": "f9f475f6", + "id": "16f971e2", "metadata": { "hide-output": false }, @@ -466,7 +466,7 @@ }, { "cell_type": "markdown", - "id": "c49b3cec", + "id": "0f9545fb", "metadata": {}, "source": [ "The endogenous eigenvalue that appears to be unity reflects the random\n", @@ -479,7 +479,7 @@ { "cell_type": "code", "execution_count": null, - "id": "d3622924", + "id": "7488daab", "metadata": { "hide-output": false }, @@ -490,7 +490,7 @@ }, { "cell_type": "markdown", - "id": "76d1b40c", + "id": "9e2b8555", "metadata": {}, "source": [ "The fact that the largest endogenous eigenvalue is strictly less than\n", @@ -501,7 +501,7 @@ { "cell_type": "code", "execution_count": null, - "id": "757d467e", + "id": "17721ca6", "metadata": { "hide-output": false }, @@ -514,7 +514,7 @@ }, { "cell_type": "markdown", - "id": "f9a537f5", + "id": "fa919ad6", "metadata": {}, "source": [ "However, the near-unity endogenous eigenvalue means that these steady\n", @@ -523,7 +523,7 @@ }, { "cell_type": "markdown", - "id": "51f87d50", + "id": "5a60153c", "metadata": {}, "source": [ "### Example 2: Altered Growth Condition\n", @@ -557,7 +557,7 @@ { "cell_type": "code", "execution_count": null, - "id": "1a71727d", + "id": "ff9095bd", "metadata": { "hide-output": false }, @@ -576,7 +576,7 @@ }, { "cell_type": "markdown", - "id": "bec3c97f", + "id": "9c279b99", "metadata": {}, "source": [ "Creating the DLE class and then simulating gives the following plot for\n", @@ -586,7 +586,7 @@ { "cell_type": "code", "execution_count": null, - "id": "5448744c", + "id": "97aec1c3", "metadata": { "hide-output": false }, @@ -604,7 +604,7 @@ }, { "cell_type": "markdown", - "id": "ffeb2dee", + "id": "3a4c9eae", "metadata": {}, "source": [ "Simulating our new economy shows that consumption grows quickly in the\n", @@ -617,7 +617,7 @@ { "cell_type": "code", "execution_count": null, - "id": "6ffcb353", + "id": "408c76e4", "metadata": { "hide-output": false }, @@ -629,7 +629,7 @@ }, { "cell_type": "markdown", - "id": "da879bca", + "id": "0fa9001a", "metadata": {}, "source": [ "The economy converges faster to this level than in Example 1 because the\n", @@ -640,7 +640,7 @@ { "cell_type": "code", "execution_count": null, - "id": "a91885d7", + "id": "8fb75f6f", "metadata": { "hide-output": false }, @@ -651,7 +651,7 @@ }, { "cell_type": "markdown", - "id": "833e32f5", + "id": "1ff31f01", "metadata": {}, "source": [ "### Example 3: A Jones-Manuelli (1990) Economy\n", @@ -699,7 +699,7 @@ { "cell_type": "code", "execution_count": null, - "id": "132dce01", + "id": "dedc7e57", "metadata": { "hide-output": false }, @@ -712,7 +712,7 @@ { "cell_type": "code", "execution_count": null, - "id": "35af399d", + "id": "69c642da", "metadata": { "hide-output": false }, @@ -723,7 +723,7 @@ }, { "cell_type": "markdown", - "id": "2fb08fc0", + "id": "65ce5fec", "metadata": {}, "source": [ "We simulate this economy from the original state vector" @@ -732,7 +732,7 @@ { "cell_type": "code", "execution_count": null, - "id": "99e9daed", + "id": "e7850dce", "metadata": { "hide-output": false }, @@ -749,7 +749,7 @@ }, { "cell_type": "markdown", - "id": "86f1e65f", + "id": "5285855f", "metadata": {}, "source": [ "Thus, adding habit persistence to the Hall model of Example 1 is enough\n", @@ -762,7 +762,7 @@ { "cell_type": "code", "execution_count": null, - "id": "cf8d9149", + "id": "4814c0a5", "metadata": { "hide-output": false }, @@ -773,7 +773,7 @@ }, { "cell_type": "markdown", - "id": "a353a803", + "id": "3ef88f1b", "metadata": {}, "source": [ "We now have two unit endogenous eigenvalues. One stems from satisfying\n", @@ -787,7 +787,7 @@ }, { "cell_type": "markdown", - "id": "0d2429ed", + "id": "1e809795", "metadata": {}, "source": [ "### Example 3.1: Varying Sensitivity\n", @@ -798,7 +798,7 @@ { "cell_type": "code", "execution_count": null, - "id": "549d944f", + "id": "61fba812", "metadata": { "hide-output": false }, @@ -819,7 +819,7 @@ }, { "cell_type": "markdown", - "id": "ef99ab20", + "id": "7948a95d", "metadata": {}, "source": [ "We no longer achieve sustained growth if $ \\lambda $ is raised from -1 to -0.7.\n", @@ -831,7 +831,7 @@ { "cell_type": "code", "execution_count": null, - "id": "24b18660", + "id": "9b4ba584", "metadata": { "hide-output": false }, @@ -842,7 +842,7 @@ }, { "cell_type": "markdown", - "id": "a40eb1bc", + "id": "8ec15c03", "metadata": {}, "source": [ "### Example 3.2: More Impatience\n", @@ -853,7 +853,7 @@ { "cell_type": "code", "execution_count": null, - "id": "7f15f614", + "id": "d0196173", "metadata": { "hide-output": false }, @@ -874,7 +874,7 @@ }, { "cell_type": "markdown", - "id": "717558ed", + "id": "b5664c01", "metadata": {}, "source": [ "Growth also fails if we lower $ \\beta $, since we now have\n", @@ -891,7 +891,7 @@ { "cell_type": "code", "execution_count": null, - "id": "78b2200e", + "id": "915c28e5", "metadata": { "hide-output": false }, @@ -902,7 +902,7 @@ } ], "metadata": { - "date": 1734843461.7362673, + "date": 1735958031.427656, "filename": "growth_in_dles.md", "kernelspec": { "display_name": "Python", diff --git a/hs_invertibility_example.ipynb b/hs_invertibility_example.ipynb index f5bedc7..cf61ec2 100644 --- a/hs_invertibility_example.ipynb +++ b/hs_invertibility_example.ipynb @@ -2,7 +2,7 @@ "cells": [ { "cell_type": "markdown", - "id": "f938bd73", + "id": "d65169f1", "metadata": {}, "source": [ "\n", @@ -13,7 +13,7 @@ }, { "cell_type": "markdown", - "id": "387ef903", + "id": "859328cf", "metadata": {}, "source": [ "# Shock Non Invertibility" @@ -21,7 +21,7 @@ }, { "cell_type": "markdown", - "id": "8fc356c3", + "id": "41a7a911", "metadata": {}, "source": [ "## Overview\n", @@ -35,7 +35,7 @@ { "cell_type": "code", "execution_count": null, - "id": "39934c5e", + "id": "16a3ee8c", "metadata": { "hide-output": false }, @@ -46,7 +46,7 @@ }, { "cell_type": "markdown", - "id": "f53f1dd4", + "id": "180f5b16", "metadata": {}, "source": [ "We’ll make these imports:" @@ -55,7 +55,7 @@ { "cell_type": "code", "execution_count": null, - "id": "5226db0f", + "id": "abbd07cf", "metadata": { "hide-output": false }, @@ -70,7 +70,7 @@ }, { "cell_type": "markdown", - "id": "31e03ecf", + "id": "ed8acf0b", "metadata": {}, "source": [ "This lecture describes an early contribution to what is now often called\n", @@ -96,7 +96,7 @@ }, { "cell_type": "markdown", - "id": "84556f0f", + "id": "0d77c4c1", "metadata": {}, "source": [ "## Model\n", @@ -191,7 +191,7 @@ { "cell_type": "code", "execution_count": null, - "id": "9f681937", + "id": "2972573d", "metadata": { "hide-output": false }, @@ -229,7 +229,7 @@ }, { "cell_type": "markdown", - "id": "17c5c8da", + "id": "b2637593", "metadata": {}, "source": [ "We define the household’s net of interest deficit as $ c_t - d_t $.\n", @@ -300,7 +300,7 @@ }, { "cell_type": "markdown", - "id": "f8bde166", + "id": "a86c8897", "metadata": {}, "source": [ "## Code\n", @@ -312,7 +312,7 @@ { "cell_type": "code", "execution_count": null, - "id": "9672f62a", + "id": "37d28f5e", "metadata": { "hide-output": false }, @@ -340,7 +340,7 @@ }, { "cell_type": "markdown", - "id": "dc3fac99", + "id": "9b37c7f4", "metadata": {}, "source": [ "The above figure displays the impulse response of consumption and the\n", @@ -360,7 +360,7 @@ { "cell_type": "code", "execution_count": null, - "id": "523e336a", + "id": "af993174", "metadata": { "hide-output": false }, @@ -410,7 +410,7 @@ }, { "cell_type": "markdown", - "id": "482bb25a", + "id": "88c84b27", "metadata": {}, "source": [ "The above figure displays the impulse response of consumption and the\n", @@ -430,7 +430,7 @@ { "cell_type": "code", "execution_count": null, - "id": "444b7ebb", + "id": "19635c12", "metadata": { "hide-output": false }, @@ -467,7 +467,7 @@ }, { "cell_type": "markdown", - "id": "a93fc1dc", + "id": "194f04c1", "metadata": {}, "source": [ "The above figure displays the impulse responses of $ u_t $ to\n", @@ -488,7 +488,7 @@ } ], "metadata": { - "date": 1734843461.7533255, + "date": 1735958031.4451914, "filename": "hs_invertibility_example.md", "kernelspec": { "display_name": "Python", diff --git a/hs_recursive_models.ipynb b/hs_recursive_models.ipynb index d646149..dc4b494 100644 --- a/hs_recursive_models.ipynb +++ b/hs_recursive_models.ipynb @@ -2,7 +2,7 @@ "cells": [ { "cell_type": "markdown", - "id": "fcc07355", + "id": "10615213", "metadata": {}, "source": [ "\n", @@ -13,7 +13,7 @@ }, { "cell_type": "markdown", - "id": "99ffe6c9", + "id": "dcb89cee", "metadata": {}, "source": [ "# Recursive Models of Dynamic Linear Economies\n", @@ -29,7 +29,7 @@ }, { "cell_type": "markdown", - "id": "e51068f7", + "id": "20e9c6e2", "metadata": {}, "source": [ "## A Suite of Models\n", @@ -52,7 +52,7 @@ }, { "cell_type": "markdown", - "id": "9cdadd24", + "id": "0337947d", "metadata": {}, "source": [ "### Overview of the Models\n", @@ -123,7 +123,7 @@ }, { "cell_type": "markdown", - "id": "f421285f", + "id": "64fa86ae", "metadata": {}, "source": [ "### Forecasting?\n", @@ -140,7 +140,7 @@ }, { "cell_type": "markdown", - "id": "861e3089", + "id": "01341b17", "metadata": {}, "source": [ "### Theory and Econometrics\n", @@ -165,7 +165,7 @@ }, { "cell_type": "markdown", - "id": "e98e91e1", + "id": "1b4f7a1f", "metadata": {}, "source": [ "### More Details\n", @@ -248,7 +248,7 @@ }, { "cell_type": "markdown", - "id": "6877ef9b", + "id": "9579cd7c", "metadata": {}, "source": [ "### Stochastic Model of Information Flows and Outcomes\n", @@ -290,7 +290,7 @@ }, { "cell_type": "markdown", - "id": "b6baf6fe", + "id": "efe5b7c9", "metadata": {}, "source": [ "### Information Sets\n", @@ -304,7 +304,7 @@ }, { "cell_type": "markdown", - "id": "dd4e1745", + "id": "3581384a", "metadata": {}, "source": [ "### Prediction Theory\n", @@ -380,7 +380,7 @@ }, { "cell_type": "markdown", - "id": "36c29366", + "id": "7d2066cb", "metadata": {}, "source": [ "### Orthogonal Decomposition\n", @@ -413,7 +413,7 @@ }, { "cell_type": "markdown", - "id": "64519523", + "id": "c45ba550", "metadata": {}, "source": [ "### Taste and Technology Shocks\n", @@ -454,7 +454,7 @@ }, { "cell_type": "markdown", - "id": "495a0532", + "id": "9b745f13", "metadata": {}, "source": [ "### Production Technology\n", @@ -479,7 +479,7 @@ }, { "cell_type": "markdown", - "id": "f5292c05", + "id": "61d4f608", "metadata": {}, "source": [ "### Household Technology\n", @@ -506,7 +506,7 @@ }, { "cell_type": "markdown", - "id": "eff61b72", + "id": "f7391125", "metadata": {}, "source": [ "### Preferences\n", @@ -536,7 +536,7 @@ }, { "cell_type": "markdown", - "id": "4ee1b72c", + "id": "f67d1502", "metadata": {}, "source": [ "### Endowment Economy\n", @@ -584,7 +584,7 @@ }, { "cell_type": "markdown", - "id": "23771b71", + "id": "f7f6d0d5", "metadata": {}, "source": [ "### Single-Period Adjustment Costs\n", @@ -898,7 +898,7 @@ }, { "cell_type": "markdown", - "id": "4bdc707d", + "id": "ea226a3b", "metadata": {}, "source": [ "### Optimal Resource Allocation\n", @@ -951,7 +951,7 @@ }, { "cell_type": "markdown", - "id": "7acc88af", + "id": "60edcccf", "metadata": {}, "source": [ "### Lagrangian Formulation\n", @@ -1070,7 +1070,7 @@ }, { "cell_type": "markdown", - "id": "3fdd0354", + "id": "3010f2f9", "metadata": {}, "source": [ "### Dynamic Programming\n", @@ -1286,7 +1286,7 @@ }, { "cell_type": "markdown", - "id": "206b7576", + "id": "a657768b", "metadata": {}, "source": [ "### Other mathematical infrastructure\n", @@ -1315,7 +1315,7 @@ }, { "cell_type": "markdown", - "id": "62626edc", + "id": "e19f3b13", "metadata": {}, "source": [ "### Representative Household\n", @@ -1352,7 +1352,7 @@ }, { "cell_type": "markdown", - "id": "2b99d2a4", + "id": "23502158", "metadata": {}, "source": [ "### Type I Firm\n", @@ -1382,7 +1382,7 @@ }, { "cell_type": "markdown", - "id": "222fa8be", + "id": "4df43223", "metadata": {}, "source": [ "### Type II Firm\n", @@ -1410,7 +1410,7 @@ }, { "cell_type": "markdown", - "id": "5f933e87", + "id": "43c6b0c2", "metadata": {}, "source": [ "### Competitive Equilibrium: Definition\n", @@ -1473,7 +1473,7 @@ }, { "cell_type": "markdown", - "id": "c822b536", + "id": "e51fc2db", "metadata": {}, "source": [ "### Asset pricing\n", @@ -1521,7 +1521,7 @@ }, { "cell_type": "markdown", - "id": "949c2974", + "id": "3cafb9ff", "metadata": {}, "source": [ "### Re-Opening Markets\n", @@ -1567,7 +1567,7 @@ }, { "cell_type": "markdown", - "id": "f4574483", + "id": "2290495b", "metadata": {}, "source": [ "## Econometrics\n", @@ -1680,7 +1680,7 @@ }, { "cell_type": "markdown", - "id": "5ee3cdc0", + "id": "974ff49a", "metadata": {}, "source": [ "### Factorization of Likelihood Function\n", @@ -1707,7 +1707,7 @@ }, { "cell_type": "markdown", - "id": "632838c2", + "id": "c9f24ced", "metadata": {}, "source": [ "### Covariance Generating Functions\n", @@ -1720,7 +1720,7 @@ }, { "cell_type": "markdown", - "id": "ea91a1f6", + "id": "1892f2dc", "metadata": {}, "source": [ "### Spectral Factorization Identity\n", @@ -1764,7 +1764,7 @@ }, { "cell_type": "markdown", - "id": "8092b363", + "id": "eb6d55c4", "metadata": {}, "source": [ "### Wold and Vector Autoregressive Representations\n", @@ -1806,7 +1806,7 @@ }, { "cell_type": "markdown", - "id": "b86f1623", + "id": "4c150fd5", "metadata": {}, "source": [ "## Dynamic Demand Curves and Canonical Household Technologies" @@ -1814,7 +1814,7 @@ }, { "cell_type": "markdown", - "id": "854aca44", + "id": "925a5be0", "metadata": {}, "source": [ "### Canonical Household Technologies\n", @@ -1862,7 +1862,7 @@ }, { "cell_type": "markdown", - "id": "0e9d0a93", + "id": "de1d1144", "metadata": {}, "source": [ "### Dynamic Demand Functions\n", @@ -1915,7 +1915,7 @@ }, { "cell_type": "markdown", - "id": "d959687f", + "id": "62226397", "metadata": {}, "source": [ "## Gorman Aggregation and Engel Curves\n", @@ -1945,7 +1945,7 @@ }, { "cell_type": "markdown", - "id": "d70ab5b0", + "id": "590c795a", "metadata": {}, "source": [ "### Re-Opened Markets\n", @@ -1989,7 +1989,7 @@ }, { "cell_type": "markdown", - "id": "b5f12884", + "id": "8998fc14", "metadata": {}, "source": [ "### Dynamic Demand\n", @@ -2017,7 +2017,7 @@ }, { "cell_type": "markdown", - "id": "152cd51a", + "id": "fca0c543", "metadata": {}, "source": [ "### Attaining a Canonical Household Technology\n", @@ -2043,7 +2043,7 @@ }, { "cell_type": "markdown", - "id": "6099756e", + "id": "91ff63d5", "metadata": {}, "source": [ "## Partial Equilibrium\n", @@ -2113,7 +2113,7 @@ }, { "cell_type": "markdown", - "id": "6af74fd5", + "id": "5955e5c2", "metadata": {}, "source": [ "## Equilibrium Investment Under Uncertainty\n", @@ -2150,7 +2150,7 @@ }, { "cell_type": "markdown", - "id": "cd0cf5d0", + "id": "7a66c2ef", "metadata": {}, "source": [ "## A Rosen-Topel Housing Model\n", @@ -2199,7 +2199,7 @@ }, { "cell_type": "markdown", - "id": "c4f28a24", + "id": "408837a0", "metadata": {}, "source": [ "## Cattle Cycles\n", @@ -2269,7 +2269,7 @@ }, { "cell_type": "markdown", - "id": "a8429bad", + "id": "cb028ee7", "metadata": {}, "source": [ "## Models of Occupational Choice and Pay\n", @@ -2282,7 +2282,7 @@ }, { "cell_type": "markdown", - "id": "e3d17d61", + "id": "188544e0", "metadata": {}, "source": [ "### Market for Engineers\n", @@ -2359,7 +2359,7 @@ }, { "cell_type": "markdown", - "id": "13af7f8c", + "id": "17022c94", "metadata": {}, "source": [ "### Skilled and Unskilled Workers\n", @@ -2422,7 +2422,7 @@ }, { "cell_type": "markdown", - "id": "4a18f7fe", + "id": "f4ea0c55", "metadata": {}, "source": [ "## Permanent Income Models\n", @@ -2500,7 +2500,7 @@ }, { "cell_type": "markdown", - "id": "8a11f417", + "id": "ea921248", "metadata": {}, "source": [ "## Gorman Heterogeneous Households\n", @@ -2600,7 +2600,7 @@ }, { "cell_type": "markdown", - "id": "1bef4c86", + "id": "46c76a81", "metadata": {}, "source": [ "## Non-Gorman Heterogeneous Households\n", @@ -2784,7 +2784,7 @@ } ], "metadata": { - "date": 1734843461.8346813, + "date": 1735958031.5260382, "filename": "hs_recursive_models.md", "kernelspec": { "display_name": "Python", diff --git a/intro.ipynb b/intro.ipynb index 7dcda2d..114e412 100644 --- a/intro.ipynb +++ b/intro.ipynb @@ -2,7 +2,7 @@ "cells": [ { "cell_type": "markdown", - "id": "16b832ce", + "id": "1a5d4c81", "metadata": {}, "source": [ "# Advanced Quantitative Economics with Python\n", @@ -12,7 +12,7 @@ }, { "cell_type": "markdown", - "id": "b723e684", + "id": "5198eeec", "metadata": {}, "source": [ "# Tools and Techniques\n", @@ -25,7 +25,7 @@ }, { "cell_type": "markdown", - "id": "2e06ea7e", + "id": "f0677422", "metadata": {}, "source": [ "# LQ Control\n", @@ -42,7 +42,7 @@ }, { "cell_type": "markdown", - "id": "af2cf852", + "id": "b3927aa7", "metadata": {}, "source": [ "# Multiple Agent Models\n", @@ -55,7 +55,7 @@ }, { "cell_type": "markdown", - "id": "1b1807e8", + "id": "dfeb34fc", "metadata": {}, "source": [ "# Dynamic Linear Economies\n", @@ -72,7 +72,7 @@ }, { "cell_type": "markdown", - "id": "d9ae2be3", + "id": "ae2232f1", "metadata": {}, "source": [ "# Risk, Model Uncertainty, and Robustness\n", @@ -85,7 +85,7 @@ }, { "cell_type": "markdown", - "id": "493f74b6", + "id": "29d32d47", "metadata": {}, "source": [ "# Time Series Models\n", @@ -100,7 +100,7 @@ }, { "cell_type": "markdown", - "id": "51d10e5b", + "id": "4bda0d5d", "metadata": {}, "source": [ "# Asset Pricing and Finance\n", @@ -114,7 +114,7 @@ }, { "cell_type": "markdown", - "id": "c6a4aee2", + "id": "925be5ff", "metadata": {}, "source": [ "# Dynamic Programming Squared\n", @@ -134,7 +134,7 @@ }, { "cell_type": "markdown", - "id": "89d87894", + "id": "a918c5e5", "metadata": {}, "source": [ "# Other\n", @@ -146,7 +146,7 @@ } ], "metadata": { - "date": 1734843461.8677917, + "date": 1735958031.5593567, "filename": "intro.md", "kernelspec": { "display_name": "Python", diff --git a/irfs_in_hall_model.ipynb b/irfs_in_hall_model.ipynb index 909e4db..b53bc4f 100644 --- a/irfs_in_hall_model.ipynb +++ b/irfs_in_hall_model.ipynb @@ -2,7 +2,7 @@ "cells": [ { "cell_type": "markdown", - "id": "792c0651", + "id": "22222e74", "metadata": {}, "source": [ "\n", @@ -13,7 +13,7 @@ }, { "cell_type": "markdown", - "id": "e0082e83", + "id": "f17f0f82", "metadata": {}, "source": [ "# IRFs in Hall Models\n", @@ -27,7 +27,7 @@ { "cell_type": "code", "execution_count": null, - "id": "51423da0", + "id": "ddfb2aba", "metadata": { "hide-output": false }, @@ -38,7 +38,7 @@ }, { "cell_type": "markdown", - "id": "fda84908", + "id": "25c02cb3", "metadata": {}, "source": [ "We’ll make these imports:" @@ -47,7 +47,7 @@ { "cell_type": "code", "execution_count": null, - "id": "29cbe91b", + "id": "cf237445", "metadata": { "hide-output": false }, @@ -60,7 +60,7 @@ }, { "cell_type": "markdown", - "id": "2bb78e51", + "id": "4b1641d9", "metadata": {}, "source": [ "This lecture shows how the DLE class can be used to create impulse\n", @@ -74,7 +74,7 @@ }, { "cell_type": "markdown", - "id": "1d15ef99", + "id": "9a53660c", "metadata": {}, "source": [ "## Example 1: Hall (1978)\n", @@ -110,7 +110,7 @@ { "cell_type": "code", "execution_count": null, - "id": "e59dbcf7", + "id": "849e22ed", "metadata": { "hide-output": false }, @@ -147,7 +147,7 @@ }, { "cell_type": "markdown", - "id": "575642b3", + "id": "bee7e1ab", "metadata": {}, "source": [ "These parameter values are used to define an economy of the DLE class.\n", @@ -162,7 +162,7 @@ { "cell_type": "code", "execution_count": null, - "id": "10e4f13b", + "id": "4b661bfd", "metadata": { "hide-output": false }, @@ -180,7 +180,7 @@ }, { "cell_type": "markdown", - "id": "8ded1b9a", + "id": "df5be03e", "metadata": {}, "source": [ "The DLE class can be used to create impulse response functions for each\n", @@ -197,7 +197,7 @@ { "cell_type": "code", "execution_count": null, - "id": "de3f372a", + "id": "2a3bcb82", "metadata": { "hide-output": false }, @@ -213,7 +213,7 @@ }, { "cell_type": "markdown", - "id": "7ce13def", + "id": "64dfe3ea", "metadata": {}, "source": [ "It can be seen that the endowment shock has permanent effects on the\n", @@ -226,7 +226,7 @@ }, { "cell_type": "markdown", - "id": "1dab7d0b", + "id": "f776198a", "metadata": {}, "source": [ "## Example 2: Higher Adjustment Costs\n", @@ -242,7 +242,7 @@ { "cell_type": "code", "execution_count": null, - "id": "fe8b07e1", + "id": "289cde13", "metadata": { "hide-output": false }, @@ -265,7 +265,7 @@ { "cell_type": "code", "execution_count": null, - "id": "624272f9", + "id": "3cf7e41f", "metadata": { "hide-output": false }, @@ -282,7 +282,7 @@ { "cell_type": "code", "execution_count": null, - "id": "a1d2c61c", + "id": "42ba12c9", "metadata": { "hide-output": false }, @@ -294,7 +294,7 @@ { "cell_type": "code", "execution_count": null, - "id": "c1c749fb", + "id": "b95a91fa", "metadata": { "hide-output": false }, @@ -306,7 +306,7 @@ }, { "cell_type": "markdown", - "id": "a4ede4c1", + "id": "31c0a40f", "metadata": {}, "source": [ "The first graph shows that there seems to be a downward trend in both\n", @@ -329,7 +329,7 @@ }, { "cell_type": "markdown", - "id": "c5192ce7", + "id": "34384c5c", "metadata": {}, "source": [ "## Example 3: Durable Consumption Goods\n", @@ -370,7 +370,7 @@ { "cell_type": "code", "execution_count": null, - "id": "a54a3a1f", + "id": "64373e3c", "metadata": { "hide-output": false }, @@ -402,7 +402,7 @@ }, { "cell_type": "markdown", - "id": "6359e57e", + "id": "571e7e7b", "metadata": {}, "source": [ "In contrast to Hall’s original model of Example 1, it is now investment\n", @@ -415,7 +415,7 @@ { "cell_type": "code", "execution_count": null, - "id": "527c235f", + "id": "eb9e433a", "metadata": { "hide-output": false }, @@ -431,7 +431,7 @@ }, { "cell_type": "markdown", - "id": "21cf6b6e", + "id": "99a6c1d4", "metadata": {}, "source": [ "The impulse response functions confirm that consumption is now much more\n", @@ -444,7 +444,7 @@ } ], "metadata": { - "date": 1734843461.8811197, + "date": 1735958031.573688, "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 351a96c..0f4576e 100644 --- a/knowing_forecasts_of_others.ipynb +++ b/knowing_forecasts_of_others.ipynb @@ -2,7 +2,7 @@ "cells": [ { "cell_type": "markdown", - "id": "4696cb6e", + "id": "1a6c7fb3", "metadata": {}, "source": [ "\n", @@ -11,7 +11,7 @@ }, { "cell_type": "markdown", - "id": "b8dbc191", + "id": "348902ba", "metadata": {}, "source": [ "# Knowing the Forecasts of Others\n", @@ -22,7 +22,7 @@ { "cell_type": "code", "execution_count": null, - "id": "57392499", + "id": "c55eca1f", "metadata": { "hide-output": false }, @@ -34,7 +34,7 @@ }, { "cell_type": "markdown", - "id": "07e51831", + "id": "4a664000", "metadata": {}, "source": [ "## Introduction\n", @@ -102,7 +102,7 @@ }, { "cell_type": "markdown", - "id": "84599369", + "id": "b887524d", "metadata": {}, "source": [ "### A Sequence of Models\n", @@ -135,7 +135,7 @@ }, { "cell_type": "markdown", - "id": "d3807bf9", + "id": "ba134983", "metadata": {}, "source": [ "## The Setting\n", @@ -222,7 +222,7 @@ }, { "cell_type": "markdown", - "id": "cce02eee", + "id": "e8295796", "metadata": {}, "source": [ "## Tactics\n", @@ -322,7 +322,7 @@ }, { "cell_type": "markdown", - "id": "341764cb", + "id": "60bd9932", "metadata": {}, "source": [ "## Equilibrium Conditions\n", @@ -417,7 +417,7 @@ }, { "cell_type": "markdown", - "id": "9fa4a6f7", + "id": "c6aaf005", "metadata": {}, "source": [ "### Equilibrium under perfect foresight\n", @@ -497,7 +497,7 @@ }, { "cell_type": "markdown", - "id": "8de2e019", + "id": "0760ba76", "metadata": {}, "source": [ "## Equilibrium with $ \\theta_t $ stochastic but observed at $ t $\n", @@ -562,7 +562,7 @@ }, { "cell_type": "markdown", - "id": "fd3e5a2b", + "id": "740c00db", "metadata": {}, "source": [ "### Filtering" @@ -570,7 +570,7 @@ }, { "cell_type": "markdown", - "id": "96f23eda", + "id": "fd9288a7", "metadata": {}, "source": [ "#### One noisy signal\n", @@ -642,7 +642,7 @@ }, { "cell_type": "markdown", - "id": "ed06fb90", + "id": "bca0c3e6", "metadata": {}, "source": [ "#### State-reconstruction error\n", @@ -721,7 +721,7 @@ }, { "cell_type": "markdown", - "id": "3636c535", + "id": "207d122e", "metadata": {}, "source": [ "### A new state variable\n", @@ -760,7 +760,7 @@ }, { "cell_type": "markdown", - "id": "1a9f6ee4", + "id": "71648395", "metadata": {}, "source": [ "### Two Noisy Signals\n", @@ -853,7 +853,7 @@ }, { "cell_type": "markdown", - "id": "cb307d51", + "id": "ca103c53", "metadata": {}, "source": [ "## Guess-and-Verify Tactic\n", @@ -884,7 +884,7 @@ }, { "cell_type": "markdown", - "id": "955a9819", + "id": "1f26fcc2", "metadata": {}, "source": [ "## Equilibrium with One Noisy Signal on $ \\theta_t $" @@ -892,7 +892,7 @@ }, { "cell_type": "markdown", - "id": "5481de11", + "id": "7ebe8cf4", "metadata": {}, "source": [ "### Step 1: Solve for $ \\tilde{\\lambda} $ and $ \\lambda $\n", @@ -911,7 +911,7 @@ }, { "cell_type": "markdown", - "id": "2cecdd5d", + "id": "dd91ebe1", "metadata": {}, "source": [ "### Step 2: Solve for $ p $\n", @@ -944,7 +944,7 @@ }, { "cell_type": "markdown", - "id": "6a391954", + "id": "a1cef36d", "metadata": {}, "source": [ "### Step 3: Represent the system using `quantecon.LinearStateSpace`\n", @@ -1026,7 +1026,7 @@ { "cell_type": "code", "execution_count": null, - "id": "e64dc698", + "id": "0423e59a", "metadata": { "hide-output": false }, @@ -1045,7 +1045,7 @@ { "cell_type": "code", "execution_count": null, - "id": "cc67ecc0", + "id": "3ed5a348", "metadata": { "hide-output": false }, @@ -1061,7 +1061,7 @@ { "cell_type": "code", "execution_count": null, - "id": "9ac3389b", + "id": "6da4dcce", "metadata": { "hide-output": false }, @@ -1077,7 +1077,7 @@ { "cell_type": "code", "execution_count": null, - "id": "ad66cbdd", + "id": "bab5b69b", "metadata": { "hide-output": false }, @@ -1091,7 +1091,7 @@ { "cell_type": "code", "execution_count": null, - "id": "3609e337", + "id": "e61ebb2b", "metadata": { "hide-output": false }, @@ -1110,7 +1110,7 @@ { "cell_type": "code", "execution_count": null, - "id": "86d2742b", + "id": "f4d9d395", "metadata": { "hide-output": false }, @@ -1124,7 +1124,7 @@ { "cell_type": "code", "execution_count": null, - "id": "41b87ad9", + "id": "3f84e731", "metadata": { "hide-output": false }, @@ -1157,7 +1157,7 @@ { "cell_type": "code", "execution_count": null, - "id": "72dc6b86", + "id": "8a9e9f79", "metadata": { "hide-output": false }, @@ -1171,7 +1171,7 @@ { "cell_type": "code", "execution_count": null, - "id": "22e2aefc", + "id": "160d61c8", "metadata": { "hide-output": false }, @@ -1184,7 +1184,7 @@ { "cell_type": "code", "execution_count": null, - "id": "428308f7", + "id": "3c853e15", "metadata": { "hide-output": false }, @@ -1196,7 +1196,7 @@ }, { "cell_type": "markdown", - "id": "c6cba55d", + "id": "59fa3822", "metadata": {}, "source": [ "### Step 4: Compute impulse response functions\n", @@ -1208,7 +1208,7 @@ { "cell_type": "code", "execution_count": null, - "id": "342467fb", + "id": "5328f7bc", "metadata": { "hide-output": false }, @@ -1231,7 +1231,7 @@ }, { "cell_type": "markdown", - "id": "3fa76f8b", + "id": "a8dc59ce", "metadata": {}, "source": [ "### Step 5: Compute stationary covariance matrices and population regressions\n", @@ -1265,7 +1265,7 @@ { "cell_type": "code", "execution_count": null, - "id": "129018cc", + "id": "165fecc7", "metadata": { "hide-output": false }, @@ -1290,7 +1290,7 @@ { "cell_type": "code", "execution_count": null, - "id": "ea8d3b50", + "id": "12820938", "metadata": { "hide-output": false }, @@ -1304,7 +1304,7 @@ { "cell_type": "code", "execution_count": null, - "id": "69addc54", + "id": "15540884", "metadata": { "hide-output": false }, @@ -1319,7 +1319,7 @@ { "cell_type": "code", "execution_count": null, - "id": "f154e904", + "id": "319ef7df", "metadata": { "hide-output": false }, @@ -1332,7 +1332,7 @@ { "cell_type": "code", "execution_count": null, - "id": "2c4aa9de", + "id": "90bc8d15", "metadata": { "hide-output": false }, @@ -1346,7 +1346,7 @@ }, { "cell_type": "markdown", - "id": "8ca5e281", + "id": "64157390", "metadata": {}, "source": [ "## Equilibrium with Two Noisy Signals on $ \\theta_t $\n", @@ -1450,7 +1450,7 @@ { "cell_type": "code", "execution_count": null, - "id": "9328ac93", + "id": "e59e46ed", "metadata": { "hide-output": false }, @@ -1469,7 +1469,7 @@ { "cell_type": "code", "execution_count": null, - "id": "788c3d42", + "id": "f66c5324", "metadata": { "hide-output": false }, @@ -1483,7 +1483,7 @@ { "cell_type": "code", "execution_count": null, - "id": "67611274", + "id": "e4a1ea06", "metadata": { "hide-output": false }, @@ -1523,7 +1523,7 @@ { "cell_type": "code", "execution_count": null, - "id": "473c9cad", + "id": "11d51555", "metadata": { "hide-output": false }, @@ -1537,7 +1537,7 @@ { "cell_type": "code", "execution_count": null, - "id": "ae3e9a69", + "id": "fd1e4c5e", "metadata": { "hide-output": false }, @@ -1550,7 +1550,7 @@ { "cell_type": "code", "execution_count": null, - "id": "e7dc71cc", + "id": "bba14d51", "metadata": { "hide-output": false }, @@ -1562,7 +1562,7 @@ { "cell_type": "code", "execution_count": null, - "id": "d1ae91fd", + "id": "6047874b", "metadata": { "hide-output": false }, @@ -1586,7 +1586,7 @@ { "cell_type": "code", "execution_count": null, - "id": "2b49606c", + "id": "7e49c542", "metadata": { "hide-output": false }, @@ -1611,7 +1611,7 @@ { "cell_type": "code", "execution_count": null, - "id": "e0b70d50", + "id": "ddb9413c", "metadata": { "hide-output": false }, @@ -1625,7 +1625,7 @@ { "cell_type": "code", "execution_count": null, - "id": "db0bd0c4", + "id": "8bd25bba", "metadata": { "hide-output": false }, @@ -1640,7 +1640,7 @@ { "cell_type": "code", "execution_count": null, - "id": "d7798196", + "id": "75337363", "metadata": { "hide-output": false }, @@ -1653,7 +1653,7 @@ { "cell_type": "code", "execution_count": null, - "id": "018d4bd4", + "id": "16b808a3", "metadata": { "hide-output": false }, @@ -1679,7 +1679,7 @@ { "cell_type": "code", "execution_count": null, - "id": "89fd91ae", + "id": "17fef2d1", "metadata": { "hide-output": false }, @@ -1692,7 +1692,7 @@ }, { "cell_type": "markdown", - "id": "13035ba4", + "id": "314904c7", "metadata": {}, "source": [ "## Key Step\n", @@ -1710,7 +1710,7 @@ { "cell_type": "code", "execution_count": null, - "id": "97234e9a", + "id": "31af034f", "metadata": { "hide-output": false }, @@ -1729,7 +1729,7 @@ { "cell_type": "code", "execution_count": null, - "id": "13db24f2", + "id": "653d797a", "metadata": { "hide-output": false }, @@ -1740,7 +1740,7 @@ }, { "cell_type": "markdown", - "id": "983e3b08", + "id": "dc66a407", "metadata": {}, "source": [ "The $ R^2 $ in this regression equals $ 1 $.\n", @@ -1753,7 +1753,7 @@ }, { "cell_type": "markdown", - "id": "3fe8f79d", + "id": "88a45797", "metadata": {}, "source": [ "## An observed common shock benchmark\n", @@ -1816,7 +1816,7 @@ { "cell_type": "code", "execution_count": null, - "id": "da57ceaa", + "id": "c25dca50", "metadata": { "hide-output": false }, @@ -1833,7 +1833,7 @@ { "cell_type": "code", "execution_count": null, - "id": "34a0c64e", + "id": "d758cde7", "metadata": { "hide-output": false }, @@ -1846,7 +1846,7 @@ }, { "cell_type": "markdown", - "id": "7ce4ec4d", + "id": "87676510", "metadata": {}, "source": [ "Now let’s form and plot an impulse response function of $ k_t^i $ to shocks $ v_t $ to $ \\theta_{t+1} $" @@ -1855,7 +1855,7 @@ { "cell_type": "code", "execution_count": null, - "id": "dbe58eb1", + "id": "d098bd39", "metadata": { "hide-output": false }, @@ -1877,7 +1877,7 @@ }, { "cell_type": "markdown", - "id": "60af3a64", + "id": "0fe64f0b", "metadata": {}, "source": [ "## Comparison of All Signal Structures\n", @@ -1892,7 +1892,7 @@ { "cell_type": "code", "execution_count": null, - "id": "a51f9a39", + "id": "aa5f28be", "metadata": { "hide-output": false }, @@ -1916,7 +1916,7 @@ }, { "cell_type": "markdown", - "id": "c3c38658", + "id": "3074d53e", "metadata": {}, "source": [ "The three panels in the graph above show that\n", @@ -1943,7 +1943,7 @@ { "cell_type": "code", "execution_count": null, - "id": "e7b530ee", + "id": "439cab40", "metadata": { "hide-output": false }, @@ -1956,7 +1956,7 @@ }, { "cell_type": "markdown", - "id": "acb5e409", + "id": "4119f363", "metadata": {}, "source": [ "Kalman gains for the two\n", @@ -1966,7 +1966,7 @@ { "cell_type": "code", "execution_count": null, - "id": "05098a35", + "id": "e28d1e23", "metadata": { "hide-output": false }, @@ -1979,7 +1979,7 @@ }, { "cell_type": "markdown", - "id": "2c8fe995", + "id": "03a926ee", "metadata": {}, "source": [ "Another lesson that comes from the preceding three-panel graph is that the presence of iid noise\n", @@ -1988,7 +1988,7 @@ }, { "cell_type": "markdown", - "id": "d40ae1d4", + "id": "27115316", "metadata": {}, "source": [ "## Notes on History of the Problem\n", @@ -2048,7 +2048,7 @@ }, { "cell_type": "markdown", - "id": "63bd051d", + "id": "a48b4dd5", "metadata": {}, "source": [ "### Further historical remarks\n", @@ -2116,7 +2116,7 @@ } ], "metadata": { - "date": 1734843462.1145697, + "date": 1735958031.7943642, "filename": "knowing_forecasts_of_others.md", "kernelspec": { "display_name": "Python", diff --git a/lqramsey.ipynb b/lqramsey.ipynb index aa9f91c..b5bba9d 100644 --- a/lqramsey.ipynb +++ b/lqramsey.ipynb @@ -2,7 +2,7 @@ "cells": [ { "cell_type": "markdown", - "id": "cca7a00a", + "id": "343d362c", "metadata": {}, "source": [ "\n", @@ -11,7 +11,7 @@ }, { "cell_type": "markdown", - "id": "f99857a5", + "id": "341e42af", "metadata": {}, "source": [ "# Optimal Taxation in an LQ Economy\n", @@ -24,7 +24,7 @@ { "cell_type": "code", "execution_count": null, - "id": "ca0fc4e2", + "id": "09bb5a3f", "metadata": { "hide-output": false }, @@ -35,7 +35,7 @@ }, { "cell_type": "markdown", - "id": "40e2ab17", + "id": "ed2f156a", "metadata": {}, "source": [ "## Overview\n", @@ -73,7 +73,7 @@ { "cell_type": "code", "execution_count": null, - "id": "32bb26e0", + "id": "6dfa4731", "metadata": { "hide-output": false }, @@ -91,7 +91,7 @@ }, { "cell_type": "markdown", - "id": "931dfe5d", + "id": "a678961d", "metadata": {}, "source": [ "### Model Features\n", @@ -104,7 +104,7 @@ }, { "cell_type": "markdown", - "id": "310a3806", + "id": "80591aaf", "metadata": {}, "source": [ "## The Ramsey Problem\n", @@ -114,7 +114,7 @@ }, { "cell_type": "markdown", - "id": "34dc4ed1", + "id": "22ac964d", "metadata": {}, "source": [ "### Technology\n", @@ -130,7 +130,7 @@ }, { "cell_type": "markdown", - "id": "6e10038c", + "id": "3bb8abf6", "metadata": {}, "source": [ "### Households\n", @@ -186,7 +186,7 @@ }, { "cell_type": "markdown", - "id": "2d9236e2", + "id": "549af612", "metadata": {}, "source": [ "### Government\n", @@ -202,7 +202,7 @@ }, { "cell_type": "markdown", - "id": "f9e86d82", + "id": "79c71bf1", "metadata": {}, "source": [ "### Exogenous Variables\n", @@ -229,7 +229,7 @@ }, { "cell_type": "markdown", - "id": "4aa93525", + "id": "49d50c9c", "metadata": {}, "source": [ "### Feasibility\n", @@ -247,7 +247,7 @@ }, { "cell_type": "markdown", - "id": "5e709705", + "id": "8c2e458b", "metadata": {}, "source": [ "### Government Budget Constraint\n", @@ -264,7 +264,7 @@ }, { "cell_type": "markdown", - "id": "658bf484", + "id": "4d1f184a", "metadata": {}, "source": [ "### Equilibrium\n", @@ -298,7 +298,7 @@ }, { "cell_type": "markdown", - "id": "f43f38b5", + "id": "2eefd4fd", "metadata": {}, "source": [ "### Solution\n", @@ -419,7 +419,7 @@ }, { "cell_type": "markdown", - "id": "48cab400", + "id": "17efbfbb", "metadata": {}, "source": [ "### Computing the Quadratic Term\n", @@ -492,7 +492,7 @@ }, { "cell_type": "markdown", - "id": "8b1d79b1", + "id": "d76d6d4d", "metadata": {}, "source": [ "### Finite State Markov Case\n", @@ -534,7 +534,7 @@ }, { "cell_type": "markdown", - "id": "20607747", + "id": "fb6387df", "metadata": {}, "source": [ "### Other Variables\n", @@ -608,7 +608,7 @@ }, { "cell_type": "markdown", - "id": "08450a28", + "id": "72bbe74f", "metadata": {}, "source": [ "### A Martingale\n", @@ -672,7 +672,7 @@ }, { "cell_type": "markdown", - "id": "d2605d3a", + "id": "84bed991", "metadata": {}, "source": [ "## Implementation\n", @@ -689,7 +689,7 @@ { "cell_type": "code", "execution_count": null, - "id": "7ec019b0", + "id": "ec1e2ffe", "metadata": { "hide-output": false }, @@ -957,7 +957,7 @@ }, { "cell_type": "markdown", - "id": "53369d0c", + "id": "4b506f8a", "metadata": {}, "source": [ "### Comments on the Code\n", @@ -985,7 +985,7 @@ }, { "cell_type": "markdown", - "id": "d6db36ea", + "id": "89aaf70f", "metadata": {}, "source": [ "## Examples\n", @@ -998,7 +998,7 @@ }, { "cell_type": "markdown", - "id": "aacb8e3a", + "id": "4f9824f6", "metadata": {}, "source": [ "### The Continuous Case\n", @@ -1025,7 +1025,7 @@ { "cell_type": "code", "execution_count": null, - "id": "2bb588d6", + "id": "5fd94133", "metadata": { "hide-output": false }, @@ -1053,7 +1053,7 @@ }, { "cell_type": "markdown", - "id": "512da7e8", + "id": "ab1b9623", "metadata": {}, "source": [ "The legends on the figures indicate the variables being tracked.\n", @@ -1065,7 +1065,7 @@ { "cell_type": "code", "execution_count": null, - "id": "1a239525", + "id": "094711cb", "metadata": { "hide-output": false }, @@ -1076,7 +1076,7 @@ }, { "cell_type": "markdown", - "id": "4253931d", + "id": "87fe48f9", "metadata": {}, "source": [ "### The Discrete Case\n", @@ -1087,7 +1087,7 @@ { "cell_type": "code", "execution_count": null, - "id": "9a3febcb", + "id": "3eb2f350", "metadata": { "hide-output": false }, @@ -1122,7 +1122,7 @@ }, { "cell_type": "markdown", - "id": "4bc9bc37", + "id": "1e9e5ffb", "metadata": {}, "source": [ "The call `gen_fig_2(path)` generates" @@ -1131,7 +1131,7 @@ { "cell_type": "code", "execution_count": null, - "id": "37df9801", + "id": "508c8f45", "metadata": { "hide-output": false }, @@ -1142,7 +1142,7 @@ }, { "cell_type": "markdown", - "id": "b4ca8d11", + "id": "89e284a1", "metadata": {}, "source": [ "## Exercises\n", @@ -1153,7 +1153,7 @@ }, { "cell_type": "markdown", - "id": "1a01e57e", + "id": "a7b57973", "metadata": {}, "source": [ "## Exercise 12.1\n", @@ -1171,7 +1171,7 @@ }, { "cell_type": "markdown", - "id": "06def453", + "id": "6d7d92df", "metadata": {}, "source": [ "## Solution to[ Exercise 12.1](https://python-advanced.quantecon.org/#lq_ex1)" @@ -1180,7 +1180,7 @@ { "cell_type": "code", "execution_count": null, - "id": "339e747c", + "id": "ed5a4963", "metadata": { "hide-output": false }, @@ -1214,7 +1214,7 @@ { "cell_type": "code", "execution_count": null, - "id": "3b66bdb6", + "id": "33952be6", "metadata": { "hide-output": false }, @@ -1225,7 +1225,7 @@ } ], "metadata": { - "date": 1734843462.1545837, + "date": 1735958031.8334973, "filename": "lqramsey.md", "kernelspec": { "display_name": "Python", diff --git a/lu_tricks.ipynb b/lu_tricks.ipynb index 10225a1..b1a0682 100644 --- a/lu_tricks.ipynb +++ b/lu_tricks.ipynb @@ -2,7 +2,7 @@ "cells": [ { "cell_type": "markdown", - "id": "f3f65d16", + "id": "30133628", "metadata": {}, "source": [ "\n", @@ -11,7 +11,7 @@ }, { "cell_type": "markdown", - "id": "caa67f7d", + "id": "61586205", "metadata": {}, "source": [ "# Classical Control with Linear Algebra" @@ -19,7 +19,7 @@ }, { "cell_type": "markdown", - "id": "980496ed", + "id": "a0fdb14b", "metadata": {}, "source": [ "## Overview\n", @@ -60,7 +60,7 @@ { "cell_type": "code", "execution_count": null, - "id": "70003211", + "id": "b7fd93f2", "metadata": { "hide-output": false }, @@ -72,7 +72,7 @@ }, { "cell_type": "markdown", - "id": "84b51063", + "id": "667fa896", "metadata": {}, "source": [ "### References\n", @@ -82,7 +82,7 @@ }, { "cell_type": "markdown", - "id": "63457982", + "id": "4e51bd75", "metadata": {}, "source": [ "## A Control Problem\n", @@ -123,7 +123,7 @@ }, { "cell_type": "markdown", - "id": "b3d76056", + "id": "66a62604", "metadata": {}, "source": [ "### Example\n", @@ -165,7 +165,7 @@ }, { "cell_type": "markdown", - "id": "62a57528", + "id": "64b92d8c", "metadata": {}, "source": [ "## Finite Horizon Theory\n", @@ -295,7 +295,7 @@ }, { "cell_type": "markdown", - "id": "4e8c52e3", + "id": "12ef1251", "metadata": {}, "source": [ "### Matrix Methods\n", @@ -305,7 +305,7 @@ }, { "cell_type": "markdown", - "id": "00cd6c66", + "id": "25fe4b32", "metadata": {}, "source": [ "#### A Single Lag Term\n", @@ -404,7 +404,7 @@ }, { "cell_type": "markdown", - "id": "2de0604f", + "id": "31717a54", "metadata": {}, "source": [ "#### An Alternative Representation\n", @@ -497,7 +497,7 @@ }, { "cell_type": "markdown", - "id": "b35478d3", + "id": "6d4f7ad0", "metadata": {}, "source": [ "#### Additional Lag Terms\n", @@ -616,7 +616,7 @@ }, { "cell_type": "markdown", - "id": "f1b5dc64", + "id": "9541fb7d", "metadata": {}, "source": [ "## Infinite Horizon Limit\n", @@ -846,7 +846,7 @@ }, { "cell_type": "markdown", - "id": "5dc4d679", + "id": "d0959ab1", "metadata": {}, "source": [ "## Undiscounted Problems\n", @@ -888,7 +888,7 @@ }, { "cell_type": "markdown", - "id": "54ee76ab", + "id": "886c24b8", "metadata": {}, "source": [ "### Transforming Discounted to Undiscounted Problem\n", @@ -973,7 +973,7 @@ }, { "cell_type": "markdown", - "id": "0dd25d68", + "id": "2c334356", "metadata": {}, "source": [ "## Implementation\n", @@ -985,7 +985,7 @@ { "cell_type": "code", "execution_count": null, - "id": "fecb855a", + "id": "a2ee916f", "metadata": { "hide-output": false }, @@ -1301,7 +1301,7 @@ }, { "cell_type": "markdown", - "id": "2ca079c1", + "id": "1d01a1a7", "metadata": {}, "source": [ "### Example\n", @@ -1334,7 +1334,7 @@ { "cell_type": "code", "execution_count": null, - "id": "6e636c56", + "id": "a917fffe", "metadata": { "hide-output": false }, @@ -1374,7 +1374,7 @@ }, { "cell_type": "markdown", - "id": "037c3856", + "id": "595248d0", "metadata": {}, "source": [ "Here’s what happens when we change $ \\gamma $ to 5.0" @@ -1383,7 +1383,7 @@ { "cell_type": "code", "execution_count": null, - "id": "25840079", + "id": "3b094de4", "metadata": { "hide-output": false }, @@ -1394,7 +1394,7 @@ }, { "cell_type": "markdown", - "id": "a786c95b", + "id": "601e12e8", "metadata": {}, "source": [ "And here’s $ \\gamma = 10 $" @@ -1403,7 +1403,7 @@ { "cell_type": "code", "execution_count": null, - "id": "9ad12ecc", + "id": "9d0608cd", "metadata": { "hide-output": false }, @@ -1414,7 +1414,7 @@ }, { "cell_type": "markdown", - "id": "d6297c14", + "id": "f0c6afe5", "metadata": {}, "source": [ "## Exercises" @@ -1422,7 +1422,7 @@ }, { "cell_type": "markdown", - "id": "42949489", + "id": "27afc7f0", "metadata": {}, "source": [ "## Exercise 32.1\n", @@ -1468,7 +1468,7 @@ }, { "cell_type": "markdown", - "id": "44cce273", + "id": "69255e08", "metadata": {}, "source": [ "## Exercise 32.2\n", @@ -1492,7 +1492,7 @@ }, { "cell_type": "markdown", - "id": "ede93e4a", + "id": "76a6e800", "metadata": {}, "source": [ "## Exercise 32.3\n", @@ -1513,7 +1513,7 @@ }, { "cell_type": "markdown", - "id": "77da626f", + "id": "1dcd924c", "metadata": {}, "source": [ "## Exercise 32.4\n", @@ -1533,7 +1533,7 @@ } ], "metadata": { - "date": 1734843462.2046626, + "date": 1735958031.882755, "filename": "lu_tricks.md", "kernelspec": { "display_name": "Python", diff --git a/lucas_asset_pricing_dles.ipynb b/lucas_asset_pricing_dles.ipynb index 9009ba6..793be89 100644 --- a/lucas_asset_pricing_dles.ipynb +++ b/lucas_asset_pricing_dles.ipynb @@ -2,7 +2,7 @@ "cells": [ { "cell_type": "markdown", - "id": "6679971c", + "id": "a8744055", "metadata": {}, "source": [ "\n", @@ -13,7 +13,7 @@ }, { "cell_type": "markdown", - "id": "e52bbb59", + "id": "6bc4f212", "metadata": {}, "source": [ "# Lucas Asset Pricing Using DLE\n", @@ -27,7 +27,7 @@ { "cell_type": "code", "execution_count": null, - "id": "13928801", + "id": "29a2641e", "metadata": { "hide-output": false }, @@ -38,7 +38,7 @@ }, { "cell_type": "markdown", - "id": "d1cb6c4a", + "id": "13e64a9a", "metadata": {}, "source": [ "This lecture uses the DLE class to price payout\n", @@ -58,7 +58,7 @@ { "cell_type": "code", "execution_count": null, - "id": "f1447d15", + "id": "b21b6b71", "metadata": { "hide-output": false }, @@ -71,7 +71,7 @@ }, { "cell_type": "markdown", - "id": "dcab841d", + "id": "f33c9c51", "metadata": {}, "source": [ "We use a linear-quadratic version of an economy that Lucas (1978) [[Lucas, 1978](https://python-advanced.quantecon.org/zreferences.html#id177)] used\n", @@ -155,7 +155,7 @@ }, { "cell_type": "markdown", - "id": "0802ef38", + "id": "8cba8370", "metadata": {}, "source": [ "## Asset Pricing Equations\n", @@ -189,7 +189,7 @@ }, { "cell_type": "markdown", - "id": "d3afa11a", + "id": "e88cbe0b", "metadata": {}, "source": [ "## Asset Pricing Simulations" @@ -198,7 +198,7 @@ { "cell_type": "code", "execution_count": null, - "id": "573a3932", + "id": "871a550a", "metadata": { "hide-output": false }, @@ -235,7 +235,7 @@ { "cell_type": "code", "execution_count": null, - "id": "722fe2e4", + "id": "226e0384", "metadata": { "hide-output": false }, @@ -246,7 +246,7 @@ }, { "cell_type": "markdown", - "id": "37837ebc", + "id": "4e36fe8f", "metadata": {}, "source": [ "After specifying a “Pay” matrix, we simulate the economy.\n", @@ -258,7 +258,7 @@ { "cell_type": "code", "execution_count": null, - "id": "856c41fc", + "id": "f08dfaa4", "metadata": { "hide-output": false }, @@ -269,7 +269,7 @@ }, { "cell_type": "markdown", - "id": "34a80809", + "id": "9a2cac0b", "metadata": {}, "source": [ "The graph below plots the price of this claim over time:" @@ -278,7 +278,7 @@ { "cell_type": "code", "execution_count": null, - "id": "a493c1d2", + "id": "cda1d380", "metadata": { "hide-output": false }, @@ -292,7 +292,7 @@ }, { "cell_type": "markdown", - "id": "de694a04", + "id": "6ad5c295", "metadata": {}, "source": [ "The next plot displays the realized gross rate of return on this “Lucas\n", @@ -302,7 +302,7 @@ { "cell_type": "code", "execution_count": null, - "id": "efcdbaf2", + "id": "288762e2", "metadata": { "hide-output": false }, @@ -318,7 +318,7 @@ { "cell_type": "code", "execution_count": null, - "id": "16951c54", + "id": "09d6d857", "metadata": { "hide-output": false }, @@ -329,7 +329,7 @@ }, { "cell_type": "markdown", - "id": "fd93bcf1", + "id": "64272037", "metadata": {}, "source": [ "Above we have also calculated the correlation coefficient between these\n", @@ -343,7 +343,7 @@ { "cell_type": "code", "execution_count": null, - "id": "6acb1705", + "id": "a549bbda", "metadata": { "hide-output": false }, @@ -358,7 +358,7 @@ }, { "cell_type": "markdown", - "id": "766e5804", + "id": "4f8f6654", "metadata": {}, "source": [ "From the above plot, we can see the tendency of the term structure to\n", @@ -376,7 +376,7 @@ { "cell_type": "code", "execution_count": null, - "id": "d1169428", + "id": "6c500b2d", "metadata": { "hide-output": false }, @@ -394,7 +394,7 @@ { "cell_type": "code", "execution_count": null, - "id": "275b02a7", + "id": "e0170e27", "metadata": { "hide-output": false }, @@ -410,7 +410,7 @@ { "cell_type": "code", "execution_count": null, - "id": "95c013c6", + "id": "9314786b", "metadata": { "hide-output": false }, @@ -421,7 +421,7 @@ }, { "cell_type": "markdown", - "id": "55550bf1", + "id": "0071504a", "metadata": {}, "source": [ "The correlation between these two gross rates is now more negative.\n", @@ -433,7 +433,7 @@ { "cell_type": "code", "execution_count": null, - "id": "85c95d45", + "id": "d8f864c5", "metadata": { "hide-output": false }, @@ -448,7 +448,7 @@ }, { "cell_type": "markdown", - "id": "e1186676", + "id": "8dd5f8b0", "metadata": {}, "source": [ "We can see the tendency of the term structure to slope up when rates are\n", @@ -458,7 +458,7 @@ } ], "metadata": { - "date": 1734843462.220051, + "date": 1735958031.8986917, "filename": "lucas_asset_pricing_dles.md", "kernelspec": { "display_name": "Python", diff --git a/lucas_model.ipynb b/lucas_model.ipynb index 25f4f32..10e2e46 100644 --- a/lucas_model.ipynb +++ b/lucas_model.ipynb @@ -2,7 +2,7 @@ "cells": [ { "cell_type": "markdown", - "id": "c6a6a613", + "id": "e6a5411e", "metadata": {}, "source": [ "\n", @@ -11,7 +11,7 @@ }, { "cell_type": "markdown", - "id": "0a84320e", + "id": "0e49acca", "metadata": {}, "source": [ "# Asset Pricing II: The Lucas Asset Pricing Model\n", @@ -22,7 +22,7 @@ }, { "cell_type": "markdown", - "id": "7a40b02d", + "id": "9d6ea5ec", "metadata": {}, "source": [ "## Overview\n", @@ -45,7 +45,7 @@ { "cell_type": "code", "execution_count": null, - "id": "4dcaad50", + "id": "b72a330d", "metadata": { "hide-output": false }, @@ -59,7 +59,7 @@ }, { "cell_type": "markdown", - "id": "1957ebbe", + "id": "07fa3666", "metadata": {}, "source": [ "## The Lucas Model\n", @@ -81,7 +81,7 @@ }, { "cell_type": "markdown", - "id": "9ebdda34", + "id": "cfc694e6", "metadata": {}, "source": [ "### Basic Setup\n", @@ -91,7 +91,7 @@ }, { "cell_type": "markdown", - "id": "1f945595", + "id": "b49cfa99", "metadata": {}, "source": [ "#### Assets\n", @@ -121,7 +121,7 @@ }, { "cell_type": "markdown", - "id": "602ab17b", + "id": "0e828c6d", "metadata": {}, "source": [ "#### Consumers\n", @@ -145,7 +145,7 @@ }, { "cell_type": "markdown", - "id": "d2bf2b83", + "id": "70b5d276", "metadata": {}, "source": [ "### Pricing a Lucas Tree\n", @@ -184,7 +184,7 @@ }, { "cell_type": "markdown", - "id": "c21957ef", + "id": "5388f15d", "metadata": {}, "source": [ "#### The Dynamic Program\n", @@ -242,7 +242,7 @@ }, { "cell_type": "markdown", - "id": "003cfa1d", + "id": "a23c2b70", "metadata": {}, "source": [ "#### Next Steps\n", @@ -261,7 +261,7 @@ }, { "cell_type": "markdown", - "id": "c7a77f6c", + "id": "a1e8d5c8", "metadata": {}, "source": [ "#### Equilibrium Constraints\n", @@ -280,7 +280,7 @@ }, { "cell_type": "markdown", - "id": "ab0ed9d4", + "id": "52de33af", "metadata": {}, "source": [ "#### The Equilibrium Price Function\n", @@ -326,7 +326,7 @@ }, { "cell_type": "markdown", - "id": "6a7aa5e9", + "id": "381840d9", "metadata": {}, "source": [ "### Solving the Model\n", @@ -342,7 +342,7 @@ }, { "cell_type": "markdown", - "id": "d914fb06", + "id": "1d9aae4c", "metadata": {}, "source": [ "#### Setting up the Problem\n", @@ -392,7 +392,7 @@ }, { "cell_type": "markdown", - "id": "46462fdc", + "id": "f4dae6f4", "metadata": {}, "source": [ "#### A Little Fixed Point Theory\n", @@ -454,7 +454,7 @@ }, { "cell_type": "markdown", - "id": "abab8b00", + "id": "c6c72fc2", "metadata": {}, "source": [ "### Computation – An Example\n", @@ -475,7 +475,7 @@ { "cell_type": "code", "execution_count": null, - "id": "4bd41ce0", + "id": "b0a0e3d2", "metadata": { "hide-output": false }, @@ -514,7 +514,7 @@ }, { "cell_type": "markdown", - "id": "ecf9c0d3", + "id": "d9ec5786", "metadata": {}, "source": [ "The following function takes an instance of the `LucasTree` and generates a\n", @@ -524,7 +524,7 @@ { "cell_type": "code", "execution_count": null, - "id": "8d697fa4", + "id": "31204b57", "metadata": { "hide-output": false }, @@ -566,7 +566,7 @@ }, { "cell_type": "markdown", - "id": "e9a1e46d", + "id": "1d66e2a5", "metadata": {}, "source": [ "To solve the model, we write a function that iterates using the Lucas operator\n", @@ -576,7 +576,7 @@ { "cell_type": "code", "execution_count": null, - "id": "e45faf27", + "id": "a34f8405", "metadata": { "hide-output": false }, @@ -612,7 +612,7 @@ }, { "cell_type": "markdown", - "id": "3e46a999", + "id": "40e721bf", "metadata": {}, "source": [ "Solving the model and plotting the resulting price function" @@ -621,7 +621,7 @@ { "cell_type": "code", "execution_count": null, - "id": "dc919046", + "id": "f90a33b4", "metadata": { "hide-output": false }, @@ -640,7 +640,7 @@ }, { "cell_type": "markdown", - "id": "083b501e", + "id": "ef113cdd", "metadata": {}, "source": [ "We see that the price is increasing, even if we remove all serial correlation from the endowment process.\n", @@ -666,7 +666,7 @@ }, { "cell_type": "markdown", - "id": "735d726e", + "id": "16e16274", "metadata": {}, "source": [ "## Exercises\n", @@ -677,7 +677,7 @@ }, { "cell_type": "markdown", - "id": "4d3d672c", + "id": "cf5d14c9", "metadata": {}, "source": [ "## Exercise 35.1\n", @@ -687,7 +687,7 @@ }, { "cell_type": "markdown", - "id": "440aa953", + "id": "32c9e106", "metadata": {}, "source": [ "## Solution to[ Exercise 35.1](https://python-advanced.quantecon.org/#lucas_ex1)" @@ -696,7 +696,7 @@ { "cell_type": "code", "execution_count": null, - "id": "dbace2a2", + "id": "0ca79f80", "metadata": { "hide-output": false }, @@ -718,7 +718,7 @@ } ], "metadata": { - "date": 1734843462.2438447, + "date": 1735958031.9223568, "filename": "lucas_model.md", "kernelspec": { "display_name": "Python", diff --git a/markov_jump_lq.ipynb b/markov_jump_lq.ipynb index 48cfe92..8fc6133 100644 --- a/markov_jump_lq.ipynb +++ b/markov_jump_lq.ipynb @@ -2,7 +2,7 @@ "cells": [ { "cell_type": "markdown", - "id": "03418b9a", + "id": "ce41e2df", "metadata": {}, "source": [ "\n", @@ -13,7 +13,7 @@ }, { "cell_type": "markdown", - "id": "5e515fc4", + "id": "083a2c95", "metadata": {}, "source": [ "# Markov Jump Linear Quadratic Dynamic Programming\n", @@ -24,7 +24,7 @@ { "cell_type": "code", "execution_count": null, - "id": "3d874025", + "id": "0a9ac4c5", "metadata": { "hide-output": false }, @@ -35,7 +35,7 @@ }, { "cell_type": "markdown", - "id": "e22bda4c", + "id": "bf4561a4", "metadata": {}, "source": [ "## Overview\n", @@ -75,7 +75,7 @@ }, { "cell_type": "markdown", - "id": "75765e4b", + "id": "bd21f97c", "metadata": {}, "source": [ "## Review of useful LQ dynamic programming formulas\n", @@ -149,7 +149,7 @@ }, { "cell_type": "markdown", - "id": "5bcaa256", + "id": "b517658e", "metadata": {}, "source": [ "## Linked Riccati equations for Markov LQ dynamic programming\n", @@ -262,7 +262,7 @@ }, { "cell_type": "markdown", - "id": "cbfd67b2", + "id": "8162fecf", "metadata": {}, "source": [ "## Applications\n", @@ -275,7 +275,7 @@ { "cell_type": "code", "execution_count": null, - "id": "785d2a14", + "id": "e7ac5c98", "metadata": { "hide-output": false }, @@ -290,7 +290,7 @@ { "cell_type": "code", "execution_count": null, - "id": "17429776", + "id": "f04f427a", "metadata": { "hide-output": false }, @@ -302,7 +302,7 @@ }, { "cell_type": "markdown", - "id": "549e7625", + "id": "bf87f926", "metadata": {}, "source": [ "## Example 1\n", @@ -372,7 +372,7 @@ { "cell_type": "code", "execution_count": null, - "id": "3bcab1f2", + "id": "cf37ffb2", "metadata": { "hide-output": false }, @@ -417,7 +417,7 @@ }, { "cell_type": "markdown", - "id": "4b11f0af", + "id": "208586db", "metadata": {}, "source": [ "The continuous part of the state $ x_t $ consists of two variables,\n", @@ -427,7 +427,7 @@ { "cell_type": "code", "execution_count": null, - "id": "18ac8c7b", + "id": "36a803b9", "metadata": { "hide-output": false }, @@ -438,7 +438,7 @@ }, { "cell_type": "markdown", - "id": "568dcca2", + "id": "58b75f0e", "metadata": {}, "source": [ "We start with a Markov transition matrix that makes the Markov state be\n", @@ -478,7 +478,7 @@ { "cell_type": "code", "execution_count": null, - "id": "81a418e1", + "id": "e555554b", "metadata": { "hide-output": false }, @@ -492,7 +492,7 @@ { "cell_type": "code", "execution_count": null, - "id": "3f62be06", + "id": "4488f24c", "metadata": { "hide-output": false }, @@ -505,7 +505,7 @@ { "cell_type": "code", "execution_count": null, - "id": "e5cd139b", + "id": "7a08edd2", "metadata": { "hide-output": false }, @@ -519,7 +519,7 @@ }, { "cell_type": "markdown", - "id": "74ef4974", + "id": "60117390", "metadata": {}, "source": [ "Let’s look at the value function matrices and the decision rules for\n", @@ -529,7 +529,7 @@ { "cell_type": "code", "execution_count": null, - "id": "37ac0db3", + "id": "f2041f41", "metadata": { "hide-output": false }, @@ -542,7 +542,7 @@ { "cell_type": "code", "execution_count": null, - "id": "f762cbb5", + "id": "f6219b77", "metadata": { "hide-output": false }, @@ -555,7 +555,7 @@ { "cell_type": "code", "execution_count": null, - "id": "dc085704", + "id": "cab36904", "metadata": { "hide-output": false }, @@ -567,7 +567,7 @@ }, { "cell_type": "markdown", - "id": "c3d2e7c0", + "id": "3ec6c5a3", "metadata": {}, "source": [ "Now we’ll plot the decision rules and see if they make sense" @@ -576,7 +576,7 @@ { "cell_type": "code", "execution_count": null, - "id": "c3eda8f9", + "id": "9618b842", "metadata": { "hide-output": false }, @@ -608,7 +608,7 @@ }, { "cell_type": "markdown", - "id": "b3a34900", + "id": "2544a0c8", "metadata": {}, "source": [ "The above graph plots $ k_{t+1}= k_t + u_t = k_t - F x_t $ as an affine\n", @@ -634,7 +634,7 @@ { "cell_type": "code", "execution_count": null, - "id": "be28e338", + "id": "763ca232", "metadata": { "hide-output": false }, @@ -655,7 +655,7 @@ }, { "cell_type": "markdown", - "id": "ff13ec88", + "id": "5992c2ee", "metadata": {}, "source": [ "Now we’ll depart from the preceding transition matrix that made the\n", @@ -674,7 +674,7 @@ { "cell_type": "code", "execution_count": null, - "id": "8f046ca3", + "id": "54127849", "metadata": { "hide-output": false }, @@ -692,7 +692,7 @@ { "cell_type": "code", "execution_count": null, - "id": "659af037", + "id": "4ad79401", "metadata": { "hide-output": false }, @@ -709,7 +709,7 @@ }, { "cell_type": "markdown", - "id": "d4d3682d", + "id": "fbe927b9", "metadata": {}, "source": [ "We can plot optimal decision rules associated with different\n", @@ -719,7 +719,7 @@ { "cell_type": "code", "execution_count": null, - "id": "07a0b091", + "id": "d1b965c1", "metadata": { "hide-output": false }, @@ -742,7 +742,7 @@ { "cell_type": "code", "execution_count": null, - "id": "94664e21", + "id": "967e6d9c", "metadata": { "hide-output": false }, @@ -762,7 +762,7 @@ }, { "cell_type": "markdown", - "id": "1f4fd78a", + "id": "35abec5a", "metadata": {}, "source": [ "Notice how the decision rules’ constants and slopes behave as functions\n", @@ -787,7 +787,7 @@ { "cell_type": "code", "execution_count": null, - "id": "debe7046", + "id": "ffc214ba", "metadata": { "hide-output": false }, @@ -804,7 +804,7 @@ }, { "cell_type": "markdown", - "id": "323a2c4b", + "id": "ee905add", "metadata": {}, "source": [ "We can plot optimal decision rules for different $ \\lambda $ and\n", @@ -814,7 +814,7 @@ { "cell_type": "code", "execution_count": null, - "id": "8ec46ddb", + "id": "4a5ae6a3", "metadata": { "hide-output": false }, @@ -844,7 +844,7 @@ { "cell_type": "code", "execution_count": null, - "id": "df2225a5", + "id": "db79f595", "metadata": { "hide-output": false }, @@ -866,7 +866,7 @@ }, { "cell_type": "markdown", - "id": "4423f2c1", + "id": "b4523a58", "metadata": {}, "source": [ "The following code defines a wrapper function that computes optimal\n", @@ -876,7 +876,7 @@ { "cell_type": "code", "execution_count": null, - "id": "a67f62b6", + "id": "6a1ffefb", "metadata": { "hide-output": false }, @@ -977,7 +977,7 @@ }, { "cell_type": "markdown", - "id": "d8bae138", + "id": "ba4784e1", "metadata": {}, "source": [ "To illustrate the code with another example, we shall set\n", @@ -1029,7 +1029,7 @@ { "cell_type": "code", "execution_count": null, - "id": "e255bfb7", + "id": "9a9b22a9", "metadata": { "hide-output": false }, @@ -1040,7 +1040,7 @@ }, { "cell_type": "markdown", - "id": "9751b36a", + "id": "2cbe0042", "metadata": {}, "source": [ "Set $ f_{1,{s_t}} $ and $ d_{s_t} $ as constant functions and\n", @@ -1053,7 +1053,7 @@ { "cell_type": "code", "execution_count": null, - "id": "4475521c", + "id": "8d57947e", "metadata": { "hide-output": false }, @@ -1064,7 +1064,7 @@ }, { "cell_type": "markdown", - "id": "989aab04", + "id": "c201b9ff", "metadata": {}, "source": [ "## Example 2\n", @@ -1134,7 +1134,7 @@ { "cell_type": "code", "execution_count": null, - "id": "cd123a96", + "id": "9cbff2f1", "metadata": { "hide-output": false }, @@ -1187,7 +1187,7 @@ { "cell_type": "code", "execution_count": null, - "id": "1f93145d", + "id": "a90eff3e", "metadata": { "hide-output": false }, @@ -1198,7 +1198,7 @@ }, { "cell_type": "markdown", - "id": "68a86732", + "id": "e7bd8244", "metadata": {}, "source": [ "Only $ d_{s_t} $ depends on $ s_t $." @@ -1207,7 +1207,7 @@ { "cell_type": "code", "execution_count": null, - "id": "8132df99", + "id": "c34c5e09", "metadata": { "hide-output": false }, @@ -1218,7 +1218,7 @@ }, { "cell_type": "markdown", - "id": "0aa5f425", + "id": "d05a25a5", "metadata": {}, "source": [ "Only $ f_{1,{s_t}} $ depends on $ s_t $." @@ -1227,7 +1227,7 @@ { "cell_type": "code", "execution_count": null, - "id": "2cd486be", + "id": "b0c3a435", "metadata": { "hide-output": false }, @@ -1238,7 +1238,7 @@ }, { "cell_type": "markdown", - "id": "3eecc8f0", + "id": "da6fc3ea", "metadata": {}, "source": [ "Only $ f_{2,{s_t}} $ depends on $ s_t $." @@ -1247,7 +1247,7 @@ { "cell_type": "code", "execution_count": null, - "id": "923de1e2", + "id": "1da905b4", "metadata": { "hide-output": false }, @@ -1258,7 +1258,7 @@ }, { "cell_type": "markdown", - "id": "3eba5f69", + "id": "2673f268", "metadata": {}, "source": [ "Only $ \\alpha_0(s_t) $ depends on $ s_t $." @@ -1267,7 +1267,7 @@ { "cell_type": "code", "execution_count": null, - "id": "4d35d30b", + "id": "db7241e0", "metadata": { "hide-output": false }, @@ -1278,7 +1278,7 @@ }, { "cell_type": "markdown", - "id": "6c27026c", + "id": "d7e088d1", "metadata": {}, "source": [ "Only $ \\rho_{s_t} $ depends on $ s_t $." @@ -1287,7 +1287,7 @@ { "cell_type": "code", "execution_count": null, - "id": "ad819dae", + "id": "96fb0b21", "metadata": { "hide-output": false }, @@ -1298,7 +1298,7 @@ }, { "cell_type": "markdown", - "id": "7b1a19ff", + "id": "5ed6ea7c", "metadata": {}, "source": [ "Only $ \\sigma_{s_t} $ depends on $ s_t $." @@ -1307,7 +1307,7 @@ { "cell_type": "code", "execution_count": null, - "id": "dcf33c21", + "id": "2bc00ff9", "metadata": { "hide-output": false }, @@ -1318,7 +1318,7 @@ }, { "cell_type": "markdown", - "id": "a3ee2cde", + "id": "ca841fb3", "metadata": {}, "source": [ "## More examples\n", @@ -1333,7 +1333,7 @@ } ], "metadata": { - "date": 1734843462.2843533, + "date": 1735958031.9623065, "filename": "markov_jump_lq.md", "kernelspec": { "display_name": "Python", diff --git a/match_transport.ipynb b/match_transport.ipynb index ec53952..70c2d71 100644 --- a/match_transport.ipynb +++ b/match_transport.ipynb @@ -2,7 +2,7 @@ "cells": [ { "cell_type": "markdown", - "id": "3b2ece3d", + "id": "173b88d3", "metadata": {}, "source": [ "# Composite Sorting" @@ -10,44 +10,39 @@ }, { "cell_type": "markdown", - "id": "4f933066", + "id": "7dc438f8", "metadata": {}, "source": [ - "## Introduction\n", + "## Overview\n", "\n", - "This lecture presents Python code for solving **composite sorting** problems of the kind\n", - "studied in *Composite Sorting* by Job Boerma, Aleh Tsyvinski, Ruodo Wang,\n", - "and Zhenyuan Zhang [[Boerma *et al.*, 2023](https://python-advanced.quantecon.org/zreferences.html#id3)].\n", + "Optimal transport theory is studies how one (marginal) probabilty measure can be related to another (marginal) probability measure in an ideal way.\n", "\n", - "In this lecture, we will use the following imports" - ] - }, - { - "cell_type": "code", - "execution_count": null, - "id": "2e893c2f", - "metadata": { - "hide-output": false - }, - "outputs": [], - "source": [ - "import numpy as np\n", - "from scipy.optimize import linprog\n", - "from itertools import chain\n", - "import pandas as pd\n", - "from collections import namedtuple\n", + "The output of such a theory is a **coupling** of the two probability measures, i.e., a joint probabilty\n", + "measure having those two marginal probability measures.\n", "\n", + "This lecture describes how Job Boerma, Aleh Tsyvinski, Ruodo Wang,\n", + "and Zhenyuan Zhang [[Boerma *et al.*, 2024](https://python-advanced.quantecon.org/zreferences.html#id3)] used optimal transport theory to formulate and solve an equilibrium of a model in which wages and allocations of workers across jobs adjust to match measures of different types with measures of different types of occupations.\n", "\n", - "import matplotlib.pyplot as plt\n", - "import matplotlib.patches as patches\n", - "from matplotlib.ticker import MaxNLocator\n", - "from matplotlib import cm\n", - "from matplotlib.colors import Normalize" + "Production technologies allow firms to affect shape costs of mismatch with the consequence\n", + "that costs of mismatch can be concave.\n", + "\n", + "That means that it possible that equilibrium there is neither **positive assortive** nor **negative assorting** matching, an outcome that [[Boerma *et al.*, 2024](https://python-advanced.quantecon.org/zreferences.html#id3)] call **composite assortive** matching.\n", + "\n", + "For example, in an equilibrium with composite matching, identical **workers** can sort into different **occupations**, some positively and some negatively.\n", + "\n", + "[[Boerma *et al.*, 2024](https://python-advanced.quantecon.org/zreferences.html#id3)]\n", + "show how this can generate distinct distributions of labor earnings within and across occupations.\n", + "\n", + "This lecture describes the [[Boerma *et al.*, 2024](https://python-advanced.quantecon.org/zreferences.html#id3)] model and presents Python code for computing equilibria.\n", + "\n", + "The lecture applies the code to the [[Boerma *et al.*, 2024](https://python-advanced.quantecon.org/zreferences.html#id3)] model of labor markets.\n", + "\n", + "As with an earlier QuantEcon lecture on optimal transport ([https://python.quantecon.org/opt_transport.html](https://python.quantecon.org/opt_transport.html)), a key tool will be **linear programming**." ] }, { "cell_type": "markdown", - "id": "31e3ba5f", + "id": "0a05795d", "metadata": {}, "source": [ "## Setup\n", @@ -58,7 +53,7 @@ "\n", "Similarly, let a positive integer $ m_y $ be the agents of agents of type $ y \\in Y $.\n", "\n", - "We will refer to these two measures as *marginals*.\n", + "We refer to these two measures as *marginals*.\n", "\n", "We assume that\n", "\n", @@ -80,15 +75,15 @@ "\n", "Given our discreteness assumptions about $ n $ and $ m $, the problem admits an integer solution $ \\mu \\in \\mathbb{Z}_+^{X \\times Y} $, i.e. $ \\mu_{xy} $ is a non-negative integer for each $ x\\in X, y\\in Y $.\n", "\n", - "In this notebook, we will focus on integer solutions of the problem.\n", + "We will study integer solutions.\n", "\n", - "Two points on the integer assumption are worth mentioning:\n", + "Two points about restricting ourselves to integer solutions are worth mentioning:\n", "\n", "- it is without loss of generality for computational purposes, since every problem with float marginals can be transformed into an equivalent problem with integer marginals; \n", - "- arguments below work for arbitrary real marginals from a mathematical standpoint, but some of the implementations will fail to work with float arithmetic. \n", + "- although the mathematical structure that we present actually wors for arbitrary real marginals, some of our Python implementations would fail to work with float arithmetic. \n", "\n", "\n", - "Our focus in this notebook is a specific instance of the optimal transport problem:\n", + "We focus on a specific instance of an optimal transport problem:\n", "\n", "We assume that $ X $ and $ Y $ are finite subsets of $ \\mathbb{R} $ and that the cost function satisfies $ c_{xy} = h(|x - y|) $ for all $ x,y \\in \\mathbb{R}, $ for an $ h: \\mathbb{R}_+ \\rightarrow \\mathbb{R}_+ $ that is **strictly concave** and **strictly increasing** and **grounded** (i.e., $ h(0)=0 $).\n", "\n", @@ -116,7 +111,40 @@ "\\end{aligned}\n", "$$\n", "\n", - "The following class takes as inputs sets of types $ X,Y \\subset \\mathbb{R}, $ marginals $ n, m $ with positive integer entries such that $ \\sum_{x \\in X} n_x = \\sum_{y \\in Y} m_y $ and cost parameter $ \\zeta>1 $.\n", + "Let’s start setting up some Python code.\n", + "\n", + "We use the following imports:" + ] + }, + { + "cell_type": "code", + "execution_count": null, + "id": "8af6b529", + "metadata": { + "hide-output": false + }, + "outputs": [], + "source": [ + "import numpy as np\n", + "from scipy.optimize import linprog\n", + "from itertools import chain\n", + "import pandas as pd\n", + "from collections import namedtuple\n", + "\n", + "\n", + "import matplotlib.pyplot as plt\n", + "import matplotlib.patches as patches\n", + "from matplotlib.ticker import MaxNLocator\n", + "from matplotlib import cm\n", + "from matplotlib.colors import Normalize" + ] + }, + { + "cell_type": "markdown", + "id": "79467e74", + "metadata": {}, + "source": [ + "The following Python class takes as inputs sets of types $ X,Y \\subset \\mathbb{R}, $ marginals $ n, m $ with positive integer entries such that $ \\sum_{x \\in X} n_x = \\sum_{y \\in Y} m_y $ and cost parameter $ \\zeta>1 $.\n", "\n", "The cost function is stored as an $ |X| \\times |Y| $ matrix with $ (x,y) $-entry equal to $ |x-y|^{1/\\zeta}, $ i.e., the cost of matching an agent of type $ x \\in X $ with an agent of type $ y \\in Y. $" ] @@ -124,7 +152,7 @@ { "cell_type": "code", "execution_count": null, - "id": "8c3cfec1", + "id": "ec037bf1", "metadata": { "hide-output": false }, @@ -156,7 +184,7 @@ }, { "cell_type": "markdown", - "id": "3949199d", + "id": "07fb1139", "metadata": {}, "source": [ "Let’s consider a random instance with given numbers of types $ |X| $ and $ |Y| $ and a given number of agents.\n", @@ -169,7 +197,7 @@ { "cell_type": "code", "execution_count": null, - "id": "dd7d7bf8", + "id": "622542f4", "metadata": { "hide-output": false }, @@ -216,7 +244,7 @@ }, { "cell_type": "markdown", - "id": "dd4500d0", + "id": "421a16cf", "metadata": {}, "source": [ "We use $ F $ (resp. $ G $) to denote the cumulative distribution function associated to the measure $ n $ (resp. $ m $)\n", @@ -237,7 +265,7 @@ { "cell_type": "code", "execution_count": null, - "id": "f5ff1a9b", + "id": "c586c87f", "metadata": { "hide-output": false }, @@ -275,7 +303,7 @@ { "cell_type": "code", "execution_count": null, - "id": "551bb841", + "id": "1dd612c3", "metadata": { "hide-output": false }, @@ -286,7 +314,7 @@ }, { "cell_type": "markdown", - "id": "eba653ba", + "id": "6bedddac", "metadata": {}, "source": [ "## Characterization of primal solution" @@ -294,7 +322,7 @@ }, { "cell_type": "markdown", - "id": "aa854de0", + "id": "9b70a70f", "metadata": {}, "source": [ "### Three properties of an optimal solution\n", @@ -330,7 +358,7 @@ { "cell_type": "code", "execution_count": null, - "id": "8ea5e225", + "id": "737c5da4", "metadata": { "hide-output": false }, @@ -362,7 +390,7 @@ { "cell_type": "code", "execution_count": null, - "id": "5020bdc9", + "id": "5c45f369", "metadata": { "hide-output": false }, @@ -376,7 +404,7 @@ }, { "cell_type": "markdown", - "id": "d059d90b", + "id": "f1e7d8b7", "metadata": {}, "source": [ "We can therefore create a new instance with the residual marginals that will feature no perfect pairs.\n", @@ -405,7 +433,7 @@ { "cell_type": "code", "execution_count": null, - "id": "7da1af6d", + "id": "93b922c6", "metadata": { "hide-output": false }, @@ -448,7 +476,7 @@ }, { "cell_type": "markdown", - "id": "59b75348", + "id": "41e1f7f0", "metadata": {}, "source": [ "We add a function that returns an instance of the off-diagonal subclass as well as the on-diagonal matching and the indices of the residual off-diagonal types.\n", @@ -459,7 +487,7 @@ { "cell_type": "code", "execution_count": null, - "id": "923eae13", + "id": "4f96765f", "metadata": { "hide-output": false }, @@ -487,7 +515,7 @@ }, { "cell_type": "markdown", - "id": "de5dea25", + "id": "e2095837", "metadata": {}, "source": [ "We apply it to our example:" @@ -496,7 +524,7 @@ { "cell_type": "code", "execution_count": null, - "id": "4bea3a78", + "id": "806db2b0", "metadata": { "hide-output": false }, @@ -507,7 +535,7 @@ }, { "cell_type": "markdown", - "id": "6736da03", + "id": "9f17b51a", "metadata": {}, "source": [ "Let’s plot the residual marginals to verify visually that there are no overlappings between types from distinct sides in the off-diagonal instance." @@ -516,7 +544,7 @@ { "cell_type": "code", "execution_count": null, - "id": "3a887bdb", + "id": "4c3754c3", "metadata": { "hide-output": false }, @@ -527,7 +555,7 @@ }, { "cell_type": "markdown", - "id": "eb31989d", + "id": "a3e07441", "metadata": {}, "source": [ "**(No intersecting pairs)** This property summarizes the following fact:\n", @@ -635,7 +663,7 @@ { "cell_type": "code", "execution_count": null, - "id": "cc2b52d4", + "id": "7689df67", "metadata": { "hide-output": false }, @@ -686,7 +714,7 @@ { "cell_type": "code", "execution_count": null, - "id": "bef7cd24", + "id": "2a2196ca", "metadata": { "hide-output": false }, @@ -697,7 +725,7 @@ }, { "cell_type": "markdown", - "id": "f2840e63", + "id": "6be932c0", "metadata": {}, "source": [ "The layering property extends to the general discrete setting.\n", @@ -738,7 +766,7 @@ { "cell_type": "code", "execution_count": null, - "id": "4343f2ae", + "id": "11463e5f", "metadata": { "hide-output": false }, @@ -773,7 +801,7 @@ { "cell_type": "code", "execution_count": null, - "id": "f51552de", + "id": "a8de9a2e", "metadata": { "hide-output": false }, @@ -785,7 +813,7 @@ }, { "cell_type": "markdown", - "id": "220e1fb9", + "id": "25e8a256", "metadata": {}, "source": [ "The following method gives a graphical representation of the layers.\n", @@ -799,7 +827,7 @@ { "cell_type": "code", "execution_count": null, - "id": "d425f8fc", + "id": "af486880", "metadata": { "hide-output": false }, @@ -844,7 +872,7 @@ { "cell_type": "code", "execution_count": null, - "id": "39607f07", + "id": "28c62963", "metadata": { "hide-output": false }, @@ -855,7 +883,7 @@ }, { "cell_type": "markdown", - "id": "0a43832b", + "id": "60fc02d3", "metadata": {}, "source": [ "### Solving a layer\n", @@ -878,7 +906,7 @@ { "cell_type": "code", "execution_count": null, - "id": "7c3b8351", + "id": "6bbf357f", "metadata": { "hide-output": false }, @@ -931,7 +959,7 @@ }, { "cell_type": "markdown", - "id": "6538b392", + "id": "dc6a1bec", "metadata": {}, "source": [ "Given the structure of a layer and the *no intersecting pairs* property, the optimal matching and value of the layer can be found recursively.\n", @@ -964,7 +992,7 @@ { "cell_type": "code", "execution_count": null, - "id": "9f116542", + "id": "48cfd92d", "metadata": { "hide-output": false }, @@ -1004,7 +1032,7 @@ }, { "cell_type": "markdown", - "id": "6fa89a12", + "id": "14f6974a", "metadata": {}, "source": [ "Let’s compute values for the layer from our example.\n", @@ -1015,7 +1043,7 @@ { "cell_type": "code", "execution_count": null, - "id": "6b8ee4f1", + "id": "5f3138bc", "metadata": { "hide-output": false }, @@ -1033,12 +1061,12 @@ }, { "cell_type": "markdown", - "id": "7e1f1feb", + "id": "6e6d2657", "metadata": {}, "source": [ "Having computed the value function, we can proceed to compute the optimal matching as the *policy* that attains the value function that solves the Bellman equation (*policy evaluation*).\n", "\n", - "Specifically, we start from agent $ 1 $ and match it with the $ k $ that achieves the minimum in the equation associated with $ V_{1,2N_\\ell}; $\n", + "We start from agent $ 1 $ and match it with the $ k $ that achieves the minimum in the equation associated with $ V_{1,2N_\\ell}. $\n", "\n", "Then we store segments $ [2,k-1] $ and $ [k+1,2N_\\ell] $ (if not empty).\n", "\n", @@ -1050,7 +1078,7 @@ { "cell_type": "code", "execution_count": null, - "id": "6a94c817", + "id": "125ba739", "metadata": { "hide-output": false }, @@ -1095,7 +1123,7 @@ }, { "cell_type": "markdown", - "id": "de2f325b", + "id": "750537c7", "metadata": {}, "source": [ "Lets apply this method our example to find the matching within the layer and then rescale it by $ M_\\ell $.\n", @@ -1106,7 +1134,7 @@ { "cell_type": "code", "execution_count": null, - "id": "0d1a2e9d", + "id": "a90b9061", "metadata": { "hide-output": false }, @@ -1120,7 +1148,7 @@ }, { "cell_type": "markdown", - "id": "fb87bf64", + "id": "b854d7fa", "metadata": {}, "source": [ "The following method plots the matching within a layer.\n", @@ -1131,7 +1159,7 @@ { "cell_type": "code", "execution_count": null, - "id": "014f1510", + "id": "bbe24cc2", "metadata": { "hide-output": false }, @@ -1181,7 +1209,7 @@ { "cell_type": "code", "execution_count": null, - "id": "5ec4762d", + "id": "5d544d26", "metadata": { "hide-output": false }, @@ -1192,14 +1220,14 @@ }, { "cell_type": "markdown", - "id": "95a63532", + "id": "18788372", "metadata": {}, "source": [ "#### Solving a layer in a smarter way\n", "\n", - "We will now present two key results in the context of OT with concave type costs.\n", + "We now present two key results in the context of OT with concave type costs.\n", "\n", - "We refer [[Boerma *et al.*, 2023](https://python-advanced.quantecon.org/zreferences.html#id3)] and [[Delon *et al.*, 2011](https://python-advanced.quantecon.org/zreferences.html#id4)] for proofs.\n", + "We refer [[Boerma *et al.*, 2024](https://python-advanced.quantecon.org/zreferences.html#id3)] and [[Delon *et al.*, 2011](https://python-advanced.quantecon.org/zreferences.html#id4)] for proofs.\n", "\n", "Consider the problem faced within a layer, i.e., types from $ Y \\sqcup X $\n", "\n", @@ -1231,7 +1259,7 @@ { "cell_type": "code", "execution_count": null, - "id": "1a43f224", + "id": "d99c373a", "metadata": { "hide-output": false }, @@ -1271,7 +1299,7 @@ }, { "cell_type": "markdown", - "id": "cb35a51c", + "id": "7358859a", "metadata": {}, "source": [ "Let’s apply the algorithm to our example and compare outcomes with those attained with the Bellman equations above." @@ -1280,7 +1308,7 @@ { "cell_type": "code", "execution_count": null, - "id": "4473fce4", + "id": "a9864017", "metadata": { "hide-output": false }, @@ -1302,10 +1330,10 @@ }, { "cell_type": "markdown", - "id": "da6b1e9c", + "id": "a5a4b058", "metadata": {}, "source": [ - "Thanks to the results in this section, we can actually compute the optimal matching within the layer cuncurrently to the computation of the value function, rather than afterwards.\n", + "We can actually compute the optimal matching within the layer simultaneously with computing the value function, rather than sequentially.\n", "\n", "The key idea is that, if at some step of the computation of the values the left branch of the minimum above achieves the minimum, say $ V_{ij}= c_{ij} + V_{i+1,j-1}, $ then $ (i,j) $ are optimally matched on $ [i,j] $ and by the theorem above we get that a matching on $ [i+1,j-1] $ which achieves $ V_{i+1,j-1} $ belongs to an optimal matching on the whole layer (since it is covered by the arc $ (i,j) $ in $ [i,j] $).\n", "\n", @@ -1327,7 +1355,7 @@ { "cell_type": "code", "execution_count": null, - "id": "85ac631a", + "id": "d1a37a3d", "metadata": { "hide-output": false }, @@ -1394,7 +1422,7 @@ { "cell_type": "code", "execution_count": null, - "id": "0f18aaf5", + "id": "7f1965b2", "metadata": { "hide-output": false }, @@ -1410,7 +1438,7 @@ { "cell_type": "code", "execution_count": null, - "id": "e335db5c", + "id": "17c976d3", "metadata": { "hide-output": false }, @@ -1421,7 +1449,7 @@ }, { "cell_type": "markdown", - "id": "dd805537", + "id": "5a8a4776", "metadata": {}, "source": [ "## Solving primal problem\n", @@ -1430,7 +1458,7 @@ "\n", "First, if matches are perfect pairs, we store the on-diagonal matching and create an off-diagonal instance with the residual marginals.\n", "\n", - "Then, we compute the set of layers of the residual distributions.\n", + "Then we compute the set of layers of the residual distributions.\n", "\n", "Finally, we solve each layer and put together matchings within each layer with the on-diagonal matchings.\n", "\n", @@ -1440,7 +1468,7 @@ { "cell_type": "code", "execution_count": null, - "id": "7877b755", + "id": "a7916cd1", "metadata": { "hide-output": false }, @@ -1474,7 +1502,7 @@ { "cell_type": "code", "execution_count": null, - "id": "d0f3fa0f", + "id": "fb6fbc15", "metadata": { "hide-output": false }, @@ -1485,7 +1513,7 @@ }, { "cell_type": "markdown", - "id": "98c76ac4", + "id": "3bcf1308", "metadata": {}, "source": [ "We implement a similar method that adopts the DSS algorithm" @@ -1494,7 +1522,7 @@ { "cell_type": "code", "execution_count": null, - "id": "20696f4e", + "id": "a33c0bb5", "metadata": { "hide-output": false }, @@ -1527,7 +1555,7 @@ { "cell_type": "code", "execution_count": null, - "id": "55119205", + "id": "b4242d73", "metadata": { "hide-output": false }, @@ -1539,7 +1567,7 @@ }, { "cell_type": "markdown", - "id": "c5aeb54d", + "id": "49c33247", "metadata": {}, "source": [ "By drawing semicircles joining the matched agents (with distinct types), we can visualize the off-diagonal matching.\n", @@ -1550,7 +1578,7 @@ { "cell_type": "code", "execution_count": null, - "id": "1ce9e842", + "id": "827f6e6f", "metadata": { "hide-output": false }, @@ -1645,7 +1673,7 @@ { "cell_type": "code", "execution_count": null, - "id": "b44ea6e8", + "id": "f5b463d0", "metadata": { "hide-output": false }, @@ -1659,7 +1687,7 @@ }, { "cell_type": "markdown", - "id": "d6fc09ed", + "id": "ae7ffc11", "metadata": {}, "source": [ "### Verify with linear programming\n", @@ -1670,7 +1698,7 @@ { "cell_type": "code", "execution_count": null, - "id": "bdbf562d", + "id": "54dc4dbd", "metadata": { "hide-output": false }, @@ -1699,7 +1727,7 @@ { "cell_type": "code", "execution_count": null, - "id": "297fa557", + "id": "96dff11c", "metadata": { "hide-output": false }, @@ -1715,7 +1743,7 @@ }, { "cell_type": "markdown", - "id": "1f949074", + "id": "903b493b", "metadata": {}, "source": [ "## Examples" @@ -1723,12 +1751,12 @@ }, { "cell_type": "markdown", - "id": "00f8a5fa", + "id": "3e75dfab", "metadata": {}, "source": [ "### Example 1\n", "\n", - "In this notebook we study optimal transport problems on the real line with cost $ c(x,y)= h(|x-y|) $ for a strictly concave and increasing function $ h: \\mathbb{R}_+ \\rightarrow \\mathbb{R}_+. $\n", + "We study optimal transport problems on the real line with cost $ c(x,y)= h(|x-y|) $ for a strictly concave and increasing function $ h: \\mathbb{R}_+ \\rightarrow \\mathbb{R}_+. $\n", "\n", "The outcome is called *composite sorting*.\n", "\n", @@ -1780,7 +1808,7 @@ { "cell_type": "code", "execution_count": null, - "id": "cf0c06ca", + "id": "ef064de7", "metadata": { "hide-output": false }, @@ -1818,7 +1846,7 @@ }, { "cell_type": "markdown", - "id": "06696e12", + "id": "076be401", "metadata": {}, "source": [ "To explore the coincidental resemblence to a NAM outcome, let’s shift left type $ \\textcolor{red}{y_0} $ while keeping it in between $ \\textcolor{blue}{x_0} $ and $ \\textcolor{blue}{x_1} $.\n", @@ -1831,7 +1859,7 @@ { "cell_type": "code", "execution_count": null, - "id": "18678af4", + "id": "8a15c893", "metadata": { "hide-output": false }, @@ -1865,10 +1893,10 @@ }, { "cell_type": "markdown", - "id": "5bfc22a6", + "id": "c96fb086", "metadata": {}, "source": [ - "Finally, notice that the the **Monge problem** cost function $ |x-y| $ equals the limit of composite sorting cost $ |x-y|^{1/\\zeta} $ as $ \\zeta \\downarrow 1 $ and also the limit of $ |x-y|^p $ as $ p \\downarrow 1. $\n", + "Finally, notice that the **Monge problem** cost function $ |x-y| $ equals the limit of the composite sorting cost $ |x-y|^{1/\\zeta} $ as $ \\zeta \\downarrow 1 $ and also the limit of $ |x-y|^p $ as $ p \\downarrow 1. $\n", "\n", "Evidently, the Monge problem is solved by both the PAM and the composite sorting assignment that arises for $ \\zeta \\downarrow 1. $\n", "\n", @@ -1880,7 +1908,7 @@ { "cell_type": "code", "execution_count": null, - "id": "9b0fffc3", + "id": "2103cff4", "metadata": { "hide-output": false }, @@ -1921,7 +1949,7 @@ }, { "cell_type": "markdown", - "id": "107014a3", + "id": "eed9912b", "metadata": {}, "source": [ "### Example 2\n", @@ -1949,7 +1977,7 @@ { "cell_type": "code", "execution_count": null, - "id": "d6bfd26c", + "id": "53c3a7b0", "metadata": { "hide-output": false }, @@ -1984,12 +2012,12 @@ }, { "cell_type": "markdown", - "id": "07305f0f", + "id": "b5f34904", "metadata": {}, "source": [ - "### Example 3 : from the paper\n", + "### Example 3\n", "\n", - "Boerma et al. provide the following example.\n", + "[[Boerma *et al.*, 2024](https://python-advanced.quantecon.org/zreferences.html#id3)] provide the following example.\n", "\n", "There are four agents per side and three types per side (so the problem is not unitary, as opposed to the examples above)." ] @@ -1997,7 +2025,7 @@ { "cell_type": "code", "execution_count": null, - "id": "790f8684", + "id": "bad55a25", "metadata": { "hide-output": false }, @@ -2016,7 +2044,7 @@ }, { "cell_type": "markdown", - "id": "8720e620", + "id": "9995a337", "metadata": {}, "source": [ "In the case of positive assortative matching (PAM), the two agents with lowest value $ \\textcolor{blue}{x_0} $ are matched with the lowest valued agents on the other side $ \\textcolor{red}{y_0},\\textcolor{red}{y_1}. $\n", @@ -2029,7 +2057,7 @@ { "cell_type": "code", "execution_count": null, - "id": "1c4793ca", + "id": "c49400b4", "metadata": { "hide-output": false }, @@ -2051,12 +2079,12 @@ }, { "cell_type": "markdown", - "id": "0cadcc53", + "id": "8045aed9", "metadata": {}, "source": [ "## Dual Solution\n", "\n", - "Let us recall our formulation\n", + "Let’s recall the formulation\n", "\n", "$$\n", "\\begin{aligned}\n", @@ -2079,7 +2107,11 @@ "\n", "Since the dual is feasible and bounded, $ V_P = V_D $ (*strong duality* prevails).\n", "\n", - "Assume now that $ y_{xy} = \\alpha_x + \\gamma_y - c_{xy} $ is the output generated by matching $ x $ and $ y. $ It includes the sum of $ x $ and $ y $ specific amenities/outputs minus the cost $ c_{xy}. $ Then, we have can formulate the following problem and its dual\n", + "Assume now that $ y_{xy} = \\alpha_x + \\gamma_y - c_{xy} $ is the output generated by matching $ x $ and $ y. $\n", + "\n", + "It includes the sum of $ x $ and $ y $ specific amenities/outputs minus the cost $ c_{xy}. $\n", + "\n", + "Then we can formulate the following problem and its dual\n", "\n", "$$\n", "\\begin{aligned}\n", @@ -2104,7 +2136,7 @@ "\n", "The dual solution $ (u,v) $ of $ W_D $ can be interpreted as equilibrium utilities of the agents, which include the individual specific amenities and equilibrium shadow costs.\n", "\n", - "[[Boerma *et al.*, 2023](https://python-advanced.quantecon.org/zreferences.html#id3)] propose an efficient method to compute the dual variables from the optimal matching (primal solution) in the case of composite sorting.\n", + "[[Boerma *et al.*, 2024](https://python-advanced.quantecon.org/zreferences.html#id3)] propose an efficient method to compute the dual variables from the optimal matching (primal solution) in the case of composite sorting.\n", "\n", "Let’s generate an instance and compute the optimal matching." ] @@ -2112,7 +2144,7 @@ { "cell_type": "code", "execution_count": null, - "id": "ad59559b", + "id": "c8c578ec", "metadata": { "hide-output": false }, @@ -2140,7 +2172,7 @@ }, { "cell_type": "markdown", - "id": "2179f838", + "id": "beee650b", "metadata": {}, "source": [ "Having computed the optimal matching, we say that a pair $ (x_0,y_0) $ is a *subpair* of a matched pair $ (x,y) $ if $ x_0,y_0 $ are in the open interval between $ x $ and $ y $ and the pair $ (x_0,y_0) $ is not nested.\n", @@ -2155,7 +2187,7 @@ { "cell_type": "code", "execution_count": null, - "id": "95c8e8eb", + "id": "3a4d93ef", "metadata": { "hide-output": false }, @@ -2230,7 +2262,7 @@ { "cell_type": "code", "execution_count": null, - "id": "ba486f54", + "id": "5db1af85", "metadata": { "hide-output": false }, @@ -2243,7 +2275,7 @@ }, { "cell_type": "markdown", - "id": "14d23166", + "id": "1c0dfce3", "metadata": {}, "source": [ "The algorithm to compute the dual variables has a hierarchical structure: it starts from the matched pairs with no subpairs and then moves to those pairs whose subpairs have been already processed.\n", @@ -2254,7 +2286,7 @@ { "cell_type": "code", "execution_count": null, - "id": "6c7c23da", + "id": "41614a69", "metadata": { "hide-output": false }, @@ -2363,7 +2395,7 @@ { "cell_type": "code", "execution_count": null, - "id": "261a9111", + "id": "6c44f729", "metadata": { "hide-output": false }, @@ -2374,14 +2406,14 @@ }, { "cell_type": "markdown", - "id": "abedb741", + "id": "665ff690", "metadata": {}, "source": [ "We proceed to describe and implement the algorithm to compute the dual solution.\n", "\n", "As already mentioned, the algorithm starts from the matched pairs $ (x_0,y_0) $ with no subpairs and assigns the (temporary) values $ \\psi_{x_0} = c_{x_0 y_0} $ and $ \\psi_{y_0} = 0, $ i.e. the $ x $ type sustains the whole cost of matching.\n", "\n", - "Then, the algorithm proceeds iterarively by processing any matched pair whose subpairs have already been processed.\n", + "The algorithm then proceeds sequentially by processing any matched pair whose subpairs have already been processed.\n", "\n", "After picking any such matched pair $ (x_0,y_0) $, the dual variables already computed for the processed subpairs need to be made “comparable”.\n", "\n", @@ -2425,7 +2457,7 @@ { "cell_type": "code", "execution_count": null, - "id": "9e7d1b08", + "id": "b0331c2a", "metadata": { "hide-output": false }, @@ -2477,7 +2509,7 @@ }, { "cell_type": "markdown", - "id": "c7fdea7a", + "id": "7a2d5265", "metadata": {}, "source": [ "The following method iteratively processes the matched pairs of the off-diagonal matching as explained above." @@ -2486,7 +2518,7 @@ { "cell_type": "code", "execution_count": null, - "id": "4f5785ae", + "id": "3ec7e6b5", "metadata": { "hide-output": false }, @@ -2566,7 +2598,7 @@ }, { "cell_type": "markdown", - "id": "a3ae1311", + "id": "2ee1fb77", "metadata": {}, "source": [ "We apply the algorithm to our example and check that dual feasibility ($ \\phi_x + \\psi_y \\leq c_{xy} $ for all $ x \\in X $ and $ y \\in Y $) as well as strong duality ($ V_P = V_D $) are satisfied." @@ -2575,7 +2607,7 @@ { "cell_type": "code", "execution_count": null, - "id": "2a4a8494", + "id": "aa94490c", "metadata": { "hide-output": false }, @@ -2606,7 +2638,7 @@ }, { "cell_type": "markdown", - "id": "d02c0589", + "id": "aea8a062", "metadata": {}, "source": [ "Having computed the dual variables of the off-diagonal types, we compute the dual variables for perfecly matched pairs by setting\n", @@ -2626,7 +2658,7 @@ { "cell_type": "code", "execution_count": null, - "id": "277aa3ca", + "id": "5087f190", "metadata": { "hide-output": false }, @@ -2661,7 +2693,7 @@ { "cell_type": "code", "execution_count": null, - "id": "09235059", + "id": "fc74b749", "metadata": { "hide-output": false }, @@ -2678,20 +2710,20 @@ }, { "cell_type": "markdown", - "id": "7f562bb7", + "id": "bc4695d6", "metadata": {}, "source": [ - "## Empirical application" + "## Application" ] }, { "cell_type": "markdown", - "id": "cbd8d4bf", + "id": "c65a8b0b", "metadata": {}, "source": [ "### Data\n", "\n", - "We now replicate the empirical analysis carried out by [[Boerma *et al.*, 2023](https://python-advanced.quantecon.org/zreferences.html#id3)].\n", + "We now replicate the empirical analysis carried out by [[Boerma *et al.*, 2024](https://python-advanced.quantecon.org/zreferences.html#id3)].\n", "\n", "The dataset is obtained from the American Community Survey and contains individual level data on income, age and occupation.\n", "\n", @@ -2699,7 +2731,11 @@ "\n", "There are 497 codes in total.\n", "\n", - "We consider only employed (civilian) individuals with ages between 25 and 60 from 2010 to 2017. To visualize log-wage dispersion, we group the individuals by occupation and compute the mean and standard deviation of the wages within each occupation. Then, we sort the occupations by average log-earnings within each occupation.\n", + "We consider only employed (civilian) individuals with ages between 25 and 60 from 2010 to 2017.\n", + "\n", + "To visualize log-wage dispersion, we group the individuals by occupation and compute the mean and standard deviation of the wages within each occupation.\n", + "\n", + "Then we sort occupations by average log-earnings within each occupation.\n", "\n", "The resulting dataset is included in the dataset `acs_data_summary.csv`" ] @@ -2707,7 +2743,7 @@ { "cell_type": "code", "execution_count": null, - "id": "19b68bb2", + "id": "d040435a", "metadata": { "hide-output": false }, @@ -2719,7 +2755,7 @@ }, { "cell_type": "markdown", - "id": "cd0aaf44", + "id": "afc5cfe1", "metadata": {}, "source": [ "We plot the wage standard deviation for the sorted occupations." @@ -2728,7 +2764,7 @@ { "cell_type": "code", "execution_count": null, - "id": "ed2ad5c7", + "id": "cb06563d", "metadata": { "hide-output": false }, @@ -2765,7 +2801,7 @@ }, { "cell_type": "markdown", - "id": "ce97b0da", + "id": "cf9d6d26", "metadata": {}, "source": [ "We also plot the average wages for each occupation (SOC code). Again, occupations are ordered by increasing average wage." @@ -2774,7 +2810,7 @@ { "cell_type": "code", "execution_count": null, - "id": "acfb637e", + "id": "33e216d3", "metadata": { "hide-output": false }, @@ -2808,7 +2844,7 @@ }, { "cell_type": "markdown", - "id": "68831974", + "id": "a47e61cf", "metadata": {}, "source": [ "### Model" @@ -2817,7 +2853,7 @@ { "cell_type": "code", "execution_count": null, - "id": "27e99c3e", + "id": "8331ec8f", "metadata": { "hide-output": false }, @@ -2840,7 +2876,7 @@ { "cell_type": "code", "execution_count": null, - "id": "a5e0ff8a", + "id": "69a58102", "metadata": { "hide-output": false }, @@ -2886,7 +2922,7 @@ }, { "cell_type": "markdown", - "id": "215a29f7", + "id": "55ca0149", "metadata": {}, "source": [ "Since we will consider examples with a large number of agents, it will be convenient to visualize the distributions as histograms approximating the pdfs." @@ -2895,7 +2931,7 @@ { "cell_type": "code", "execution_count": null, - "id": "25a8ff0b", + "id": "523fa6d5", "metadata": { "hide-output": false }, @@ -2940,7 +2976,7 @@ }, { "cell_type": "markdown", - "id": "2f361a5b", + "id": "e9e4ecec", "metadata": {}, "source": [ "We plot the hystograms and the measure of underqualification for the worker types and job types. We then compute the primal solution and plot the matching." @@ -2949,7 +2985,7 @@ { "cell_type": "code", "execution_count": null, - "id": "838e6940", + "id": "2cbe9585", "metadata": { "hide-output": false }, @@ -2964,7 +3000,7 @@ { "cell_type": "code", "execution_count": null, - "id": "b33756c9", + "id": "40d2a3cc", "metadata": { "hide-output": false }, @@ -2978,7 +3014,7 @@ { "cell_type": "code", "execution_count": null, - "id": "6977167a", + "id": "44b5ebe3", "metadata": { "hide-output": false }, @@ -2993,16 +3029,18 @@ }, { "cell_type": "markdown", - "id": "1f43f33c", + "id": "8ce3933f", "metadata": {}, "source": [ - "From the optimal matching we compute and visualize the hierarchies. Then, we find the dual solution $ (\\phi,\\psi) $ and compute the wages as $ w_x = g(x) - \\phi_x, $ assuming that the type-specific productivity of type $ x $ is $ g(x) = x $." + "From the optimal matching we compute and visualize the hierarchies.\n", + "\n", + "We then find the dual solution $ (\\phi,\\psi) $ and compute the wages as $ w_x = g(x) - \\phi_x, $ assuming that the type-specific productivity of type $ x $ is $ g(x) = x $." ] }, { "cell_type": "code", "execution_count": null, - "id": "0cbb347b", + "id": "455a3d8e", "metadata": { "hide-output": false }, @@ -3037,16 +3075,16 @@ }, { "cell_type": "markdown", - "id": "a58f079d", + "id": "a907935f", "metadata": {}, "source": [ - "Let us plot the average wages and wage dispersion generated by the model." + "Let’s plot average wages and wage dispersion generated by the model." ] }, { "cell_type": "code", "execution_count": null, - "id": "dc5e5a9b", + "id": "4ba44414", "metadata": { "hide-output": false }, @@ -3095,7 +3133,7 @@ { "cell_type": "code", "execution_count": null, - "id": "ed53452e", + "id": "bdad9718", "metadata": { "hide-output": false }, @@ -3106,7 +3144,7 @@ } ], "metadata": { - "date": 1734843462.5408902, + "date": 1735958032.2017026, "filename": "match_transport.md", "kernelspec": { "display_name": "Python", diff --git a/matsuyama.ipynb b/matsuyama.ipynb index cec3780..4a203cb 100644 --- a/matsuyama.ipynb +++ b/matsuyama.ipynb @@ -2,7 +2,7 @@ "cells": [ { "cell_type": "markdown", - "id": "63fe1ff6", + "id": "1c6ecac7", "metadata": {}, "source": [ "\n", @@ -11,7 +11,7 @@ }, { "cell_type": "markdown", - "id": "67f60588", + "id": "f526fffd", "metadata": {}, "source": [ "# Globalization and Cycles" @@ -19,7 +19,7 @@ }, { "cell_type": "markdown", - "id": "73ea3edf", + "id": "6bdfa59e", "metadata": {}, "source": [ "## Overview\n", @@ -44,7 +44,7 @@ { "cell_type": "code", "execution_count": null, - "id": "d9fbe3bb", + "id": "461ae2e3", "metadata": { "hide-output": false }, @@ -58,7 +58,7 @@ }, { "cell_type": "markdown", - "id": "d808b3a5", + "id": "467f6a3f", "metadata": {}, "source": [ "### Background\n", @@ -74,7 +74,7 @@ }, { "cell_type": "markdown", - "id": "343b8926", + "id": "fe50d336", "metadata": {}, "source": [ "## Key Ideas\n", @@ -84,7 +84,7 @@ }, { "cell_type": "markdown", - "id": "9aa01354", + "id": "9b80ab77", "metadata": {}, "source": [ "### Innovation Cycles\n", @@ -112,7 +112,7 @@ }, { "cell_type": "markdown", - "id": "4b85c593", + "id": "32544bb8", "metadata": {}, "source": [ "### Synchronization\n", @@ -128,7 +128,7 @@ }, { "cell_type": "markdown", - "id": "01f16c8d", + "id": "e30c2abf", "metadata": {}, "source": [ "## Model\n", @@ -176,7 +176,7 @@ }, { "cell_type": "markdown", - "id": "0e75c3da", + "id": "3845943f", "metadata": {}, "source": [ "### Prices\n", @@ -266,7 +266,7 @@ }, { "cell_type": "markdown", - "id": "79419e00", + "id": "1eb39fd0", "metadata": {}, "source": [ "### New Varieties\n", @@ -298,7 +298,7 @@ }, { "cell_type": "markdown", - "id": "729ca0ae", + "id": "41a73f8b", "metadata": {}, "source": [ "### Law of Motion\n", @@ -377,7 +377,7 @@ }, { "cell_type": "markdown", - "id": "0ece701d", + "id": "0e83fa45", "metadata": {}, "source": [ "## Simulation\n", @@ -404,7 +404,7 @@ { "cell_type": "code", "execution_count": null, - "id": "169930a0", + "id": "47445277", "metadata": { "hide-output": false }, @@ -717,7 +717,7 @@ }, { "cell_type": "markdown", - "id": "717ef3df", + "id": "a7549991", "metadata": {}, "source": [ "### Time Series of Firm Measures\n", @@ -734,7 +734,7 @@ { "cell_type": "code", "execution_count": null, - "id": "9b6c1782", + "id": "b4b5256f", "metadata": { "hide-output": false }, @@ -774,7 +774,7 @@ }, { "cell_type": "markdown", - "id": "6e62513c", + "id": "29a5724b", "metadata": {}, "source": [ "In the first case, innovation in the two countries does not synchronize.\n", @@ -785,7 +785,7 @@ }, { "cell_type": "markdown", - "id": "cf2e9924", + "id": "85172cd4", "metadata": {}, "source": [ "### Basin of Attraction\n", @@ -820,7 +820,7 @@ }, { "cell_type": "markdown", - "id": "df69b92e", + "id": "daff13b5", "metadata": {}, "source": [ "## Exercises" @@ -828,7 +828,7 @@ }, { "cell_type": "markdown", - "id": "93b57a54", + "id": "7e80952f", "metadata": {}, "source": [ "## Exercise 14.1\n", @@ -838,7 +838,7 @@ }, { "cell_type": "markdown", - "id": "daf11821", + "id": "012900dc", "metadata": {}, "source": [ "## Solution to[ Exercise 14.1](https://python-advanced.quantecon.org/#matsuyama_ex1)" @@ -847,7 +847,7 @@ { "cell_type": "code", "execution_count": null, - "id": "9a765a51", + "id": "c92d92c6", "metadata": { "hide-output": false }, @@ -903,7 +903,7 @@ }, { "cell_type": "markdown", - "id": "aeb9ba10", + "id": "c83da67c", "metadata": {}, "source": [ "Additionally, instead of just seeing 4 plots at once, we might want to\n", @@ -921,7 +921,7 @@ { "cell_type": "code", "execution_count": null, - "id": "1f942c1e", + "id": "51aa2607", "metadata": { "hide-output": false }, @@ -946,7 +946,7 @@ { "cell_type": "code", "execution_count": null, - "id": "d04668f7", + "id": "ce63afda", "metadata": { "hide-output": false }, @@ -960,7 +960,7 @@ } ], "metadata": { - "date": 1734843462.5672836, + "date": 1735958032.2270238, "filename": "matsuyama.md", "kernelspec": { "display_name": "Python", diff --git a/muth_kalman.ipynb b/muth_kalman.ipynb index d01a0ec..06955da 100644 --- a/muth_kalman.ipynb +++ b/muth_kalman.ipynb @@ -2,7 +2,7 @@ "cells": [ { "cell_type": "markdown", - "id": "ffcec1e8", + "id": "f0f0002f", "metadata": {}, "source": [ "\n", @@ -13,7 +13,7 @@ }, { "cell_type": "markdown", - "id": "0ba24b36", + "id": "098734f2", "metadata": {}, "source": [ "# Reverse Engineering a la Muth\n", @@ -24,7 +24,7 @@ { "cell_type": "code", "execution_count": null, - "id": "c67ed266", + "id": "bf6d23f5", "metadata": { "hide-output": false }, @@ -35,7 +35,7 @@ }, { "cell_type": "markdown", - "id": "244fbc76", + "id": "52c54301", "metadata": {}, "source": [ "We’ll also need the following imports:" @@ -44,7 +44,7 @@ { "cell_type": "code", "execution_count": null, - "id": "79bedacf", + "id": "d29782f7", "metadata": { "hide-output": false }, @@ -60,7 +60,7 @@ }, { "cell_type": "markdown", - "id": "151ff177", + "id": "25830bde", "metadata": {}, "source": [ "This lecture uses the Kalman filter to reformulate John F. Muth’s first\n", @@ -73,7 +73,7 @@ }, { "cell_type": "markdown", - "id": "d7567a10", + "id": "8bcb5be3", "metadata": {}, "source": [ "## Friedman (1956) and Muth (1960)\n", @@ -124,7 +124,7 @@ }, { "cell_type": "markdown", - "id": "6db4d782", + "id": "9cdfac49", "metadata": {}, "source": [ "## A Process for Which Adaptive Expectations are Optimal\n", @@ -192,7 +192,7 @@ { "cell_type": "code", "execution_count": null, - "id": "5c7afac1", + "id": "128b42f6", "metadata": { "hide-output": false }, @@ -225,7 +225,7 @@ }, { "cell_type": "markdown", - "id": "f14b58f1", + "id": "54f6642a", "metadata": {}, "source": [ "## Some Useful State-Space Math\n", @@ -282,7 +282,7 @@ { "cell_type": "code", "execution_count": null, - "id": "e7c038a6", + "id": "a915764d", "metadata": { "hide-output": false }, @@ -315,7 +315,7 @@ }, { "cell_type": "markdown", - "id": "a59c4022", + "id": "aa05faab", "metadata": {}, "source": [ "Now that we have simulated our joint system, we have $ x_t $,\n", @@ -327,7 +327,7 @@ }, { "cell_type": "markdown", - "id": "686969e3", + "id": "616d5707", "metadata": {}, "source": [ "## Estimates of Unobservables\n", @@ -340,7 +340,7 @@ { "cell_type": "code", "execution_count": null, - "id": "d505657f", + "id": "7ace695b", "metadata": { "hide-output": false }, @@ -357,7 +357,7 @@ }, { "cell_type": "markdown", - "id": "4d7c3e1e", + "id": "d251da08", "metadata": {}, "source": [ "Note how $ x_t $ and $ \\hat{x_t} $ differ.\n", @@ -368,7 +368,7 @@ }, { "cell_type": "markdown", - "id": "a3f58845", + "id": "c928608c", "metadata": {}, "source": [ "## Relationship of Unobservables to Observables\n", @@ -381,7 +381,7 @@ { "cell_type": "code", "execution_count": null, - "id": "78b22d56", + "id": "9533a7b8", "metadata": { "hide-output": false }, @@ -398,7 +398,7 @@ }, { "cell_type": "markdown", - "id": "6f053af3", + "id": "ee209938", "metadata": {}, "source": [ "We see above that $ y $ seems to look like white noise around the\n", @@ -407,7 +407,7 @@ }, { "cell_type": "markdown", - "id": "7016b084", + "id": "7033fa40", "metadata": {}, "source": [ "### Innovations\n", @@ -419,7 +419,7 @@ { "cell_type": "code", "execution_count": null, - "id": "8d669ab3", + "id": "922cf300", "metadata": { "hide-output": false }, @@ -435,7 +435,7 @@ }, { "cell_type": "markdown", - "id": "ca26655d", + "id": "6c5dada3", "metadata": {}, "source": [ "## MA and AR Representations\n", @@ -456,7 +456,7 @@ { "cell_type": "code", "execution_count": null, - "id": "728a7331", + "id": "7d19c542", "metadata": { "hide-output": false }, @@ -482,7 +482,7 @@ }, { "cell_type": "markdown", - "id": "0f015028", + "id": "cad8a0a4", "metadata": {}, "source": [ "The **moving average** coefficients in the top panel show tell-tale\n", @@ -499,7 +499,7 @@ { "cell_type": "code", "execution_count": null, - "id": "a2ffd5b0", + "id": "6f9d3f17", "metadata": { "hide-output": false }, @@ -510,7 +510,7 @@ } ], "metadata": { - "date": 1734843462.590252, + "date": 1735958032.2483373, "filename": "muth_kalman.md", "kernelspec": { "display_name": "Python", diff --git a/opt_tax_recur.ipynb b/opt_tax_recur.ipynb index 92f4d29..1dd1065 100644 --- a/opt_tax_recur.ipynb +++ b/opt_tax_recur.ipynb @@ -2,7 +2,7 @@ "cells": [ { "cell_type": "markdown", - "id": "8833729e", + "id": "71c84f31", "metadata": {}, "source": [ "\n", @@ -11,7 +11,7 @@ }, { "cell_type": "markdown", - "id": "8ed80de1", + "id": "3f603b4b", "metadata": {}, "source": [ "# Optimal Taxation with State-Contingent Debt\n", @@ -22,7 +22,7 @@ { "cell_type": "code", "execution_count": null, - "id": "58ab9ee0", + "id": "e7a72a92", "metadata": { "hide-output": false }, @@ -33,7 +33,7 @@ }, { "cell_type": "markdown", - "id": "ab8d9641", + "id": "a7689bfd", "metadata": {}, "source": [ "## Overview\n", @@ -74,7 +74,7 @@ { "cell_type": "code", "execution_count": null, - "id": "529eb220", + "id": "bfdc5403", "metadata": { "hide-output": false }, @@ -91,7 +91,7 @@ }, { "cell_type": "markdown", - "id": "62cc61a3", + "id": "1869a43d", "metadata": {}, "source": [ "## A Competitive Equilibrium with Distorting Taxes\n", @@ -208,7 +208,7 @@ }, { "cell_type": "markdown", - "id": "7263407c", + "id": "e77bd7e8", "metadata": {}, "source": [ "### Arrow-Debreu Version of Price System\n", @@ -236,7 +236,7 @@ }, { "cell_type": "markdown", - "id": "a658e1f5", + "id": "c897dbb3", "metadata": {}, "source": [ "### Primal Approach\n", @@ -268,7 +268,7 @@ }, { "cell_type": "markdown", - "id": "74758c89", + "id": "9b9fbf9f", "metadata": {}, "source": [ "### The Implementability Constraint\n", @@ -344,7 +344,7 @@ }, { "cell_type": "markdown", - "id": "6bacf095", + "id": "91768a40", "metadata": {}, "source": [ "### Solution Details\n", @@ -486,7 +486,7 @@ }, { "cell_type": "markdown", - "id": "517d5f58", + "id": "a900d986", "metadata": {}, "source": [ "### The Ramsey Allocation for a Given Multiplier\n", @@ -522,7 +522,7 @@ }, { "cell_type": "markdown", - "id": "24bb4c25", + "id": "3fc567e6", "metadata": {}, "source": [ "### Further Specialization\n", @@ -544,7 +544,7 @@ }, { "cell_type": "markdown", - "id": "bd339f9c", + "id": "721861d9", "metadata": {}, "source": [ "### Determining the Lagrange Multiplier\n", @@ -680,7 +680,7 @@ }, { "cell_type": "markdown", - "id": "62dab6a3", + "id": "3eaa9071", "metadata": {}, "source": [ "### Time Inconsistency\n", @@ -711,7 +711,7 @@ }, { "cell_type": "markdown", - "id": "129da80c", + "id": "ad516ad5", "metadata": {}, "source": [ "### Specification with CRRA Utility\n", @@ -796,7 +796,7 @@ }, { "cell_type": "markdown", - "id": "1630ea8f", + "id": "11a534ce", "metadata": {}, "source": [ "### Sequence Implementation\n", @@ -807,7 +807,7 @@ { "cell_type": "code", "execution_count": null, - "id": "7c5ab128", + "id": "6bcc6340", "metadata": { "hide-output": false }, @@ -1015,7 +1015,7 @@ }, { "cell_type": "markdown", - "id": "ec4abd4a", + "id": "39ad9baa", "metadata": {}, "source": [ "## Recursive Formulation of the Ramsey Problem\n", @@ -1032,7 +1032,7 @@ }, { "cell_type": "markdown", - "id": "dd5cf444", + "id": "64b895db", "metadata": {}, "source": [ "### Intertemporal Delegation\n", @@ -1081,7 +1081,7 @@ }, { "cell_type": "markdown", - "id": "69fc718f", + "id": "b04384df", "metadata": {}, "source": [ "### Two Bellman Equations\n", @@ -1100,7 +1100,7 @@ }, { "cell_type": "markdown", - "id": "69874792", + "id": "d77d4760", "metadata": {}, "source": [ "### The Continuation Ramsey Problem\n", @@ -1145,7 +1145,7 @@ }, { "cell_type": "markdown", - "id": "0363c5d8", + "id": "95c3c08b", "metadata": {}, "source": [ "### The Ramsey Problem\n", @@ -1198,7 +1198,7 @@ }, { "cell_type": "markdown", - "id": "1bec7dc1", + "id": "79a99550", "metadata": {}, "source": [ "### First-Order Conditions\n", @@ -1282,7 +1282,7 @@ }, { "cell_type": "markdown", - "id": "9b757e9d", + "id": "784f5b88", "metadata": {}, "source": [ "### State Variable Degeneracy\n", @@ -1310,7 +1310,7 @@ }, { "cell_type": "markdown", - "id": "b4e09e31", + "id": "b26439ab", "metadata": {}, "source": [ "### Manifestations of Time Inconsistency\n", @@ -1360,7 +1360,7 @@ }, { "cell_type": "markdown", - "id": "d5f4ec07", + "id": "3cdf6305", "metadata": {}, "source": [ "### Recursive Implementation\n", @@ -1371,7 +1371,7 @@ { "cell_type": "code", "execution_count": null, - "id": "6e7217e5", + "id": "d08bff09", "metadata": { "hide-output": false }, @@ -1625,7 +1625,7 @@ }, { "cell_type": "markdown", - "id": "123a6875", + "id": "eec9f6cd", "metadata": {}, "source": [ "## Examples\n", @@ -1635,7 +1635,7 @@ }, { "cell_type": "markdown", - "id": "1b788787", + "id": "0805a11a", "metadata": {}, "source": [ "### Anticipated One-Period War\n", @@ -1691,7 +1691,7 @@ { "cell_type": "code", "execution_count": null, - "id": "3a6151dc", + "id": "e389bbbb", "metadata": { "hide-output": false }, @@ -1747,7 +1747,7 @@ }, { "cell_type": "markdown", - "id": "3489405e", + "id": "e6e3f1d2", "metadata": {}, "source": [ "We set initial government debt $ b_0 = 1 $.\n", @@ -1761,7 +1761,7 @@ { "cell_type": "code", "execution_count": null, - "id": "8c9a82f6", + "id": "dbb9c09f", "metadata": { "hide-output": false }, @@ -1802,7 +1802,7 @@ }, { "cell_type": "markdown", - "id": "3ca1cd25", + "id": "073a1506", "metadata": {}, "source": [ "**Tax smoothing**\n", @@ -1848,7 +1848,7 @@ { "cell_type": "code", "execution_count": null, - "id": "2c9436d0", + "id": "fd68e22a", "metadata": { "hide-output": false }, @@ -1863,7 +1863,7 @@ }, { "cell_type": "markdown", - "id": "61430f84", + "id": "2a43102b", "metadata": {}, "source": [ "### Government Saving\n", @@ -1899,7 +1899,7 @@ }, { "cell_type": "markdown", - "id": "ea6759d9", + "id": "041168a8", "metadata": {}, "source": [ "### Time 0 Manipulation of Interest Rate\n", @@ -1917,7 +1917,7 @@ }, { "cell_type": "markdown", - "id": "ba10bc6c", + "id": "dc5aa7ad", "metadata": {}, "source": [ "### Time 0 and Time-Inconsistency\n", @@ -1937,7 +1937,7 @@ { "cell_type": "code", "execution_count": null, - "id": "05a88aff", + "id": "b0885087", "metadata": { "hide-output": false }, @@ -1971,7 +1971,7 @@ }, { "cell_type": "markdown", - "id": "358ce7c2", + "id": "11a4fefe", "metadata": {}, "source": [ "The figure indicates that if the government enters with positive debt, it sets\n", @@ -2021,7 +2021,7 @@ { "cell_type": "code", "execution_count": null, - "id": "afcc9004", + "id": "253b1cd3", "metadata": { "hide-output": false }, @@ -2051,7 +2051,7 @@ }, { "cell_type": "markdown", - "id": "60e7cb3e", + "id": "5f26fc6d", "metadata": {}, "source": [ "The tax rates in the figure are equal for only two values of initial government debt." @@ -2059,7 +2059,7 @@ }, { "cell_type": "markdown", - "id": "ca07aab9", + "id": "c1ff79b8", "metadata": {}, "source": [ "### Tax Smoothing and non-CRRA Preferences\n", @@ -2096,7 +2096,7 @@ { "cell_type": "code", "execution_count": null, - "id": "e564a8c0", + "id": "b4b22ed0", "metadata": { "hide-output": false }, @@ -2142,7 +2142,7 @@ }, { "cell_type": "markdown", - "id": "2f264dbe", + "id": "ad261003", "metadata": {}, "source": [ "Also, suppose that $ g_t $ follows a two-state IID process with equal\n", @@ -2156,7 +2156,7 @@ { "cell_type": "code", "execution_count": null, - "id": "a27419c5", + "id": "fd1d2fa6", "metadata": { "hide-output": false }, @@ -2198,7 +2198,7 @@ }, { "cell_type": "markdown", - "id": "69ebfd3c", + "id": "52b9f081", "metadata": {}, "source": [ "As should be expected, the recursive and sequential solutions produce almost\n", @@ -2211,7 +2211,7 @@ }, { "cell_type": "markdown", - "id": "30cb2dcc", + "id": "d88ad4ab", "metadata": {}, "source": [ "### Further Comments\n", @@ -2232,7 +2232,7 @@ } ], "metadata": { - "date": 1734843462.6714046, + "date": 1735958032.3209455, "filename": "opt_tax_recur.md", "kernelspec": { "display_name": "Python", diff --git a/orth_proj.ipynb b/orth_proj.ipynb index 42823b8..4929ff6 100644 --- a/orth_proj.ipynb +++ b/orth_proj.ipynb @@ -2,7 +2,7 @@ "cells": [ { "cell_type": "markdown", - "id": "b0219986", + "id": "c35f5d03", "metadata": {}, "source": [ "\n", @@ -11,7 +11,7 @@ }, { "cell_type": "markdown", - "id": "3291a0fb", + "id": "d26eaf7f", "metadata": {}, "source": [ "# Orthogonal Projections and Their Applications\n", @@ -22,7 +22,7 @@ }, { "cell_type": "markdown", - "id": "bd21e5f1", + "id": "9334e493", "metadata": {}, "source": [ "## Overview\n", @@ -51,7 +51,7 @@ { "cell_type": "code", "execution_count": null, - "id": "7584f9b9", + "id": "e1f2bdac", "metadata": { "hide-output": false }, @@ -63,7 +63,7 @@ }, { "cell_type": "markdown", - "id": "7a8c49b2", + "id": "88dc7d0a", "metadata": {}, "source": [ "### Further Reading\n", @@ -79,7 +79,7 @@ }, { "cell_type": "markdown", - "id": "0d71d947", + "id": "d862c9c9", "metadata": {}, "source": [ "## Key Definitions\n", @@ -143,7 +143,7 @@ }, { "cell_type": "markdown", - "id": "677c8b64", + "id": "4e05256f", "metadata": {}, "source": [ "### Linear Independence vs Orthogonality\n", @@ -157,7 +157,7 @@ }, { "cell_type": "markdown", - "id": "dc660a80", + "id": "d4dab5ce", "metadata": {}, "source": [ "## The Orthogonal Projection Theorem\n", @@ -188,7 +188,7 @@ }, { "cell_type": "markdown", - "id": "ad8a6b03", + "id": "951833aa", "metadata": {}, "source": [ "### Proof of Sufficiency\n", @@ -214,7 +214,7 @@ }, { "cell_type": "markdown", - "id": "78a2ca91", + "id": "e874eaee", "metadata": {}, "source": [ "### Orthogonal Projection as a Mapping\n", @@ -255,7 +255,7 @@ }, { "cell_type": "markdown", - "id": "30c7ed35", + "id": "ab7be7f9", "metadata": {}, "source": [ "#### Orthogonal Complement\n", @@ -296,7 +296,7 @@ }, { "cell_type": "markdown", - "id": "5b29ee77", + "id": "0de21d20", "metadata": {}, "source": [ "## Orthonormal Basis\n", @@ -342,7 +342,7 @@ }, { "cell_type": "markdown", - "id": "0644b579", + "id": "8f9910ff", "metadata": {}, "source": [ "### Projection onto an Orthonormal Basis\n", @@ -380,7 +380,7 @@ }, { "cell_type": "markdown", - "id": "7665fc80", + "id": "b116db0a", "metadata": {}, "source": [ "## Projection Via Matrix Algebra\n", @@ -442,7 +442,7 @@ }, { "cell_type": "markdown", - "id": "8707746e", + "id": "0fa5674e", "metadata": {}, "source": [ "### Starting with the Basis\n", @@ -464,7 +464,7 @@ }, { "cell_type": "markdown", - "id": "33215365", + "id": "4d6f931f", "metadata": {}, "source": [ "### The Orthonormal Case\n", @@ -495,7 +495,7 @@ }, { "cell_type": "markdown", - "id": "39cff6a9", + "id": "39a8df71", "metadata": {}, "source": [ "### Application: Overdetermined Systems of Equations\n", @@ -552,7 +552,7 @@ }, { "cell_type": "markdown", - "id": "78ed5406", + "id": "e6082224", "metadata": {}, "source": [ "## Least Squares Regression\n", @@ -566,7 +566,7 @@ }, { "cell_type": "markdown", - "id": "7c3a83fa", + "id": "8b64a87c", "metadata": {}, "source": [ "### Squared Risk Measures\n", @@ -604,7 +604,7 @@ }, { "cell_type": "markdown", - "id": "8f808339", + "id": "8a27ed99", "metadata": {}, "source": [ "### Solution\n", @@ -713,7 +713,7 @@ }, { "cell_type": "markdown", - "id": "c4acaba2", + "id": "322a7520", "metadata": {}, "source": [ "## Orthogonalization and Decomposition\n", @@ -730,7 +730,7 @@ }, { "cell_type": "markdown", - "id": "3373ac9c", + "id": "bc6356a3", "metadata": {}, "source": [ "### Gram-Schmidt Orthogonalization\n", @@ -763,7 +763,7 @@ }, { "cell_type": "markdown", - "id": "84e412e7", + "id": "0d17a4f1", "metadata": {}, "source": [ "### QR Decomposition\n", @@ -795,7 +795,7 @@ }, { "cell_type": "markdown", - "id": "cc0e1f18", + "id": "70245748", "metadata": {}, "source": [ "### Linear Regression via QR Decomposition\n", @@ -820,7 +820,7 @@ }, { "cell_type": "markdown", - "id": "c7f2f336", + "id": "f1d628e6", "metadata": {}, "source": [ "## Exercises" @@ -828,7 +828,7 @@ }, { "cell_type": "markdown", - "id": "96b0ba46", + "id": "e9c55e6b", "metadata": {}, "source": [ "## Exercise 1.1\n", @@ -838,7 +838,7 @@ }, { "cell_type": "markdown", - "id": "3211c7f3", + "id": "e65fcf72", "metadata": {}, "source": [ "## Solution to[ Exercise 1.1](https://python-advanced.quantecon.org/#op_ex1)\n", @@ -849,7 +849,7 @@ }, { "cell_type": "markdown", - "id": "f08d7c0a", + "id": "88a693a2", "metadata": {}, "source": [ "## Exercise 1.2\n", @@ -861,7 +861,7 @@ }, { "cell_type": "markdown", - "id": "8ad43d1a", + "id": "c0f946e2", "metadata": {}, "source": [ "## Solution to[ Exercise 1.2](https://python-advanced.quantecon.org/#op_ex2)\n", @@ -877,7 +877,7 @@ }, { "cell_type": "markdown", - "id": "26d89b37", + "id": "de7d7cca", "metadata": {}, "source": [ "## Exercise 1.3\n", @@ -912,7 +912,7 @@ }, { "cell_type": "markdown", - "id": "e33c19a4", + "id": "3058e83e", "metadata": {}, "source": [ "## Solution to[ Exercise 1.3](https://python-advanced.quantecon.org/#op_ex3)\n", @@ -924,7 +924,7 @@ { "cell_type": "code", "execution_count": null, - "id": "87fb2b31", + "id": "d3421d89", "metadata": { "hide-output": false }, @@ -970,7 +970,7 @@ }, { "cell_type": "markdown", - "id": "27e81a8c", + "id": "8fdb62ca", "metadata": {}, "source": [ "Here are the arrays we’ll work with" @@ -979,7 +979,7 @@ { "cell_type": "code", "execution_count": null, - "id": "4c254df5", + "id": "ff05b666", "metadata": { "hide-output": false }, @@ -996,7 +996,7 @@ }, { "cell_type": "markdown", - "id": "08819184", + "id": "4890e2fc", "metadata": {}, "source": [ "First, let’s try projection of $ y $ onto the column space of\n", @@ -1006,7 +1006,7 @@ { "cell_type": "code", "execution_count": null, - "id": "6b640bca", + "id": "4fe054a8", "metadata": { "hide-output": false }, @@ -1018,7 +1018,7 @@ }, { "cell_type": "markdown", - "id": "8b4372fe", + "id": "ada53d21", "metadata": {}, "source": [ "Now let’s do the same using an orthonormal basis created from our\n", @@ -1028,7 +1028,7 @@ { "cell_type": "code", "execution_count": null, - "id": "33a862ec", + "id": "8f805899", "metadata": { "hide-output": false }, @@ -1041,7 +1041,7 @@ { "cell_type": "code", "execution_count": null, - "id": "89aa7576", + "id": "428d0181", "metadata": { "hide-output": false }, @@ -1053,7 +1053,7 @@ }, { "cell_type": "markdown", - "id": "7d8dc3d9", + "id": "de31cf5a", "metadata": {}, "source": [ "This is the same answer. So far so good. Finally, let’s try the same\n", @@ -1063,7 +1063,7 @@ { "cell_type": "code", "execution_count": null, - "id": "fecb0f55", + "id": "025e5cb3", "metadata": { "hide-output": false }, @@ -1076,7 +1076,7 @@ { "cell_type": "code", "execution_count": null, - "id": "a8f31bb1", + "id": "b0b3713f", "metadata": { "hide-output": false }, @@ -1088,7 +1088,7 @@ }, { "cell_type": "markdown", - "id": "65b5401e", + "id": "ad5bd5d7", "metadata": {}, "source": [ "Again, we obtain the same answer." @@ -1096,7 +1096,7 @@ } ], "metadata": { - "date": 1734843462.716841, + "date": 1735958032.3620317, "filename": "orth_proj.md", "kernelspec": { "display_name": "Python", diff --git a/permanent_income_dles.ipynb b/permanent_income_dles.ipynb index fccce3e..2614e5a 100644 --- a/permanent_income_dles.ipynb +++ b/permanent_income_dles.ipynb @@ -2,7 +2,7 @@ "cells": [ { "cell_type": "markdown", - "id": "c1173697", + "id": "3733b45d", "metadata": {}, "source": [ "\n", @@ -13,7 +13,7 @@ }, { "cell_type": "markdown", - "id": "65b87c84", + "id": "8b12295d", "metadata": {}, "source": [ "# Permanent Income Model using the DLE Class\n", @@ -27,7 +27,7 @@ { "cell_type": "code", "execution_count": null, - "id": "f5d521bb", + "id": "68324e5f", "metadata": { "hide-output": false }, @@ -38,7 +38,7 @@ }, { "cell_type": "markdown", - "id": "771e7d4e", + "id": "55be46b1", "metadata": {}, "source": [ "This lecture adds a third solution method for the\n", @@ -59,7 +59,7 @@ { "cell_type": "code", "execution_count": null, - "id": "4f410382", + "id": "78515a0f", "metadata": { "hide-output": false }, @@ -74,7 +74,7 @@ }, { "cell_type": "markdown", - "id": "965511f6", + "id": "ef3c8ce8", "metadata": {}, "source": [ "## The Permanent Income Model\n", @@ -174,7 +174,7 @@ }, { "cell_type": "markdown", - "id": "0e76c241", + "id": "9c98aae9", "metadata": {}, "source": [ "### Solution with the DLE Class\n", @@ -233,7 +233,7 @@ { "cell_type": "code", "execution_count": null, - "id": "500f7e47", + "id": "33bf57ff", "metadata": { "hide-output": false }, @@ -273,7 +273,7 @@ }, { "cell_type": "markdown", - "id": "e6e455f6", + "id": "6b84d029", "metadata": {}, "source": [ "To check the solution of this model with that from the **LQ** problem,\n", @@ -290,7 +290,7 @@ { "cell_type": "code", "execution_count": null, - "id": "ba070e01", + "id": "0302cda5", "metadata": { "hide-output": false }, @@ -301,7 +301,7 @@ }, { "cell_type": "markdown", - "id": "639ccbc9", + "id": "ee2ee604", "metadata": {}, "source": [ "The state vector in the DLE class is:\n", @@ -331,7 +331,7 @@ { "cell_type": "code", "execution_count": null, - "id": "fc56f535", + "id": "e8349111", "metadata": { "hide-output": false }, @@ -357,7 +357,7 @@ } ], "metadata": { - "date": 1734843462.7347455, + "date": 1735958032.3773103, "filename": "permanent_income_dles.md", "kernelspec": { "display_name": "Python", diff --git a/rob_markov_perf.ipynb b/rob_markov_perf.ipynb index c9b834b..6230d54 100644 --- a/rob_markov_perf.ipynb +++ b/rob_markov_perf.ipynb @@ -2,7 +2,7 @@ "cells": [ { "cell_type": "markdown", - "id": "85b5fd4d", + "id": "9dc68b72", "metadata": {}, "source": [ "\n", @@ -11,7 +11,7 @@ }, { "cell_type": "markdown", - "id": "1515bfec", + "id": "f8e41d9e", "metadata": {}, "source": [ "# Robust Markov Perfect Equilibrium\n", @@ -22,7 +22,7 @@ { "cell_type": "code", "execution_count": null, - "id": "ac776f48", + "id": "e62eea21", "metadata": { "hide-output": false }, @@ -33,7 +33,7 @@ }, { "cell_type": "markdown", - "id": "120ba99d", + "id": "65c0991e", "metadata": {}, "source": [ "## Overview\n", @@ -60,7 +60,7 @@ { "cell_type": "code", "execution_count": null, - "id": "eb06e488", + "id": "6749519d", "metadata": { "hide-output": false }, @@ -74,7 +74,7 @@ }, { "cell_type": "markdown", - "id": "cc6f4582", + "id": "3a829115", "metadata": {}, "source": [ "### Basic Setup\n", @@ -108,7 +108,7 @@ }, { "cell_type": "markdown", - "id": "d5ac181c", + "id": "bb9da2c7", "metadata": {}, "source": [ "## Linear Markov Perfect Equilibria with Robust Agents\n", @@ -123,7 +123,7 @@ }, { "cell_type": "markdown", - "id": "8668261f", + "id": "ddd1be1e", "metadata": {}, "source": [ "### Modified Coupled Linear Regulator Problems\n", @@ -200,7 +200,7 @@ }, { "cell_type": "markdown", - "id": "96ce9ca0", + "id": "aac01f48", "metadata": {}, "source": [ "### Computing Equilibrium\n", @@ -317,7 +317,7 @@ }, { "cell_type": "markdown", - "id": "dcc17ebe", + "id": "c2eae080", "metadata": {}, "source": [ "### Key Insight\n", @@ -337,7 +337,7 @@ }, { "cell_type": "markdown", - "id": "8c2a7150", + "id": "226d41b3", "metadata": {}, "source": [ "### Worst-case Shocks\n", @@ -357,7 +357,7 @@ }, { "cell_type": "markdown", - "id": "f7d87223", + "id": "351827b7", "metadata": {}, "source": [ "### Infinite Horizon\n", @@ -371,7 +371,7 @@ }, { "cell_type": "markdown", - "id": "be73eaf8", + "id": "6cc06793", "metadata": {}, "source": [ "### Implementation\n", @@ -383,7 +383,7 @@ }, { "cell_type": "markdown", - "id": "e1ebaa81", + "id": "bf9060ad", "metadata": {}, "source": [ "## Application\n", @@ -394,7 +394,7 @@ }, { "cell_type": "markdown", - "id": "a22bdc81", + "id": "55e6b3b7", "metadata": {}, "source": [ "### A Duopoly Model\n", @@ -524,7 +524,7 @@ }, { "cell_type": "markdown", - "id": "3803624c", + "id": "b0cc00ca", "metadata": {}, "source": [ "### Parameters and Solution\n", @@ -543,7 +543,7 @@ { "cell_type": "code", "execution_count": null, - "id": "c99ec349", + "id": "0f1241ce", "metadata": { "hide-output": false }, @@ -589,7 +589,7 @@ }, { "cell_type": "markdown", - "id": "f1e66886", + "id": "ba9fb279", "metadata": {}, "source": [ "#### Markov Perfect Equilibrium with Robustness\n", @@ -608,7 +608,7 @@ { "cell_type": "code", "execution_count": null, - "id": "17f941f0", + "id": "7db604c0", "metadata": { "hide-output": false }, @@ -780,7 +780,7 @@ }, { "cell_type": "markdown", - "id": "4b6e9e57", + "id": "6b68b3bd", "metadata": {}, "source": [ "### Some Details\n", @@ -854,7 +854,7 @@ { "cell_type": "code", "execution_count": null, - "id": "2a2abd19", + "id": "61fc23fa", "metadata": { "hide-output": false }, @@ -887,7 +887,7 @@ }, { "cell_type": "markdown", - "id": "d83a24a5", + "id": "b61f7f21", "metadata": {}, "source": [ "#### Consistency Check\n", @@ -899,7 +899,7 @@ { "cell_type": "code", "execution_count": null, - "id": "465a6688", + "id": "d98baf6c", "metadata": { "hide-output": false }, @@ -923,7 +923,7 @@ }, { "cell_type": "markdown", - "id": "ccb25c96", + "id": "45e0a43d", "metadata": {}, "source": [ "We can see that the results are consistent across the two functions." @@ -931,7 +931,7 @@ }, { "cell_type": "markdown", - "id": "30370fe6", + "id": "7686e904", "metadata": {}, "source": [ "#### Comparative Dynamics under Baseline Transition Dynamics\n", @@ -975,7 +975,7 @@ { "cell_type": "code", "execution_count": null, - "id": "99ba1c01", + "id": "350dbf0c", "metadata": { "hide-output": false }, @@ -1046,7 +1046,7 @@ }, { "cell_type": "markdown", - "id": "e1f82ac9", + "id": "6104ca1f", "metadata": {}, "source": [ "The following code prepares graphs that compare market-wide output $ q_{1t} + q_{2t} $ and the price of the good\n", @@ -1060,7 +1060,7 @@ { "cell_type": "code", "execution_count": null, - "id": "7688b46f", + "id": "a0ac051a", "metadata": { "hide-output": false }, @@ -1084,7 +1084,7 @@ }, { "cell_type": "markdown", - "id": "588c6f58", + "id": "ad52c944", "metadata": {}, "source": [ "Under the dynamics associated with the baseline model, the price path is higher with the Markov perfect equilibrium robust decision rules\n", @@ -1100,7 +1100,7 @@ { "cell_type": "code", "execution_count": null, - "id": "7347b888", + "id": "475665cd", "metadata": { "hide-output": false }, @@ -1124,7 +1124,7 @@ }, { "cell_type": "markdown", - "id": "4d8f7a0c", + "id": "f3ebafe7", "metadata": {}, "source": [ "Evidently, firm 1’s output path is substantially lower when firms are robust firms while\n", @@ -1147,7 +1147,7 @@ }, { "cell_type": "markdown", - "id": "43e11585", + "id": "c14718e8", "metadata": {}, "source": [ "#### Heterogeneous Beliefs\n", @@ -1178,7 +1178,7 @@ { "cell_type": "code", "execution_count": null, - "id": "6e57c054", + "id": "5e1239eb", "metadata": { "hide-output": false }, @@ -1194,7 +1194,7 @@ { "cell_type": "code", "execution_count": null, - "id": "6f362aa7", + "id": "5b5b6e18", "metadata": { "hide-output": false }, @@ -1225,7 +1225,7 @@ }, { "cell_type": "markdown", - "id": "495e0f14", + "id": "06145396", "metadata": {}, "source": [ "We see from the above graph that under robustness concerns, player 1 and\n", @@ -1245,7 +1245,7 @@ } ], "metadata": { - "date": 1734843462.7715044, + "date": 1735958032.5577457, "filename": "rob_markov_perf.md", "kernelspec": { "display_name": "Python", diff --git a/robustness.ipynb b/robustness.ipynb index b371468..4168cd4 100644 --- a/robustness.ipynb +++ b/robustness.ipynb @@ -2,7 +2,7 @@ "cells": [ { "cell_type": "markdown", - "id": "9b9a0dc5", + "id": "f21bb843", "metadata": {}, "source": [ "\n", @@ -11,7 +11,7 @@ }, { "cell_type": "markdown", - "id": "064ae6f9", + "id": "d7da8100", "metadata": {}, "source": [ "# Robustness\n", @@ -24,7 +24,7 @@ { "cell_type": "code", "execution_count": null, - "id": "03273b7f", + "id": "8347eee1", "metadata": { "hide-output": false }, @@ -35,7 +35,7 @@ }, { "cell_type": "markdown", - "id": "238ba96b", + "id": "8c7a0e7b", "metadata": {}, "source": [ "## Overview\n", @@ -84,7 +84,7 @@ { "cell_type": "code", "execution_count": null, - "id": "16c694ff", + "id": "eae57836", "metadata": { "hide-output": false }, @@ -99,7 +99,7 @@ }, { "cell_type": "markdown", - "id": "cde2fc98", + "id": "9db2078c", "metadata": {}, "source": [ "\n", @@ -108,7 +108,7 @@ }, { "cell_type": "markdown", - "id": "5bd1777d", + "id": "b21c1237", "metadata": {}, "source": [ "### Sets of Models Imply Sets Of Values\n", @@ -175,7 +175,7 @@ }, { "cell_type": "markdown", - "id": "28a6d2d5", + "id": "b5ca5619", "metadata": {}, "source": [ "### Inspiring Video\n", @@ -185,7 +185,7 @@ }, { "cell_type": "markdown", - "id": "bb4d7bd0", + "id": "9182612b", "metadata": {}, "source": [ "### Other References\n", @@ -198,7 +198,7 @@ }, { "cell_type": "markdown", - "id": "3a15d7b2", + "id": "5d73ed63", "metadata": {}, "source": [ "## The Model\n", @@ -252,7 +252,7 @@ }, { "cell_type": "markdown", - "id": "c3a2dcb4", + "id": "d8845053", "metadata": {}, "source": [ "## Constructing More Robust Policies\n", @@ -301,7 +301,7 @@ }, { "cell_type": "markdown", - "id": "0ea799a3", + "id": "8d8d826d", "metadata": {}, "source": [ "### Analyzing the Bellman Equation\n", @@ -407,7 +407,7 @@ }, { "cell_type": "markdown", - "id": "f123bcae", + "id": "a779b9b4", "metadata": {}, "source": [ "## Robustness as Outcome of a Two-Person Zero-Sum Game\n", @@ -428,7 +428,7 @@ }, { "cell_type": "markdown", - "id": "4ffc066c", + "id": "841a2e34", "metadata": {}, "source": [ "### Agent 2’s Problem\n", @@ -535,7 +535,7 @@ }, { "cell_type": "markdown", - "id": "6e37f213", + "id": "366588b4", "metadata": {}, "source": [ "### Using Agent 2’s Problem to Construct Bounds on the Value Sets" @@ -543,7 +543,7 @@ }, { "cell_type": "markdown", - "id": "7e4be4e7", + "id": "f108caf1", "metadata": {}, "source": [ "#### The Lower Bound\n", @@ -602,7 +602,7 @@ }, { "cell_type": "markdown", - "id": "59857e7f", + "id": "11df3f5a", "metadata": {}, "source": [ "#### The Upper Bound\n", @@ -665,7 +665,7 @@ }, { "cell_type": "markdown", - "id": "7e31420a", + "id": "0f04c496", "metadata": {}, "source": [ "#### Reshaping the Set of Values\n", @@ -675,7 +675,7 @@ }, { "cell_type": "markdown", - "id": "ab655b11", + "id": "072a730b", "metadata": {}, "source": [ "### Agent 1’s Problem\n", @@ -722,7 +722,7 @@ }, { "cell_type": "markdown", - "id": "a1d8bd3d", + "id": "433d01d4", "metadata": {}, "source": [ "### Nash Equilibrium\n", @@ -756,7 +756,7 @@ }, { "cell_type": "markdown", - "id": "ce4d3ce7", + "id": "6121f768", "metadata": {}, "source": [ "## The Stochastic Case\n", @@ -805,7 +805,7 @@ }, { "cell_type": "markdown", - "id": "e030ce96", + "id": "b9a5f713", "metadata": {}, "source": [ "### Solving the Model\n", @@ -903,7 +903,7 @@ }, { "cell_type": "markdown", - "id": "85fe1a3d", + "id": "5995b4b7", "metadata": {}, "source": [ "### Computing Other Quantities\n", @@ -913,7 +913,7 @@ }, { "cell_type": "markdown", - "id": "4ee698ab", + "id": "e2c7d647", "metadata": {}, "source": [ "#### Worst-Case Value of a Policy\n", @@ -971,7 +971,7 @@ }, { "cell_type": "markdown", - "id": "78e6381a", + "id": "bf15998c", "metadata": {}, "source": [ "## Implementation\n", @@ -997,7 +997,7 @@ }, { "cell_type": "markdown", - "id": "7ec10e58", + "id": "c95018b8", "metadata": {}, "source": [ "## Application\n", @@ -1097,7 +1097,7 @@ { "cell_type": "code", "execution_count": null, - "id": "b560a6db", + "id": "3b1152f6", "metadata": { "hide-output": false }, @@ -1274,7 +1274,7 @@ }, { "cell_type": "markdown", - "id": "729f49e2", + "id": "52f8c2d0", "metadata": {}, "source": [ "Here’s another such figure, with $ \\theta = 0.002 $ instead of $ 0.02 $\n", @@ -1290,7 +1290,7 @@ }, { "cell_type": "markdown", - "id": "ee719f46", + "id": "66263819", "metadata": {}, "source": [ "## Appendix\n", @@ -1364,7 +1364,7 @@ } ], "metadata": { - "date": 1734843462.9861228, + "date": 1735958032.6052227, "filename": "robustness.md", "kernelspec": { "display_name": "Python", diff --git a/rosen_schooling_model.ipynb b/rosen_schooling_model.ipynb index 54668e1..ac6218a 100644 --- a/rosen_schooling_model.ipynb +++ b/rosen_schooling_model.ipynb @@ -2,7 +2,7 @@ "cells": [ { "cell_type": "markdown", - "id": "42d6d39c", + "id": "44132c3e", "metadata": {}, "source": [ "\n", @@ -13,7 +13,7 @@ }, { "cell_type": "markdown", - "id": "52d98069", + "id": "be1db14d", "metadata": {}, "source": [ "# Rosen Schooling Model\n", @@ -27,7 +27,7 @@ { "cell_type": "code", "execution_count": null, - "id": "67a84286", + "id": "7ea2a7a2", "metadata": { "hide-output": false }, @@ -38,7 +38,7 @@ }, { "cell_type": "markdown", - "id": "7da3dd00", + "id": "7994815b", "metadata": {}, "source": [ "We’ll also need the following imports:" @@ -47,7 +47,7 @@ { "cell_type": "code", "execution_count": null, - "id": "b65c2a97", + "id": "ec28ee1b", "metadata": { "hide-output": false }, @@ -61,7 +61,7 @@ }, { "cell_type": "markdown", - "id": "fc198cf1", + "id": "24070ba1", "metadata": {}, "source": [ "## A One-Occupation Model\n", @@ -109,7 +109,7 @@ }, { "cell_type": "markdown", - "id": "44724dc8", + "id": "308a0d59", "metadata": {}, "source": [ "## Mapping into HS2013 Framework\n", @@ -124,7 +124,7 @@ }, { "cell_type": "markdown", - "id": "db37a854", + "id": "0bf3790c", "metadata": {}, "source": [ "### Preferences\n", @@ -156,7 +156,7 @@ }, { "cell_type": "markdown", - "id": "6bc016b6", + "id": "2494f53c", "metadata": {}, "source": [ "### Technology\n", @@ -177,7 +177,7 @@ }, { "cell_type": "markdown", - "id": "6d1c62e9", + "id": "1c6a1809", "metadata": {}, "source": [ "### Information\n", @@ -210,7 +210,7 @@ { "cell_type": "code", "execution_count": null, - "id": "ff36043b", + "id": "97b5c0b9", "metadata": { "hide-output": false }, @@ -223,7 +223,7 @@ }, { "cell_type": "markdown", - "id": "ee9e4bdd", + "id": "89857f6e", "metadata": {}, "source": [ "### Effects of Changes in Education Technology and Demand\n", @@ -242,7 +242,7 @@ { "cell_type": "code", "execution_count": null, - "id": "b1f44e6c", + "id": "adfa37dd", "metadata": { "hide-output": false }, @@ -297,7 +297,7 @@ }, { "cell_type": "markdown", - "id": "86fb557c", + "id": "8a61e910", "metadata": {}, "source": [ "We create three other instances by:\n", @@ -310,7 +310,7 @@ { "cell_type": "code", "execution_count": null, - "id": "b17c8d01", + "id": "4d115b76", "metadata": { "hide-output": false }, @@ -357,7 +357,7 @@ }, { "cell_type": "markdown", - "id": "5f3cecdf", + "id": "9e12e338", "metadata": {}, "source": [ "The first figure plots the impulse response of $ n_t $ (on the left)\n", @@ -385,7 +385,7 @@ { "cell_type": "code", "execution_count": null, - "id": "0760078f", + "id": "c4bba3af", "metadata": { "hide-output": false }, @@ -406,7 +406,7 @@ }, { "cell_type": "markdown", - "id": "50bdb519", + "id": "fa31e040", "metadata": {}, "source": [ "The next figure plots the impulse response of $ n_t $ (on the left)\n", @@ -417,7 +417,7 @@ { "cell_type": "code", "execution_count": null, - "id": "b507d224", + "id": "a6efb6c2", "metadata": { "hide-output": false }, @@ -440,7 +440,7 @@ }, { "cell_type": "markdown", - "id": "47d01a4c", + "id": "0fc5da5f", "metadata": {}, "source": [ "Both panels in the above figure show that raising $ k $ lowers the effect of\n", @@ -454,7 +454,7 @@ } ], "metadata": { - "date": 1734843463.0035093, + "date": 1735958032.6218696, "filename": "rosen_schooling_model.md", "kernelspec": { "display_name": "Python", diff --git a/smoothing.ipynb b/smoothing.ipynb index dac6906..c72320f 100644 --- a/smoothing.ipynb +++ b/smoothing.ipynb @@ -2,7 +2,7 @@ "cells": [ { "cell_type": "markdown", - "id": "4a5fcbe6", + "id": "20bb3058", "metadata": {}, "source": [ "\n", @@ -11,7 +11,7 @@ }, { "cell_type": "markdown", - "id": "ce7a4929", + "id": "700a9b5e", "metadata": {}, "source": [ "# Consumption Smoothing with Complete and Incomplete Markets\n", @@ -24,7 +24,7 @@ { "cell_type": "code", "execution_count": null, - "id": "35fda939", + "id": "0c6b31a7", "metadata": { "hide-output": false }, @@ -35,7 +35,7 @@ }, { "cell_type": "markdown", - "id": "b7da3677", + "id": "0551c6ec", "metadata": {}, "source": [ "## Overview\n", @@ -87,7 +87,7 @@ { "cell_type": "code", "execution_count": null, - "id": "9a0cbe9e", + "id": "175848d1", "metadata": { "hide-output": false }, @@ -101,7 +101,7 @@ }, { "cell_type": "markdown", - "id": "47c3a833", + "id": "364787cd", "metadata": {}, "source": [ "### Relationship to Other Lectures\n", @@ -113,7 +113,7 @@ }, { "cell_type": "markdown", - "id": "1eb9a7b1", + "id": "9b4c9f29", "metadata": {}, "source": [ "## Background\n", @@ -148,7 +148,7 @@ }, { "cell_type": "markdown", - "id": "26582832", + "id": "f023ed91", "metadata": {}, "source": [ "## Linear State Space Version of Complete Markets Model\n", @@ -309,7 +309,7 @@ { "cell_type": "code", "execution_count": null, - "id": "cb720f5a", + "id": "894dce90", "metadata": { "hide-output": false }, @@ -392,7 +392,7 @@ }, { "cell_type": "markdown", - "id": "253cf7d7", + "id": "04dc7162", "metadata": {}, "source": [ "### Interpretation of Graph\n", @@ -410,7 +410,7 @@ }, { "cell_type": "markdown", - "id": "73188e5a", + "id": "bbd38158", "metadata": {}, "source": [ "### Incomplete Markets Version\n", @@ -423,7 +423,7 @@ }, { "cell_type": "markdown", - "id": "7ee0a5cf", + "id": "4e37e599", "metadata": {}, "source": [ "### Finite State Markov Income Process\n", @@ -474,7 +474,7 @@ }, { "cell_type": "markdown", - "id": "f313f0bb", + "id": "3b22bcf5", "metadata": {}, "source": [ "### Market Structure\n", @@ -493,7 +493,7 @@ }, { "cell_type": "markdown", - "id": "965db633", + "id": "a0de0fc8", "metadata": {}, "source": [ "## Model 1 (Complete Markets)\n", @@ -672,7 +672,7 @@ }, { "cell_type": "markdown", - "id": "39e37d4a", + "id": "e630b028", "metadata": {}, "source": [ "### Key Outcomes\n", @@ -700,7 +700,7 @@ }, { "cell_type": "markdown", - "id": "eea1023d", + "id": "4dea798a", "metadata": {}, "source": [ "### Code\n", @@ -714,7 +714,7 @@ { "cell_type": "code", "execution_count": null, - "id": "60e32594", + "id": "0a6926ce", "metadata": { "hide-output": false }, @@ -844,7 +844,7 @@ }, { "cell_type": "markdown", - "id": "6e55b857", + "id": "e4c47fc1", "metadata": {}, "source": [ "Let’s test by checking that $ \\bar c $ and $ b_2 $ satisfy the budget constraint" @@ -853,7 +853,7 @@ { "cell_type": "code", "execution_count": null, - "id": "3fd34712", + "id": "46766731", "metadata": { "hide-output": false }, @@ -866,7 +866,7 @@ }, { "cell_type": "markdown", - "id": "06997299", + "id": "a9f4fbaa", "metadata": {}, "source": [ "Below, we’ll take the outcomes produced by this code – in particular the implied\n", @@ -876,7 +876,7 @@ }, { "cell_type": "markdown", - "id": "36046b05", + "id": "3ba852a7", "metadata": {}, "source": [ "## Model 2 (One-Period Risk-Free Debt Only)\n", @@ -1005,7 +1005,7 @@ }, { "cell_type": "markdown", - "id": "6f861da6", + "id": "b79fae4b", "metadata": {}, "source": [ "### Summary of Outcomes\n", @@ -1027,7 +1027,7 @@ }, { "cell_type": "markdown", - "id": "a2e2f9b1", + "id": "6f6c7c1d", "metadata": {}, "source": [ "### The Incomplete Markets Model\n", @@ -1044,7 +1044,7 @@ { "cell_type": "code", "execution_count": null, - "id": "13dfa985", + "id": "93c27042", "metadata": { "hide-output": false }, @@ -1082,7 +1082,7 @@ }, { "cell_type": "markdown", - "id": "4d9524df", + "id": "3533a591", "metadata": {}, "source": [ "In the graph on the left, for the same sample path of nonfinancial\n", @@ -1097,7 +1097,7 @@ }, { "cell_type": "markdown", - "id": "7c7a434c", + "id": "461dac2c", "metadata": {}, "source": [ "### A sequel\n", @@ -1108,7 +1108,7 @@ } ], "metadata": { - "date": 1734843463.039932, + "date": 1735958032.6594486, "filename": "smoothing.md", "kernelspec": { "display_name": "Python", diff --git a/smoothing_tax.ipynb b/smoothing_tax.ipynb index 66108f1..bad174a 100644 --- a/smoothing_tax.ipynb +++ b/smoothing_tax.ipynb @@ -2,7 +2,7 @@ "cells": [ { "cell_type": "markdown", - "id": "0bcb148c", + "id": "8f16cd40", "metadata": {}, "source": [ "\n", @@ -11,7 +11,7 @@ }, { "cell_type": "markdown", - "id": "02fdf3ef", + "id": "f95c346e", "metadata": {}, "source": [ "# Tax Smoothing with Complete and Incomplete Markets\n", @@ -24,7 +24,7 @@ { "cell_type": "code", "execution_count": null, - "id": "317f3c56", + "id": "b1a0394e", "metadata": { "hide-output": false }, @@ -35,7 +35,7 @@ }, { "cell_type": "markdown", - "id": "189e7233", + "id": "6952ce28", "metadata": {}, "source": [ "## Overview\n", @@ -73,7 +73,7 @@ }, { "cell_type": "markdown", - "id": "920538f5", + "id": "2e8338a8", "metadata": {}, "source": [ "### Isomorphism between Consumption and Tax Smoothing\n", @@ -99,7 +99,7 @@ }, { "cell_type": "markdown", - "id": "bd420082", + "id": "6e70fe58", "metadata": {}, "source": [ "#### Link to History\n", @@ -113,7 +113,7 @@ { "cell_type": "code", "execution_count": null, - "id": "a88f4fc2", + "id": "91d6df08", "metadata": { "hide-output": false }, @@ -126,7 +126,7 @@ }, { "cell_type": "markdown", - "id": "18675d7b", + "id": "b0f4ec28", "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)" @@ -134,7 +134,7 @@ }, { "cell_type": "markdown", - "id": "173ac73c", + "id": "ce950732", "metadata": {}, "source": [ "### Code\n", @@ -148,7 +148,7 @@ { "cell_type": "code", "execution_count": null, - "id": "96b09304", + "id": "408e4601", "metadata": { "hide-output": false }, @@ -278,7 +278,7 @@ }, { "cell_type": "markdown", - "id": "2bece25a", + "id": "eec8ba04", "metadata": {}, "source": [ "### Revisiting the consumption-smoothing model\n", @@ -295,7 +295,7 @@ { "cell_type": "code", "execution_count": null, - "id": "2eee1416", + "id": "c22b630a", "metadata": { "hide-output": false }, @@ -331,7 +331,7 @@ }, { "cell_type": "markdown", - "id": "0ab4d3ea", + "id": "c3db9c44", "metadata": {}, "source": [ "In the graph on the left, for the same sample path of nonfinancial\n", @@ -346,7 +346,7 @@ }, { "cell_type": "markdown", - "id": "537d794b", + "id": "afdeaac7", "metadata": {}, "source": [ "#### Relabeling variables to create tax-smoothing models\n", @@ -357,7 +357,7 @@ { "cell_type": "code", "execution_count": null, - "id": "57d9bcec", + "id": "2239c37a", "metadata": { "hide-output": false }, @@ -386,7 +386,7 @@ }, { "cell_type": "markdown", - "id": "cf9b487b", + "id": "277c0b3e", "metadata": {}, "source": [ "## Tax Smoothing with Complete Markets\n", @@ -437,7 +437,7 @@ }, { "cell_type": "markdown", - "id": "58782ac3", + "id": "bc151c0b", "metadata": {}, "source": [ "## Returns on State-Contingent Debt\n", @@ -469,7 +469,7 @@ { "cell_type": "code", "execution_count": null, - "id": "2be05978", + "id": "e062dc98", "metadata": { "hide-output": false }, @@ -509,7 +509,7 @@ }, { "cell_type": "markdown", - "id": "159256b8", + "id": "1ec1adab", "metadata": {}, "source": [ "### An Example of Tax Smoothing\n", @@ -538,7 +538,7 @@ { "cell_type": "code", "execution_count": null, - "id": "1e78c945", + "id": "c0011c4f", "metadata": { "hide-output": false }, @@ -617,7 +617,7 @@ }, { "cell_type": "markdown", - "id": "f11b6df8", + "id": "b175113e", "metadata": {}, "source": [ "### Explanation\n", @@ -643,7 +643,7 @@ }, { "cell_type": "markdown", - "id": "1b123fb1", + "id": "185e2276", "metadata": {}, "source": [ "### Exercise 7.1\n", @@ -664,7 +664,7 @@ }, { "cell_type": "markdown", - "id": "78be75cd", + "id": "aaa3e376", "metadata": {}, "source": [ "## More Finite Markov Chain Tax-Smoothing Examples\n", @@ -682,7 +682,7 @@ { "cell_type": "code", "execution_count": null, - "id": "df183355", + "id": "47763b66", "metadata": { "hide-output": false }, @@ -801,7 +801,7 @@ }, { "cell_type": "markdown", - "id": "6dc45c68", + "id": "03775ae8", "metadata": {}, "source": [ "### Parameters" @@ -810,7 +810,7 @@ { "cell_type": "code", "execution_count": null, - "id": "2a958c24", + "id": "e0771a9b", "metadata": { "hide-output": false }, @@ -829,7 +829,7 @@ }, { "cell_type": "markdown", - "id": "1a029cb9", + "id": "7d986d70", "metadata": {}, "source": [ "### Example 1\n", @@ -861,7 +861,7 @@ { "cell_type": "code", "execution_count": null, - "id": "2d1b158e", + "id": "51d68905", "metadata": { "hide-output": false }, @@ -878,7 +878,7 @@ { "cell_type": "code", "execution_count": null, - "id": "fe447763", + "id": "c169b0c4", "metadata": { "hide-output": false }, @@ -891,7 +891,7 @@ { "cell_type": "code", "execution_count": null, - "id": "70ec666a", + "id": "e3fb9fa5", "metadata": { "hide-output": false }, @@ -905,7 +905,7 @@ }, { "cell_type": "markdown", - "id": "072355fc", + "id": "2098f829", "metadata": {}, "source": [ "### Example 2\n", @@ -931,7 +931,7 @@ { "cell_type": "code", "execution_count": null, - "id": "b92d7f56", + "id": "2826daf5", "metadata": { "hide-output": false }, @@ -948,7 +948,7 @@ { "cell_type": "code", "execution_count": null, - "id": "d2e02906", + "id": "75688d10", "metadata": { "hide-output": false }, @@ -960,7 +960,7 @@ }, { "cell_type": "markdown", - "id": "9a25048b", + "id": "281e6b4a", "metadata": {}, "source": [ "### Example 3\n", @@ -989,7 +989,7 @@ { "cell_type": "code", "execution_count": null, - "id": "ce852d3b", + "id": "311906ec", "metadata": { "hide-output": false }, @@ -1007,7 +1007,7 @@ { "cell_type": "code", "execution_count": null, - "id": "58d10f7e", + "id": "6beb2236", "metadata": { "hide-output": false }, @@ -1019,7 +1019,7 @@ }, { "cell_type": "markdown", - "id": "469b022a", + "id": "10debf64", "metadata": {}, "source": [ "### Example 4\n", @@ -1046,7 +1046,7 @@ { "cell_type": "code", "execution_count": null, - "id": "68a075b0", + "id": "cbb0b818", "metadata": { "hide-output": false }, @@ -1065,7 +1065,7 @@ { "cell_type": "code", "execution_count": null, - "id": "5c0ce906", + "id": "9a0dae20", "metadata": { "hide-output": false }, @@ -1077,7 +1077,7 @@ }, { "cell_type": "markdown", - "id": "4c9fff81", + "id": "6973f834", "metadata": {}, "source": [ "### Example 5\n", @@ -1109,7 +1109,7 @@ { "cell_type": "code", "execution_count": null, - "id": "f8317558", + "id": "b000575c", "metadata": { "hide-output": false }, @@ -1130,7 +1130,7 @@ { "cell_type": "code", "execution_count": null, - "id": "5c87361c", + "id": "c935d177", "metadata": { "hide-output": false }, @@ -1142,7 +1142,7 @@ }, { "cell_type": "markdown", - "id": "6cf81f23", + "id": "32761d83", "metadata": {}, "source": [ "### Continuous-State Gaussian Model\n", @@ -1192,7 +1192,7 @@ }, { "cell_type": "markdown", - "id": "cd81ee61", + "id": "875b00da", "metadata": {}, "source": [ "#### Related Lectures\n", @@ -1218,7 +1218,7 @@ } ], "metadata": { - "date": 1734843463.0776215, + "date": 1735958032.6983163, "filename": "smoothing_tax.md", "kernelspec": { "display_name": "Python", diff --git a/stationary_densities.ipynb b/stationary_densities.ipynb index 498efc8..fcf66b5 100644 --- a/stationary_densities.ipynb +++ b/stationary_densities.ipynb @@ -2,7 +2,7 @@ "cells": [ { "cell_type": "markdown", - "id": "1f7ff1d2", + "id": "d939ef84", "metadata": {}, "source": [ "\n", @@ -11,7 +11,7 @@ }, { "cell_type": "markdown", - "id": "e409e544", + "id": "e6fd1cbf", "metadata": {}, "source": [ "# Continuous State Markov Chains\n", @@ -24,7 +24,7 @@ { "cell_type": "code", "execution_count": null, - "id": "8408d0ff", + "id": "3d510b0b", "metadata": { "hide-output": false }, @@ -35,7 +35,7 @@ }, { "cell_type": "markdown", - "id": "5bc65a55", + "id": "af94bf66", "metadata": {}, "source": [ "## Overview\n", @@ -83,7 +83,7 @@ { "cell_type": "code", "execution_count": null, - "id": "968db302", + "id": "e2195d86", "metadata": { "hide-output": false }, @@ -98,7 +98,7 @@ }, { "cell_type": "markdown", - "id": "4c63165b", + "id": "fb4b508c", "metadata": {}, "source": [ "\n", @@ -107,7 +107,7 @@ }, { "cell_type": "markdown", - "id": "de26cd07", + "id": "2f3952bd", "metadata": {}, "source": [ "## The Density Case\n", @@ -127,7 +127,7 @@ }, { "cell_type": "markdown", - "id": "88f0285f", + "id": "e89040e3", "metadata": {}, "source": [ "### Definitions and Basic Properties\n", @@ -205,7 +205,7 @@ }, { "cell_type": "markdown", - "id": "d9f0d532", + "id": "a0393364", "metadata": {}, "source": [ "### Connection to Stochastic Difference Equations\n", @@ -327,7 +327,7 @@ }, { "cell_type": "markdown", - "id": "3e68f3ad", + "id": "507d0a49", "metadata": {}, "source": [ "### Distribution Dynamics\n", @@ -414,7 +414,7 @@ }, { "cell_type": "markdown", - "id": "1f581fc7", + "id": "1ece4e35", "metadata": {}, "source": [ "### Computation\n", @@ -495,7 +495,7 @@ }, { "cell_type": "markdown", - "id": "66bf35f8", + "id": "1e0d6f8a", "metadata": {}, "source": [ "### Implementation\n", @@ -520,7 +520,7 @@ }, { "cell_type": "markdown", - "id": "f63acae0", + "id": "619ff140", "metadata": {}, "source": [ "### Example\n", @@ -534,7 +534,7 @@ { "cell_type": "code", "execution_count": null, - "id": "c35590eb", + "id": "896a9287", "metadata": { "hide-output": false }, @@ -584,7 +584,7 @@ }, { "cell_type": "markdown", - "id": "235f237e", + "id": "41aece59", "metadata": {}, "source": [ "The figure shows part of the density sequence $ \\{\\psi_t\\} $, with each\n", @@ -599,7 +599,7 @@ }, { "cell_type": "markdown", - "id": "cc8b5be3", + "id": "da2b2a00", "metadata": {}, "source": [ "## Beyond Densities\n", @@ -621,7 +621,7 @@ }, { "cell_type": "markdown", - "id": "b0530d66", + "id": "08fe8156", "metadata": {}, "source": [ "### Example and Definitions\n", @@ -678,7 +678,7 @@ }, { "cell_type": "markdown", - "id": "ae59e62c", + "id": "9a94f00f", "metadata": {}, "source": [ "### Computation\n", @@ -693,7 +693,7 @@ }, { "cell_type": "markdown", - "id": "a07a2b59", + "id": "64021303", "metadata": {}, "source": [ "## Stability\n", @@ -709,7 +709,7 @@ }, { "cell_type": "markdown", - "id": "2024722c", + "id": "b6ff9070", "metadata": {}, "source": [ "### Theoretical Results\n", @@ -792,7 +792,7 @@ }, { "cell_type": "markdown", - "id": "9d6b4242", + "id": "721f44af", "metadata": {}, "source": [ "### An Example of Stability\n", @@ -819,7 +819,7 @@ }, { "cell_type": "markdown", - "id": "38bdc5cb", + "id": "5bd69881", "metadata": {}, "source": [ "### Computing Stationary Densities\n", @@ -871,7 +871,7 @@ }, { "cell_type": "markdown", - "id": "dfc8bdd7", + "id": "abf60a6e", "metadata": {}, "source": [ "## Exercises\n", @@ -882,7 +882,7 @@ }, { "cell_type": "markdown", - "id": "99e5ddbe", + "id": "78f9f649", "metadata": {}, "source": [ "## Exercise 2.1\n", @@ -937,7 +937,7 @@ }, { "cell_type": "markdown", - "id": "0b7fa927", + "id": "9e656e87", "metadata": {}, "source": [ "## Solution to[ Exercise 2.1](https://python-advanced.quantecon.org/#sd_ex1)\n", @@ -957,7 +957,7 @@ { "cell_type": "code", "execution_count": null, - "id": "c2fadcfa", + "id": "347a824e", "metadata": { "hide-output": false }, @@ -996,7 +996,7 @@ }, { "cell_type": "markdown", - "id": "f1231dab", + "id": "6ff013a5", "metadata": {}, "source": [ "\n", @@ -1005,7 +1005,7 @@ }, { "cell_type": "markdown", - "id": "f9a92fce", + "id": "c7fac4cb", "metadata": {}, "source": [ "## Exercise 2.2\n", @@ -1024,7 +1024,7 @@ { "cell_type": "code", "execution_count": null, - "id": "a095a999", + "id": "c6b50c30", "metadata": { "hide-output": false }, @@ -1035,7 +1035,7 @@ }, { "cell_type": "markdown", - "id": "886384f6", + "id": "fd649c2d", "metadata": {}, "source": [ "## Solution to[ Exercise 2.2](https://python-advanced.quantecon.org/#sd_ex2)\n", @@ -1046,7 +1046,7 @@ { "cell_type": "code", "execution_count": null, - "id": "d11e18be", + "id": "d3864a6c", "metadata": { "hide-output": false }, @@ -1098,7 +1098,7 @@ }, { "cell_type": "markdown", - "id": "01258d21", + "id": "d9012924", "metadata": {}, "source": [ "\n", @@ -1107,7 +1107,7 @@ }, { "cell_type": "markdown", - "id": "4403a9fc", + "id": "81b49366", "metadata": {}, "source": [ "## Exercise 2.3\n", @@ -1131,7 +1131,7 @@ { "cell_type": "code", "execution_count": null, - "id": "76d82cf6", + "id": "4bd123b0", "metadata": { "hide-output": false }, @@ -1153,7 +1153,7 @@ }, { "cell_type": "markdown", - "id": "0dac1337", + "id": "d1c86acd", "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", @@ -1179,7 +1179,7 @@ { "cell_type": "code", "execution_count": null, - "id": "4993707b", + "id": "fd8915e5", "metadata": { "hide-output": false }, @@ -1190,7 +1190,7 @@ }, { "cell_type": "markdown", - "id": "f0e6eb84", + "id": "f9393906", "metadata": {}, "source": [ "For each $ X_0 $ in this set,\n", @@ -1204,7 +1204,7 @@ }, { "cell_type": "markdown", - "id": "987d1bad", + "id": "e3ea8b8f", "metadata": {}, "source": [ "## Solution to[ Exercise 2.3](https://python-advanced.quantecon.org/#sd_ex3)\n", @@ -1218,7 +1218,7 @@ { "cell_type": "code", "execution_count": null, - "id": "50b4ef0f", + "id": "b0b84a89", "metadata": { "hide-output": false }, @@ -1252,7 +1252,7 @@ }, { "cell_type": "markdown", - "id": "0064a544", + "id": "a383c516", "metadata": {}, "source": [ "## Appendix\n", @@ -1272,7 +1272,7 @@ } ], "metadata": { - "date": 1734843463.13095, + "date": 1735958032.7519317, "filename": "stationary_densities.md", "kernelspec": { "display_name": "Python", diff --git a/status.ipynb b/status.ipynb index fc13ae2..d9acd1f 100644 --- a/status.ipynb +++ b/status.ipynb @@ -2,7 +2,7 @@ "cells": [ { "cell_type": "markdown", - "id": "d1923092", + "id": "db233c27", "metadata": {}, "source": [ "# Execution Statistics\n", @@ -11,60 +11,60 @@ "\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/calvo_abreu.html)[](https://python-advanced.quantecon.org/calvo_machine_learn.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/match_transport.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|2024-12-16 03:24|cache|49.8|✅|\n", - "|BCG_incomplete_mkts|2024-12-16 03:26|cache|89.49|✅|\n", - "|additive_functionals|2024-12-16 03:26|cache|13.01|✅|\n", - "|amss|2024-12-16 03:29|cache|189.25|✅|\n", - "|amss2|2024-12-16 03:30|cache|60.86|✅|\n", - "|amss3|2024-12-16 03:34|cache|267.87|✅|\n", - "|arellano|2024-12-16 03:36|cache|79.66|✅|\n", - "|arma|2024-12-16 03:36|cache|6.5|✅|\n", - "|asset_pricing_lph|2024-12-16 03:36|cache|2.6|✅|\n", - "|black_litterman|2024-12-16 03:37|cache|40.56|✅|\n", - "|calvo|2024-12-16 03:37|cache|8.73|✅|\n", - "|calvo_abreu|2024-12-16 03:37|cache|4.19|✅|\n", - "|calvo_machine_learn|2024-12-16 03:37|cache|17.89|✅|\n", - "|cattle_cycles|2024-12-16 03:37|cache|3.75|✅|\n", - "|chang_credible|2024-12-16 03:40|cache|154.09|✅|\n", - "|chang_ramsey|2024-12-16 03:45|cache|340.66|✅|\n", - "|classical_filtering|2024-12-16 03:46|cache|1.36|✅|\n", - "|coase|2024-12-16 03:46|cache|4.37|✅|\n", - "|cons_news|2024-12-16 03:46|cache|4.41|✅|\n", - "|discrete_dp|2024-12-16 03:46|cache|29.46|✅|\n", - "|dyn_stack|2024-12-16 03:46|cache|5.59|✅|\n", - "|entropy|2024-12-16 03:46|cache|0.99|✅|\n", - "|estspec|2024-12-16 03:46|cache|4.64|✅|\n", - "|five_preferences|2024-12-16 03:47|cache|39.63|✅|\n", - "|growth_in_dles|2024-12-16 03:47|cache|4.02|✅|\n", - "|hs_invertibility_example|2024-12-16 03:47|cache|4.33|✅|\n", - "|hs_recursive_models|2024-12-16 03:47|cache|0.99|✅|\n", - "|intro|2024-12-16 03:47|cache|0.99|✅|\n", - "|irfs_in_hall_model|2024-12-16 03:47|cache|3.99|✅|\n", - "|knowing_forecasts_of_others|2024-12-16 03:48|cache|24.0|✅|\n", - "|lqramsey|2024-12-16 03:48|cache|5.44|✅|\n", - "|lu_tricks|2024-12-16 03:48|cache|2.3|✅|\n", - "|lucas_asset_pricing_dles|2024-12-16 03:48|cache|3.67|✅|\n", - "|lucas_model|2024-12-16 03:48|cache|12.31|✅|\n", - "|markov_jump_lq|2024-12-16 03:49|cache|73.89|✅|\n", - "|match_transport|2024-12-22 04:54|cache|23.39|✅|\n", - "|matsuyama|2024-12-16 03:49|cache|6.54|✅|\n", - "|muth_kalman|2024-12-16 03:49|cache|4.02|✅|\n", - "|opt_tax_recur|2024-12-16 03:51|cache|69.4|✅|\n", - "|orth_proj|2024-12-16 03:51|cache|1.09|✅|\n", - "|permanent_income_dles|2024-12-16 03:51|cache|3.91|✅|\n", - "|rob_markov_perf|2024-12-16 03:51|cache|3.87|✅|\n", - "|robustness|2024-12-16 03:51|cache|5.4|✅|\n", - "|rosen_schooling_model|2024-12-16 03:51|cache|3.8|✅|\n", - "|smoothing|2024-12-16 03:51|cache|4.23|✅|\n", - "|smoothing_tax|2024-12-16 03:51|cache|6.48|✅|\n", - "|stationary_densities|2024-12-16 03:51|cache|8.08|✅|\n", - "|status|2024-12-16 03:51|cache|4.35|✅|\n", - "|tax_smoothing_1|2024-12-16 03:52|cache|10.46|✅|\n", - "|tax_smoothing_2|2024-12-16 03:52|cache|4.58|✅|\n", - "|tax_smoothing_3|2024-12-16 03:52|cache|4.51|✅|\n", - "|troubleshooting|2024-12-16 03:47|cache|0.99|✅|\n", - "|un_insure|2024-12-16 03:52|cache|12.13|✅|\n", - "|zreferences|2024-12-16 03:47|cache|0.99|✅|\n", + "|BCG_complete_mkts|2024-12-30 03:14|cache|47.85|✅|\n", + "|BCG_incomplete_mkts|2024-12-30 03:16|cache|91.46|✅|\n", + "|additive_functionals|2024-12-30 03:16|cache|13.28|✅|\n", + "|amss|2024-12-30 03:19|cache|183.34|✅|\n", + "|amss2|2024-12-30 03:20|cache|58.43|✅|\n", + "|amss3|2024-12-30 03:24|cache|267.25|✅|\n", + "|arellano|2024-12-30 03:26|cache|79.2|✅|\n", + "|arma|2024-12-30 03:26|cache|6.57|✅|\n", + "|asset_pricing_lph|2024-12-30 03:26|cache|2.58|✅|\n", + "|black_litterman|2024-12-30 03:27|cache|40.54|✅|\n", + "|calvo|2025-01-04 02:31|cache|14.04|✅|\n", + "|calvo_abreu|2024-12-30 03:27|cache|3.95|✅|\n", + "|calvo_machine_learn|2024-12-30 03:27|cache|17.49|✅|\n", + "|cattle_cycles|2024-12-30 03:27|cache|3.75|✅|\n", + "|chang_credible|2024-12-30 03:30|cache|152.5|✅|\n", + "|chang_ramsey|2024-12-30 03:35|cache|339.67|✅|\n", + "|classical_filtering|2024-12-30 03:35|cache|1.35|✅|\n", + "|coase|2024-12-30 03:35|cache|3.97|✅|\n", + "|cons_news|2024-12-30 03:35|cache|3.89|✅|\n", + "|discrete_dp|2024-12-30 03:36|cache|29.53|✅|\n", + "|dyn_stack|2024-12-30 03:36|cache|5.36|✅|\n", + "|entropy|2024-12-30 03:36|cache|4.02|✅|\n", + "|estspec|2024-12-30 03:36|cache|4.55|✅|\n", + "|five_preferences|2024-12-30 03:37|cache|37.58|✅|\n", + "|growth_in_dles|2024-12-30 03:37|cache|3.59|✅|\n", + "|hs_invertibility_example|2024-12-30 03:37|cache|3.86|✅|\n", + "|hs_recursive_models|2024-12-30 03:37|cache|0.96|✅|\n", + "|intro|2024-12-30 03:37|cache|0.96|✅|\n", + "|irfs_in_hall_model|2024-12-30 03:37|cache|3.62|✅|\n", + "|knowing_forecasts_of_others|2024-12-30 03:37|cache|22.0|✅|\n", + "|lqramsey|2024-12-30 03:38|cache|5.19|✅|\n", + "|lu_tricks|2024-12-30 03:38|cache|1.96|✅|\n", + "|lucas_asset_pricing_dles|2024-12-30 03:38|cache|3.61|✅|\n", + "|lucas_model|2024-12-30 03:38|cache|12.15|✅|\n", + "|markov_jump_lq|2024-12-30 03:39|cache|75.53|✅|\n", + "|match_transport|2024-12-30 03:39|cache|20.86|✅|\n", + "|matsuyama|2024-12-30 03:40|cache|6.5|✅|\n", + "|muth_kalman|2024-12-30 03:40|cache|3.87|✅|\n", + "|opt_tax_recur|2024-12-30 03:41|cache|66.48|✅|\n", + "|orth_proj|2024-12-30 03:41|cache|1.01|✅|\n", + "|permanent_income_dles|2024-12-30 03:41|cache|3.63|✅|\n", + "|rob_markov_perf|2024-12-30 03:41|cache|3.8|✅|\n", + "|robustness|2024-12-30 03:41|cache|5.22|✅|\n", + "|rosen_schooling_model|2024-12-30 03:41|cache|3.78|✅|\n", + "|smoothing|2024-12-30 03:41|cache|4.0|✅|\n", + "|smoothing_tax|2024-12-30 03:41|cache|5.96|✅|\n", + "|stationary_densities|2024-12-30 03:41|cache|7.84|✅|\n", + "|status|2024-12-30 03:41|cache|4.02|✅|\n", + "|tax_smoothing_1|2024-12-30 03:42|cache|10.41|✅|\n", + "|tax_smoothing_2|2024-12-30 03:42|cache|4.12|✅|\n", + "|tax_smoothing_3|2024-12-30 03:42|cache|4.26|✅|\n", + "|troubleshooting|2024-12-30 03:37|cache|0.96|✅|\n", + "|un_insure|2024-12-30 03:42|cache|11.85|✅|\n", + "|zreferences|2024-12-30 03:37|cache|0.96|✅|\n", "\n", "\n", "These lectures are built on `linux` instances through `github actions`.\n", @@ -75,7 +75,7 @@ { "cell_type": "code", "execution_count": null, - "id": "8937a654", + "id": "c54328f6", "metadata": { "hide-output": false }, @@ -86,7 +86,7 @@ }, { "cell_type": "markdown", - "id": "8b48a150", + "id": "3eccc42b", "metadata": {}, "source": [ "and the following package versions" @@ -95,7 +95,7 @@ { "cell_type": "code", "execution_count": null, - "id": "1559de38", + "id": "49949609", "metadata": { "hide-output": false }, @@ -106,7 +106,7 @@ } ], "metadata": { - "date": 1734843463.1557753, + "date": 1735958032.776454, "filename": "status.md", "kernelspec": { "display_name": "Python", diff --git a/tax_smoothing_1.ipynb b/tax_smoothing_1.ipynb index 7faa7ec..56c30d5 100644 --- a/tax_smoothing_1.ipynb +++ b/tax_smoothing_1.ipynb @@ -2,7 +2,7 @@ "cells": [ { "cell_type": "markdown", - "id": "43e73b5a", + "id": "82d29c8c", "metadata": {}, "source": [ "\n", @@ -13,7 +13,7 @@ }, { "cell_type": "markdown", - "id": "68e9d1a4", + "id": "378c30d8", "metadata": {}, "source": [ "# How to Pay for a War: Part 1\n", @@ -24,7 +24,7 @@ { "cell_type": "code", "execution_count": null, - "id": "768c1f6f", + "id": "13495832", "metadata": { "hide-output": false }, @@ -35,7 +35,7 @@ }, { "cell_type": "markdown", - "id": "ddf4f727", + "id": "6eaf99c4", "metadata": {}, "source": [ "## Reader’s Guide\n", @@ -46,7 +46,7 @@ { "cell_type": "code", "execution_count": null, - "id": "93006744", + "id": "ab221a43", "metadata": { "hide-output": false }, @@ -59,7 +59,7 @@ }, { "cell_type": "markdown", - "id": "69a4f465", + "id": "a62ed07e", "metadata": {}, "source": [ "This lecture uses the method of **Markov jump linear quadratic dynamic programming** that is described in lecture\n", @@ -163,7 +163,7 @@ }, { "cell_type": "markdown", - "id": "d84f3bde", + "id": "98f9b274", "metadata": {}, "source": [ "## Public Finance Questions\n", @@ -208,7 +208,7 @@ }, { "cell_type": "markdown", - "id": "aebffebb", + "id": "f97f2adf", "metadata": {}, "source": [ "## Barro (1979) Model\n", @@ -325,7 +325,7 @@ { "cell_type": "code", "execution_count": null, - "id": "b7443c89", + "id": "eb26ec22", "metadata": { "hide-output": false }, @@ -370,7 +370,7 @@ }, { "cell_type": "markdown", - "id": "b1cee7cf", + "id": "2f6415b4", "metadata": {}, "source": [ "We can now create an instance of `LQ`:" @@ -379,7 +379,7 @@ { "cell_type": "code", "execution_count": null, - "id": "e2adecdd", + "id": "4dfdc2c4", "metadata": { "hide-output": false }, @@ -392,7 +392,7 @@ }, { "cell_type": "markdown", - "id": "8e4a07f0", + "id": "3cae4798", "metadata": {}, "source": [ "We can see the isomorphism by noting that consumption is a martingale in\n", @@ -432,7 +432,7 @@ { "cell_type": "code", "execution_count": null, - "id": "c615c446", + "id": "a6dd8aa6", "metadata": { "hide-output": false }, @@ -443,7 +443,7 @@ }, { "cell_type": "markdown", - "id": "b3af5234", + "id": "69f0d66e", "metadata": {}, "source": [ "This explains the fanning out of the conditional empirical distribution of taxation across time, computing\n", @@ -454,7 +454,7 @@ { "cell_type": "code", "execution_count": null, - "id": "3afb116e", + "id": "811ead00", "metadata": { "hide-output": false }, @@ -471,7 +471,7 @@ }, { "cell_type": "markdown", - "id": "cb6d64c4", + "id": "43841dac", "metadata": {}, "source": [ "We can see a similar, but a smoother pattern, if we plot government debt\n", @@ -481,7 +481,7 @@ { "cell_type": "code", "execution_count": null, - "id": "aadbdc7a", + "id": "7b86a3a4", "metadata": { "hide-output": false }, @@ -498,7 +498,7 @@ }, { "cell_type": "markdown", - "id": "67f9c0a5", + "id": "93da0082", "metadata": {}, "source": [ "## Python Class to Solve Markov Jump Linear Quadratic Control Problems\n", @@ -527,7 +527,7 @@ }, { "cell_type": "markdown", - "id": "d8e5b854", + "id": "ea0549c3", "metadata": {}, "source": [ "## Barro Model with a Time-varying Interest Rate\n", @@ -569,7 +569,7 @@ { "cell_type": "code", "execution_count": null, - "id": "29a22da4", + "id": "cac19b19", "metadata": { "hide-output": false }, @@ -601,7 +601,7 @@ }, { "cell_type": "markdown", - "id": "ac10b1d1", + "id": "5dcab383", "metadata": {}, "source": [ "The decision rules are now dependent on the Markov state:" @@ -610,7 +610,7 @@ { "cell_type": "code", "execution_count": null, - "id": "eeb8de61", + "id": "2e1829b3", "metadata": { "hide-output": false }, @@ -622,7 +622,7 @@ { "cell_type": "code", "execution_count": null, - "id": "5f26669c", + "id": "148b7b81", "metadata": { "hide-output": false }, @@ -633,7 +633,7 @@ }, { "cell_type": "markdown", - "id": "6472f727", + "id": "8d9ebbc1", "metadata": {}, "source": [ "Simulating a large number of such economies over time reveals\n", @@ -646,7 +646,7 @@ { "cell_type": "code", "execution_count": null, - "id": "a5f3c2b3", + "id": "b42538b0", "metadata": { "hide-output": false }, @@ -664,7 +664,7 @@ } ], "metadata": { - "date": 1734843463.1865592, + "date": 1735958032.9667928, "filename": "tax_smoothing_1.md", "kernelspec": { "display_name": "Python", diff --git a/tax_smoothing_2.ipynb b/tax_smoothing_2.ipynb index 2ba42b7..ca75578 100644 --- a/tax_smoothing_2.ipynb +++ b/tax_smoothing_2.ipynb @@ -2,7 +2,7 @@ "cells": [ { "cell_type": "markdown", - "id": "204b8755", + "id": "51987723", "metadata": {}, "source": [ "\n", @@ -13,7 +13,7 @@ }, { "cell_type": "markdown", - "id": "73dc51ab", + "id": "670c4374", "metadata": {}, "source": [ "# How to Pay for a War: Part 2\n", @@ -24,7 +24,7 @@ { "cell_type": "code", "execution_count": null, - "id": "80ed6f59", + "id": "4263c586", "metadata": { "hide-output": false }, @@ -35,7 +35,7 @@ }, { "cell_type": "markdown", - "id": "7bde8965", + "id": "c2fb68e7", "metadata": {}, "source": [ "## An Application of Markov Jump Linear Quadratic Dynamic Programming\n", @@ -83,7 +83,7 @@ { "cell_type": "code", "execution_count": null, - "id": "e7e8816d", + "id": "536dfcb9", "metadata": { "hide-output": false }, @@ -96,7 +96,7 @@ }, { "cell_type": "markdown", - "id": "f861d162", + "id": "6c978b26", "metadata": {}, "source": [ "## Two example specifications\n", @@ -113,7 +113,7 @@ }, { "cell_type": "markdown", - "id": "14a5175c", + "id": "660ef9f9", "metadata": {}, "source": [ "## One- and Two-period Bonds but No Restructuring\n", @@ -186,7 +186,7 @@ }, { "cell_type": "markdown", - "id": "7fb92203", + "id": "b3719e8f", "metadata": {}, "source": [ "## Mapping into an LQ Markov Jump Problem\n", @@ -351,7 +351,7 @@ { "cell_type": "code", "execution_count": null, - "id": "6b90da95", + "id": "d37e5843", "metadata": { "hide-output": false }, @@ -412,7 +412,7 @@ }, { "cell_type": "markdown", - "id": "945c1bf8", + "id": "b41dd125", "metadata": {}, "source": [ "With the above function, we can proceed to solve the model in two steps:\n", @@ -426,7 +426,7 @@ }, { "cell_type": "markdown", - "id": "50a3805b", + "id": "2c02fd71", "metadata": {}, "source": [ "## Penalty on Different Issuance Across Maturities\n", @@ -479,7 +479,7 @@ { "cell_type": "code", "execution_count": null, - "id": "da6a48ec", + "id": "b45c2b2b", "metadata": { "hide-output": false }, @@ -533,7 +533,7 @@ }, { "cell_type": "markdown", - "id": "2705c32a", + "id": "3c511ba3", "metadata": {}, "source": [ "The above simulations show that when no penalty is imposed on different\n", @@ -550,7 +550,7 @@ { "cell_type": "code", "execution_count": null, - "id": "f7579f6a", + "id": "d79fbd25", "metadata": { "hide-output": false }, @@ -594,7 +594,7 @@ }, { "cell_type": "markdown", - "id": "1d293dc0", + "id": "c082012e", "metadata": {}, "source": [ "## A Model with Restructuring\n", @@ -771,7 +771,7 @@ }, { "cell_type": "markdown", - "id": "009868e9", + "id": "3d0416e8", "metadata": {}, "source": [ "## Restructuring as a Markov Jump Linear Quadratic Control Problem\n", @@ -784,7 +784,7 @@ { "cell_type": "code", "execution_count": null, - "id": "3e1f9a6d", + "id": "9146f902", "metadata": { "hide-output": false }, @@ -839,7 +839,7 @@ }, { "cell_type": "markdown", - "id": "68d599a7", + "id": "ef4ce98f", "metadata": {}, "source": [ "### Example with Restructuring\n", @@ -870,7 +870,7 @@ { "cell_type": "code", "execution_count": null, - "id": "c54c230e", + "id": "7fdeb402", "metadata": { "hide-output": false }, @@ -915,7 +915,7 @@ { "cell_type": "code", "execution_count": null, - "id": "2c509bdf", + "id": "6dcdc91a", "metadata": { "hide-output": false }, @@ -943,7 +943,7 @@ { "cell_type": "code", "execution_count": null, - "id": "fb0b6bb7", + "id": "ce6a39cf", "metadata": { "hide-output": false }, @@ -960,7 +960,7 @@ } ], "metadata": { - "date": 1734843463.212723, + "date": 1735958032.9928958, "filename": "tax_smoothing_2.md", "kernelspec": { "display_name": "Python", diff --git a/tax_smoothing_3.ipynb b/tax_smoothing_3.ipynb index f98a44b..3b2d6d2 100644 --- a/tax_smoothing_3.ipynb +++ b/tax_smoothing_3.ipynb @@ -2,7 +2,7 @@ "cells": [ { "cell_type": "markdown", - "id": "5f66544c", + "id": "04b6f1a1", "metadata": {}, "source": [ "\n", @@ -13,7 +13,7 @@ }, { "cell_type": "markdown", - "id": "d99193e8", + "id": "1b6d4ba8", "metadata": {}, "source": [ "# How to Pay for a War: Part 3\n", @@ -24,7 +24,7 @@ { "cell_type": "code", "execution_count": null, - "id": "1932c485", + "id": "b7308f98", "metadata": { "hide-output": false }, @@ -35,7 +35,7 @@ }, { "cell_type": "markdown", - "id": "a92e9388", + "id": "9c8afaf7", "metadata": {}, "source": [ "## Another Application of Markov Jump Linear Quadratic Dynamic Programming\n", @@ -64,7 +64,7 @@ { "cell_type": "code", "execution_count": null, - "id": "12e530bb", + "id": "bdf8a491", "metadata": { "hide-output": false }, @@ -77,7 +77,7 @@ }, { "cell_type": "markdown", - "id": "62f3efd4", + "id": "64dd989b", "metadata": {}, "source": [ "## Roll-Over Risk\n", @@ -129,7 +129,7 @@ }, { "cell_type": "markdown", - "id": "93e191d3", + "id": "82ed4605", "metadata": {}, "source": [ "## A Dead End\n", @@ -167,7 +167,7 @@ }, { "cell_type": "markdown", - "id": "5eed87e8", + "id": "ea872a38", "metadata": {}, "source": [ "## Better Representation of Roll-Over Risk\n", @@ -221,7 +221,7 @@ { "cell_type": "code", "execution_count": null, - "id": "982d60df", + "id": "2f20a643", "metadata": { "hide-output": false }, @@ -281,7 +281,7 @@ }, { "cell_type": "markdown", - "id": "3fd2db46", + "id": "e482eebc", "metadata": {}, "source": [ "This model is simulated below, using the same process for $ G_t $ as\n", @@ -304,7 +304,7 @@ { "cell_type": "code", "execution_count": null, - "id": "cfea0e62", + "id": "be3a3663", "metadata": { "hide-output": false }, @@ -332,7 +332,7 @@ }, { "cell_type": "markdown", - "id": "ea88c3bc", + "id": "e81049a4", "metadata": {}, "source": [ "We can adjust the model so that, rather than having debt fluctuate\n", @@ -346,7 +346,7 @@ { "cell_type": "code", "execution_count": null, - "id": "56a394af", + "id": "3a11cf94", "metadata": { "hide-output": false }, @@ -387,7 +387,7 @@ }, { "cell_type": "markdown", - "id": "f2a5517b", + "id": "675e5d45", "metadata": {}, "source": [ "With a lower interest rate, the government has an incentive to\n", @@ -403,7 +403,7 @@ } ], "metadata": { - "date": 1734843463.227847, + "date": 1735958033.0086713, "filename": "tax_smoothing_3.md", "kernelspec": { "display_name": "Python", diff --git a/troubleshooting.ipynb b/troubleshooting.ipynb index c465bc4..f27176d 100644 --- a/troubleshooting.ipynb +++ b/troubleshooting.ipynb @@ -2,7 +2,7 @@ "cells": [ { "cell_type": "markdown", - "id": "f634dbd7", + "id": "e8b7fed2", "metadata": {}, "source": [ "\n", @@ -11,7 +11,7 @@ }, { "cell_type": "markdown", - "id": "138dfa22", + "id": "2b85702a", "metadata": {}, "source": [ "# Troubleshooting\n", @@ -21,7 +21,7 @@ }, { "cell_type": "markdown", - "id": "4780f77e", + "id": "411deb3d", "metadata": {}, "source": [ "## Fixing Your Local Environment\n", @@ -63,7 +63,7 @@ }, { "cell_type": "markdown", - "id": "e25e0ee9", + "id": "9aa97470", "metadata": {}, "source": [ "## Reporting an Issue\n", @@ -80,7 +80,7 @@ } ], "metadata": { - "date": 1734843463.232527, + "date": 1735958033.0129833, "filename": "troubleshooting.md", "kernelspec": { "display_name": "Python", diff --git a/un_insure.ipynb b/un_insure.ipynb index 1d04cab..d6462b4 100644 --- a/un_insure.ipynb +++ b/un_insure.ipynb @@ -2,7 +2,7 @@ "cells": [ { "cell_type": "markdown", - "id": "fd2e40fb", + "id": "b701674a", "metadata": {}, "source": [ "# Optimal Unemployment Insurance" @@ -10,7 +10,7 @@ }, { "cell_type": "markdown", - "id": "658794a4", + "id": "63cf20c7", "metadata": {}, "source": [ "## Overview\n", @@ -28,7 +28,7 @@ }, { "cell_type": "markdown", - "id": "2abc5d9b", + "id": "6b23d1c7", "metadata": {}, "source": [ "## Shavell and Weiss’s Model\n", @@ -88,7 +88,7 @@ }, { "cell_type": "markdown", - "id": "6704525c", + "id": "cccb94c6", "metadata": {}, "source": [ "### Autarky\n", @@ -160,7 +160,7 @@ }, { "cell_type": "markdown", - "id": "b11c63f8", + "id": "a84bd9b7", "metadata": {}, "source": [ "### Full Information\n", @@ -274,7 +274,7 @@ }, { "cell_type": "markdown", - "id": "36ddc25d", + "id": "ff73dd51", "metadata": {}, "source": [ "### Incentive Problem\n", @@ -340,7 +340,7 @@ }, { "cell_type": "markdown", - "id": "b8b231e2", + "id": "c397e74b", "metadata": {}, "source": [ "## Private Information\n", @@ -445,7 +445,7 @@ }, { "cell_type": "markdown", - "id": "d1812281", + "id": "bbe684c3", "metadata": {}, "source": [ "### Computational Details\n", @@ -534,7 +534,7 @@ }, { "cell_type": "markdown", - "id": "e86a6df7", + "id": "b11fc48c", "metadata": {}, "source": [ "### Python Computations\n", @@ -547,7 +547,7 @@ { "cell_type": "code", "execution_count": null, - "id": "d7518994", + "id": "373ceaab", "metadata": { "hide-output": false }, @@ -560,7 +560,7 @@ }, { "cell_type": "markdown", - "id": "fb276943", + "id": "4bfde15c", "metadata": {}, "source": [ "We first create a class to set up a particular parametrization." @@ -569,7 +569,7 @@ { "cell_type": "code", "execution_count": null, - "id": "20464ca2", + "id": "facb5af9", "metadata": { "hide-output": false }, @@ -592,7 +592,7 @@ }, { "cell_type": "markdown", - "id": "b2877ce0", + "id": "2938a8fb", "metadata": {}, "source": [ "### Parameter Values\n", @@ -607,7 +607,7 @@ { "cell_type": "code", "execution_count": null, - "id": "d8cec303", + "id": "871c1315", "metadata": { "hide-output": false }, @@ -633,7 +633,7 @@ }, { "cell_type": "markdown", - "id": "b484c7b0", + "id": "e0f4b889", "metadata": {}, "source": [ "Recall that under autarky the value for an unemployed worker\n", @@ -672,7 +672,7 @@ { "cell_type": "code", "execution_count": null, - "id": "67d9e0bd", + "id": "91db2c9a", "metadata": { "hide-output": false }, @@ -691,7 +691,7 @@ }, { "cell_type": "markdown", - "id": "038fb5f0", + "id": "83033fdc", "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", @@ -704,7 +704,7 @@ { "cell_type": "code", "execution_count": null, - "id": "c2b67026", + "id": "6b3d4458", "metadata": { "hide-output": false }, @@ -722,7 +722,7 @@ }, { "cell_type": "markdown", - "id": "754def15", + "id": "b37c99ab", "metadata": {}, "source": [ "Now, let us create an instance of the model with our parametrization" @@ -731,7 +731,7 @@ { "cell_type": "code", "execution_count": null, - "id": "13dcb14a", + "id": "754fd441", "metadata": { "hide-output": false }, @@ -745,7 +745,7 @@ }, { "cell_type": "markdown", - "id": "e0b40189", + "id": "c51590be", "metadata": {}, "source": [ "We want to compute an $ r $ that is consistent with the hazard rate 0.1 in autarky.\n", @@ -756,7 +756,7 @@ { "cell_type": "code", "execution_count": null, - "id": "054d1503", + "id": "ff69892b", "metadata": { "hide-output": false }, @@ -773,7 +773,7 @@ }, { "cell_type": "markdown", - "id": "13ad0fc9", + "id": "33b7fdc0", "metadata": {}, "source": [ "Now that we have calibrated our interest rate $ r $, we can continue with solving the model with private information." @@ -781,7 +781,7 @@ }, { "cell_type": "markdown", - "id": "cc345c42", + "id": "5b86eadb", "metadata": {}, "source": [ "### Computation under Private Information\n", @@ -806,7 +806,7 @@ { "cell_type": "code", "execution_count": null, - "id": "d071c393", + "id": "481e5e62", "metadata": { "hide-output": false }, @@ -836,7 +836,7 @@ }, { "cell_type": "markdown", - "id": "275491e2", + "id": "fece631e", "metadata": {}, "source": [ "With these analytical solutions for optimal $ c $ and $ a $ in hand, we can reduce the minimization to [(40.12)](#equation-eq-hugo23) in the single variable\n", @@ -847,7 +847,7 @@ }, { "cell_type": "markdown", - "id": "99ef9159", + "id": "7022e704", "metadata": {}, "source": [ "### Algorithm\n", @@ -866,7 +866,7 @@ { "cell_type": "code", "execution_count": null, - "id": "83b549f2", + "id": "8d6cb5d7", "metadata": { "hide-output": false }, @@ -919,7 +919,7 @@ }, { "cell_type": "markdown", - "id": "a39ae6ae", + "id": "2e264670", "metadata": {}, "source": [ "The below code executes steps 4 and 5 in the Algorithm until convergence to a function $ C^*(V) $." @@ -928,7 +928,7 @@ { "cell_type": "code", "execution_count": null, - "id": "ad261b31", + "id": "2fc4bfdc", "metadata": { "hide-output": false }, @@ -956,7 +956,7 @@ }, { "cell_type": "markdown", - "id": "070937c4", + "id": "d3e9d7de", "metadata": {}, "source": [ "## Outcomes\n", @@ -967,7 +967,7 @@ { "cell_type": "code", "execution_count": null, - "id": "40ec45eb", + "id": "4598e378", "metadata": { "hide-output": false }, @@ -993,7 +993,7 @@ }, { "cell_type": "markdown", - "id": "dc8ecda6", + "id": "587e0ebc", "metadata": {}, "source": [ "### Replacement Ratios and Continuation Values\n", @@ -1008,7 +1008,7 @@ { "cell_type": "code", "execution_count": null, - "id": "883ca791", + "id": "188bbae5", "metadata": { "hide-output": false }, @@ -1028,7 +1028,7 @@ { "cell_type": "code", "execution_count": null, - "id": "c63ec38b", + "id": "36eacdcf", "metadata": { "hide-output": false }, @@ -1045,7 +1045,7 @@ { "cell_type": "code", "execution_count": null, - "id": "51190a76", + "id": "79ec1f99", "metadata": { "hide-output": false }, @@ -1081,7 +1081,7 @@ }, { "cell_type": "markdown", - "id": "87b2828d", + "id": "021cce64", "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", @@ -1091,7 +1091,7 @@ }, { "cell_type": "markdown", - "id": "ce044ae2", + "id": "498a22ae", "metadata": {}, "source": [ "### Interpretations\n", @@ -1145,7 +1145,7 @@ } ], "metadata": { - "date": 1734843463.4339125, + "date": 1735958033.0585022, "filename": "un_insure.md", "kernelspec": { "display_name": "Python", diff --git a/zreferences.ipynb b/zreferences.ipynb index 9a7e050..eca3838 100644 --- a/zreferences.ipynb +++ b/zreferences.ipynb @@ -2,7 +2,7 @@ "cells": [ { "cell_type": "markdown", - "id": "c28cf704", + "id": "ee4cc6f8", "metadata": {}, "source": [ "\n", @@ -11,7 +11,7 @@ }, { "cell_type": "markdown", - "id": "99d07e2e", + "id": "499d0d59", "metadata": {}, "source": [ "# References\n", @@ -68,7 +68,7 @@ "\\[BL92\\] Fischer Black and Robert Litterman. Global portfolio optimization. *Financial analysts journal*, 48(5):28–43, 1992.\n", "\n", "\n", - "\\[BTWZ23\\] Job Boerma, Aleh Tsyvinski, Ruodu Wang, and Zhenyuan Zhang. Composite sorting. Technical Report, National Bureau of Economic Research, 2023.\n", + "\\[BTWZ24\\] Job Boerma, Aleh Tsyvinski, Ruodu Wang, and Zhenyuan Zhang. Composite sorting. Technical Report, University of Wisconsin, 2024.\n", "\n", "\n", "\\[Buc04\\] James A. Bucklew. *An Introduction to Rare Event Simulation*. Springer Verlag, New York, 2004.\n", @@ -334,7 +334,7 @@ } ], "metadata": { - "date": 1734843463.463341, + "date": 1735958033.089157, "filename": "zreferences.md", "kernelspec": { "display_name": "Python",