diff --git a/notebooks/Micro-and-Macro-Implications-of-Very-Impatient-HHs-Problems-and-Solutions.ipynb b/notebooks/Micro-and-Macro-Implications-of-Very-Impatient-HHs-Problems-and-Solutions.ipynb new file mode 100644 index 0000000..ca58cbf --- /dev/null +++ b/notebooks/Micro-and-Macro-Implications-of-Very-Impatient-HHs-Problems-and-Solutions.ipynb @@ -0,0 +1,560 @@ +{ + "cells": [ + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "# Micro- and Macroeconomic Implications of Very Impatient Households\n", + "\n", + "

Generator: QuARK-make/notebooks_byname

" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "## Introduction\n", + "\n", + "Buffer stock saving models of the kind implemented in $\\texttt{ConsIndShockType}$ say that, if a standard ['Growth Impatience Condition'](https://econ.jhu.edu/people/ccarroll/papers/BufferStockTheory/#Growth-Modified-Conditions), holds:\n", + "\n", + "\\begin{eqnarray}\n", + "\\newcommand{\\Rfree}{\\mathsf{R}}\\newcommand{\\DiscFac}{\\beta}\\newcommand{\\PermGroFac}{\\Gamma}\\newcommand{\\PermShk}{\\psi}\\newcommand{\\CRRA}{\\rho}\n", + "\\left(\\frac{(\\Rfree\\DiscFac)^{1/\\CRRA}\\mathbb{E}[\\PermShk^{-1}]}{\\PermGroFac}\\right) & < & 1\n", + "\\end{eqnarray}\n", + "\n", + "then the _ratio_ of asets $\\newcommand{\\aLev}{\\mathbf{a}}\\aLev$ to permanent income $\\newcommand{\\pLev}{\\mathbf{p}}\\pLev$, $a=\\aLev/\\pLev$, has a target value $\\newcommand{\\aTarg}{\\check{a}}\\aTarg$ that depends on the consumer's preferences (relative risk aversion $\\CRRA$, time preference $\\DiscFac$) and circumstances (interest factor $\\Rfree$, growth factor $\\PermGroFac$, uncertainty about permanent income shocks $\\sigma^{2}_{\\PermShk}$).\n", + "\n", + "If everyone had identical preferences and everyone were at their target $\\check{a}$, then inequality in the level of $\\aLev$ would be exactly the same as inequality in $\\pLev$.\n", + "\n", + "[\"The Distribution of Wealth and the Marginal Propensity to Consume\"](http://econ.jhu.edu/people/ccarroll/papers/cstwMPC) (Carroll, Slacalek, Tokuoka, and White 2017; hereafter: \"cstwMPC\") shows that, when such a model is simulated and agents draw their idiosyncratic shocks (so, agents are _ex post_ heterogeneous -- see the definition in [Intro-To-HARK](http://github.com/econ-ark/PARK/tree/master/Intro-To-HARK.pdf)) -- asset inequality is indeed close to $\\pLev$ inequality even though everyone is not always at exactly their target $a$.\n", + "\n", + "But a large body of evidence shows that _actual_ inequality in assets is much greater than _actual_ inequality in permanent income. Thus, to make a model that qualifies as what cstwMPC call a 'serious' microfounded macro model of consumption (one that matches the key facts _theory says_ should be first-order important), the model must be modified to incorporate some form of _ex ante_ heterogeneity: That is, there must be differences across people in $\\DiscFac$ or $\\Rfree$ or $\\CRRA$ or $\\PermGroFac$ or $\\sigma^{2}_{\\PermShk}$.\n", + "\n", + "The most transparent and simplest of these to change is the time preference factor $\\beta$. So that is what the paper does. The main results are:\n", + "\n", + "1. The distribution of $\\beta$ need not be particularly wide to match the extreme concentration of wealth: roughly 0.91 to 0.98 (annual); that is, the most impatient person discounts the future about 6 percentage points more per year than the most patient agent agent\n", + "2. With such a distribution of $\\beta$, simulated agents' (annual) marginal propensity to consume (MPC) from transitory income shocks to income matches large body of microeconomic evidence that typically finds evidence of MPC's in the range of 0.2 to 0.6. This is much better than RA macro models that typically yield MPC's in the range of 0.01 to 0.05.\n", + "\n", + "While the most impatient agents in the cstwMPC model have fairly high MPCs (~0.6 annual), there is microeconomic evidence that a significant fraction of households have *even higher* MPCs than the model predicts, especially at the quarterly frequency. This group of households is commonly referred to as \"hand-to-mouth\" -- they consume most of their transitory shocks to income not too long after they receive them (mostly within a quarter). There are several reasons why a household could be hand-to-mouth, but one plausible explanation is that these households are *even more impatient* than estimated by cstwMPC for the most impatient agent.\n" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "### PROBLEM \n", + "In this exercise, you will explore the micro- and macroeconomic implications of some households being *very impatient*. Specifically, you will address the following questions:\n", + "\n", + "1. How does the distribution of the MPC change (relative to cstwMPC's baseline) if some simulated households are extremely impatient? Do we observe a significant portion of hand-to-mouth households?\n", + "2. How does the distribution (and aggregate level) of wealth change if some households are extremely impatient? Does this distribution of $\\beta$ still generate a wealth distribution like the one seen in U.S. data?" + ] + }, + { + "cell_type": "code", + "execution_count": null, + "metadata": { + "code_folding": [ + 25 + ] + }, + "outputs": [], + "source": [ + "# This cell does some setup and imports generic tools used to produce the figures\n", + "\n", + "from tqdm import tqdm\n", + "\n", + "import numpy as np\n", + "from copy import deepcopy\n", + "\n", + "import HARK # Prevents import error from Demos repo\n", + "from HARK.utilities import plotFuncs\n", + "\n", + "\n", + "Generator=False # Is this notebook the master or is it generated?\n", + "# Import related generic python packages\n", + "\n", + "# Set how many digits past the decimal point should be printed?\n", + "from time import clock\n", + "mystr = lambda number : \"{:.4f}\".format(number)\n", + "decfmt4 = lambda number : \"{:.4f}\".format(number)\n", + "decfmt3 = lambda number : \"{:.3f}\".format(number)\n", + "decfmt2 = lambda number : \"{:.2f}\".format(number)\n", + "decfmt1 = lambda number : \"{:.1f}\".format(number)\n", + "\n", + "# This is a jupytext paired notebook that autogenerates BufferStockTheory.py\n", + "# which can be executed from a terminal command line via \"ipython BufferStockTheory.py\"\n", + "# But a terminal does not permit inline figures, so we need to test jupyter vs terminal\n", + "# Google \"how can I check if code is executed in the ipython notebook\"\n", + "\n", + "from IPython import get_ipython # In case it was run from python instead of ipython\n", + "def in_ipynb():\n", + " try:\n", + " if str(type(get_ipython())) == \"\":\n", + " return True\n", + " else:\n", + " return False\n", + " except NameError:\n", + " return False\n", + "\n", + "# Determine whether to make the figures inline (for spyder or jupyter)\n", + "# vs whatever is the automatic setting that will apply if run from the terminal\n", + "if in_ipynb():\n", + " # %matplotlib inline generates a syntax error when run from the shell\n", + " # so do this instead\n", + " get_ipython().run_line_magic('matplotlib', 'inline')\n", + "else:\n", + " get_ipython().run_line_magic('matplotlib', 'auto')\n", + "\n", + "# Import the plot-figure library matplotlib\n", + "\n", + "import matplotlib.pyplot as plt\n", + "\n", + "# In order to use LaTeX to manage all text layout in our figures, we import rc settings from matplotlib.\n", + "from matplotlib import rc\n", + "plt.rc('font', family='serif')\n", + "\n", + "# LaTeX is huge and takes forever to install on mybinder\n", + "# so if it is not installed then do not use it \n", + "from distutils.spawn import find_executable\n", + "iflatexExists=False\n", + "if find_executable('latex'):\n", + " iflatexExists=True\n", + " \n", + "plt.rc('text', usetex= iflatexExists)\n", + "\n", + "# The warnings package allows us to ignore some harmless but alarming warning messages\n", + "import warnings\n", + "warnings.filterwarnings(\"ignore\")\n", + "\n", + "from copy import copy, deepcopy" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "## Calibrating a Basic Version of cstwMPC\n", + "\n", + "To get started, let's reproduce a simplified version of the main results from cstwMPC. \n", + "\n", + "In cstwMPC, the authors calibrated nearly all of the model parameters-- risk aversion, income shock process, etc-- to commonly used or previously estimated values. The only parameter to be estimated is the distribution of $\\beta$. cstwMPC assumed that $\\beta$ is uniformly distributed on $[\\grave{\\beta}-\\nabla,\\grave{\\beta}+\\nabla]$, approximated by a seven point distribution.\n", + "\n", + "Their estimation procedure seeks the values of $\\grave{\\beta}$ and $\\nabla$ that generate a simulated distribution of wealth that best matches empirical U.S. data. Their definition of \"best match\" has two aspects:\n", + "\n", + "1. The simulated aggregate capital-to-income ratio matches the true U.S. value.\n", + "2. The sum of squared distances between the simulated and empirical Lorenz curves (at the 20th, 40th, 60th, and 80th percentiles) is minimized (conditional on item 1).\n", + "\n", + "cstwMPC's target empirical moments are a capital-to-income ratio of 10.26 and cumulative wealth shares as given in the table below. Yes, you are reading the table correctly: The \"poorest\" 80 percent of households own 17.5 percent of wealth. \n", + "\n", + "| Net worth percentile | Cumulative wealth share |\n", + "|:---:|:---:|\n", + "| 20th | -0.2% |\n", + "| 40th | 1.0% |\n", + "| 60th | 5.5% |\n", + "| 80th | 17.5% |\n", + "\n", + "To reproduce their basic results, we must import an $\\texttt{AgentType}$ subclass and define a dictionary with calibrated parameters identical to those in the paper." + ] + }, + { + "cell_type": "code", + "execution_count": 2, + "metadata": { + "code_folding": [ + 0, + 4 + ] + }, + "outputs": [], + "source": [ + "# Import IndShockConsumerType\n", + "from HARK.ConsumptionSaving.ConsIndShockModel import IndShockConsumerType\n", + "\n", + "# Define a dictionary with calibrated parameters\n", + "cstwMPC_calibrated_parameters = {\n", + " \"CRRA\":1.0, # Coefficient of relative risk aversion \n", + " \"Rfree\":1.01/(1.0 - 1.0/160.0), # Survival probability,\n", + " \"PermGroFac\":[1.000**0.25], # Permanent income growth factor (no perm growth),\n", + " \"PermGroFacAgg\":1.0,\n", + " \"BoroCnstArt\":0.0,\n", + " \"CubicBool\":False,\n", + " \"vFuncBool\":False,\n", + " \"PermShkStd\":[(0.01*4/11)**0.5], # Standard deviation of permanent shocks to income\n", + " \"PermShkCount\":5, # Number of points in permanent income shock grid\n", + " \"TranShkStd\":[(0.01*4)**0.5], # Standard deviation of transitory shocks to income,\n", + " \"TranShkCount\":5, # Number of points in transitory income shock grid\n", + " \"UnempPrb\":0.07, # Probability of unemployment while working\n", + " \"IncUnemp\":0.15, # Unemployment benefit replacement rate\n", + " \"UnempPrbRet\":None,\n", + " \"IncUnempRet\":None,\n", + " \"aXtraMin\":0.00001, # Minimum end-of-period assets in grid\n", + " \"aXtraMax\":40, # Maximum end-of-period assets in grid\n", + " \"aXtraCount\":32, # Number of points in assets grid\n", + " \"aXtraExtra\":[None],\n", + " \"aXtraNestFac\":3, # Number of times to 'exponentially nest' when constructing assets grid\n", + " \"LivPrb\":[1.0 - 1.0/160.0], # Survival probability\n", + " \"DiscFac\":0.97, # Default intertemporal discount factor; dummy value, will be overwritten\n", + " \"cycles\":0,\n", + " \"T_cycle\":1,\n", + " \"T_retire\":0,\n", + " 'T_sim':1200, # Number of periods to simulate (idiosyncratic shocks model, perpetual youth)\n", + " 'T_age': 400,\n", + " 'IndL': 10.0/9.0, # Labor supply per individual (constant),\n", + " 'aNrmInitMean':np.log(0.00001),\n", + " 'aNrmInitStd':0.0,\n", + " 'pLvlInitMean':0.0,\n", + " 'pLvlInitStd':0.0,\n", + " 'AgentCount':10000,\n", + "}" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "Now let's make several instances of our class of agents and give them different values of $\\beta$, following cstwMPC's estimated distribution. In our specification of interest, we will use $\\grave{\\beta}=0.9855583$ and $\\nabla = 0.0085$.\n", + "\n", + "NB: Reported parameter estimates in cstwMPC use a model with aggregate shocks and wage and interest rates determined dynamically (a heterogeneous agents DSGE model); this is the $\\texttt{AggShockConsumerType}$ in HARK. The estimated parameters are slightly different in this exercise, as we are ignoring general equilibrium aspects and only using the $\\texttt{IndShockConsumerType}$" + ] + }, + { + "cell_type": "code", + "execution_count": 3, + "metadata": {}, + "outputs": [], + "source": [ + "# This cell constructs seven instances of IndShockConsumerType with different discount factors\n", + "from HARK.utilities import approxUniform\n", + "BaselineType = IndShockConsumerType(**cstwMPC_calibrated_parameters)\n", + "\n", + "# Specify the distribution of the discount factor\n", + "num_types = 7 # number of types we want\n", + "DiscFac_mean = 0.9855583 # center of beta distribution \n", + "DiscFac_spread = 0.0085 # spread of beta distribution\n", + "DiscFac_dstn = approxUniform(num_types, DiscFac_mean-DiscFac_spread, DiscFac_mean+DiscFac_spread)[1]\n", + "\n", + "MyTypes = [] # initialize an empty list to hold our consumer types\n", + "for nn in range(num_types):\n", + " # Now create the types, and append them to the list MyTypes\n", + " NewType = deepcopy(BaselineType)\n", + " NewType.DiscFac = DiscFac_dstn[nn]\n", + " NewType.seed = nn # give each consumer type a different RNG seed\n", + " MyTypes.append(NewType)" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "## Solving and Simulating the Baseline Agents\n", + "\n", + "Now let's solve and simulate each of our types of agents. If you look in the parameter dictionary (or at any of the agent objects themselves), you will see that each one has an $\\texttt{AgentCount}$ attribute of 10000. That is, these seven ex ante heterogeneous types each represent ten thousand individual agents that will experience ex post heterogeneity when they draw different income (and mortality) shocks over time.\n", + "\n", + "In the code block below, fill in the contents of the loop to solve and simulate each agent type for many periods. To do this, you should invoke the methods $\\texttt{solve}$, $\\texttt{initializeSim}$, and $\\texttt{simulate}$ in that order. Simulating for 1200 quarters (300 years) will approximate the long run distribution of wealth in the population. " + ] + }, + { + "cell_type": "code", + "execution_count": null, + "metadata": {}, + "outputs": [], + "source": [ + "# Progress bar keeps track interactively of how many have been made\n", + "for ThisType in tqdm(MyTypes):\n", + " ThisType.solve()\n", + " ThisType.initializeSim()\n", + " ThisType.simulate()" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "To verify that you wrote that code correctly, let's check that the aggregate level of capital (total assets held by all households) to income ratio equals what we expected it would be. To do that, let's combine the asset holdings of all types, take the mean, and see if we get the desired capital to income ratio of 10.26.\n", + "\n", + "NB: Because there is no permanent income growth in this model, all shocks are mean one and idiosyncratic, and we have many agents, aggregate or average income is 1.0. " + ] + }, + { + "cell_type": "code", + "execution_count": 5, + "metadata": {}, + "outputs": [ + { + "name": "stdout", + "output_type": "stream", + "text": [ + "The ratio of aggregate capital to permanent income is 10.26\n" + ] + } + ], + "source": [ + "aLvl_all = np.concatenate([ThisType.aLvlNow for ThisType in MyTypes])\n", + "print('The ratio of aggregate capital to permanent income is ' + decfmt2(np.mean(aLvl_all)))" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "## Plotting the Lorenz Curve" + ] + }, + { + "cell_type": "code", + "execution_count": 6, + "metadata": {}, + "outputs": [ + { + "data": { + "image/png": "iVBORw0KGgoAAAANSUhEUgAAAYEAAAEICAYAAAC55kg0AAAABHNCSVQICAgIfAhkiAAAAAlwSFlzAAALEgAACxIB0t1+/AAAADl0RVh0U29mdHdhcmUAbWF0cGxvdGxpYiB2ZXJzaW9uIDMuMC4zLCBodHRwOi8vbWF0cGxvdGxpYi5vcmcvnQurowAAIABJREFUeJzt3Xl8VPW9//HXNwHCT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/B04d1CBYqn096rpnAP8bSRGaQA5EZEYpjsBEZEYpiQgIhLDlARERGKYkoCISAxTEhARiWFKAiIiMUxJQEQkhikJiIjEsP8PygY/UMLwzeYAAAAASUVORK5CYII=\n", + "text/plain": [ + "
" + ] + }, + "metadata": { + "needs_background": "light" + }, + "output_type": "display_data" + } + ], + "source": [ + "# Plot Lorenz curves for model with uniform distribution of time preference\n", + "from HARK.cstwMPC.SetupParamsCSTW import SCF_wealth, SCF_weights\n", + "from HARK.utilities import getLorenzShares, getPercentiles\n", + "\n", + "pctiles = np.linspace(0.001,0.999,200)\n", + "sim_wealth = np.concatenate([ThisType.aLvlNow for ThisType in MyTypes])\n", + "SCF_Lorenz_points = getLorenzShares(SCF_wealth,weights=SCF_weights,percentiles=pctiles)\n", + "sim_Lorenz_points = getLorenzShares(sim_wealth,percentiles=pctiles)\n", + "plt.plot(pctiles,SCF_Lorenz_points,'--k')\n", + "plt.plot(pctiles,sim_Lorenz_points,'-b')\n", + "plt.xlabel('Percentile of net worth')\n", + "plt.ylabel('Cumulative share of wealth')\n", + "plt.show(block=False)" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "## Calculating the Lorenz Distance at Targets\n", + "\n", + "Now we want to construct a function that calculates the Euclidean distance between simulated and actual Lorenz curves at the four percentiles of interest: 20, 40, 60, and 80. " + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "### PROBLEM - Create a Function to Calculate Lorenz Distance\n", + "Now let's write a function that calculates the Euclidean distance between simulated and actual Lorenz curves at the four percentiles of interest: 20, 40, 60, and 80. Fill in the skeleton of the function below, and then test your function using the input $\\texttt{MyTypes}$. If you did it correctly, the Lorenz distance should be 0.03.\n", + "\n", + "You may find it useful to check out some documentation for $\\texttt{HARK.utilities}$ [at this link](https://econ-ark.github.io/HARK/generated/HARKutilities.html)." + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "## The Distribution Of the Marginal Propensity to Consume\n", + "\n", + "For many macroeconomic purposes, the distribution of the MPC $\\kappa$ is more important than the distribution of wealth. Ours is a quarterly model, and MPC's are typically reported on an annual basis; we can compute an approximate MPC from the quraterly ones as $\\kappa_{Y} \\approx 1.0 - (1.0 - \\kappa_{Q})^4$\n", + "\n", + "In the cell below, we retrieve the MPCs from our simulated consumers and show that the 10th percentile in the MPC distribution is only about 6 percent, while at the 90th percentile it is almost 0.5" + ] + }, + { + "cell_type": "code", + "execution_count": 8, + "metadata": {}, + "outputs": [ + { + "name": "stdout", + "output_type": "stream", + "text": [ + "The MPC at the 10th percentile of the distribution is 0.06\n", + "The MPC at the 50th percentile of the distribution is 0.20\n", + "The MPC at the 90th percentile of the distribution is 0.49\n" + ] + } + ], + "source": [ + "# Retrieve the MPC's\n", + "percentiles=np.linspace(0.1,0.9,9)\n", + "MPC_sim = np.concatenate([ThisType.MPCnow for ThisType in MyTypes])\n", + "MPCpercentiles_quarterly = getPercentiles(MPC_sim,percentiles=percentiles)\n", + "MPCpercentiles_annual = 1.0 - (1.0 - MPCpercentiles_quarterly)**4\n", + "\n", + "print('The MPC at the 10th percentile of the distribution is '+str(decfmt2(MPCpercentiles_annual[0])))\n", + "print('The MPC at the 50th percentile of the distribution is '+str(decfmt2(MPCpercentiles_annual[4])))\n", + "print('The MPC at the 90th percentile of the distribution is '+str(decfmt2(MPCpercentiles_annual[-1])))" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "### PROBLEM\n", + "\n", + "Now let's look in more detail at the distribution of the MPC. In the code block below, write a function that produces text output of the following form:\n", + "\n", + "$\\texttt{The 35th percentile of the MPC is [whatever is the right number]}$\n", + "\n", + "Your function should take two inputs: a list of types of consumers and an array of percentiles (numbers between 0 and 1). It should return no outputs, merely print to screen one line of text for each requested percentile. The model is calibrated at a quarterly frequency, but Carroll et al report MPCs at an annual frequency. To convert, use the formula:\n", + "\n", + "$\\kappa_{Y} \\approx 1.0 - (1.0 - \\kappa_{Q})^4$" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "## Adding Very Impatient Households\n", + "\n", + "Now that we have some tools for examining both microeconomic (the MPC across the population) and macroeconomic (the distribution and overall level of wealth) outcomes from our model, we are all set to conduct our experiment.\n", + "\n", + "In this exercise, we are going to add very impatient households to the economy in a very direct way: by replacing the *most impatient consumer type* with an *even more impatient type*. Specifically, we will have these agents have a discount factor of $\\beta = 0.80$ at a quarterly frequency, which corresponds to $\\beta \\approx 0.41$ annual.\n", + "\n", + "In the code block below, we:\n", + "\n", + "1. Replicate the list of agents using $\\texttt{deepcopy}$.\n", + "2. Set the $\\beta$ of the most impatient type to $0.80$ (for the copied set of agents).\n", + "3. Solve and simulate the most impatient type (for the copied set of agents)." + ] + }, + { + "cell_type": "code", + "execution_count": 10, + "metadata": {}, + "outputs": [ + { + "name": "stdout", + "output_type": "stream", + "text": [ + "The MPC at the 10th percentile of the distribution is 0.06\n", + "The MPC at the 50th percentile of the distribution is 0.20\n", + "The MPC at the 90th percentile of the distribution is 0.97\n" + ] + } + ], + "source": [ + "# Follow the instructions above to make another list of agents that includes *very* impatient households.\n", + "NewTypes = deepcopy(MyTypes)\n", + "NewTypes[0].DiscFac = 0.8\n", + "NewTypes[0].solve()\n", + "NewTypes[0].initializeSim()\n", + "NewTypes[0].simulate()\n", + "\n", + "# Retrieve the MPC's\n", + "percentiles=np.linspace(0.1,0.9,9)\n", + "MPC_sim = np.concatenate([ThisType.MPCnow for ThisType in NewTypes])\n", + "MPCpercentiles_quarterly = getPercentiles(MPC_sim,percentiles=percentiles)\n", + "MPCpercentiles_annual = 1.0 - (1.0 - MPCpercentiles_quarterly)**4\n", + "\n", + "print('The MPC at the 10th percentile of the distribution is '+str(decfmt2(MPCpercentiles_annual[0])))\n", + "print('The MPC at the 50th percentile of the distribution is '+str(decfmt2(MPCpercentiles_annual[4])))\n", + "print('The MPC at the 90th percentile of the distribution is '+str(decfmt2(MPCpercentiles_annual[-1])))" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "### PROBLEM\n", + "## Testing the Implications of Very Impatient Households\n", + "\n", + "Now that we have the baseline set of simulated agents (in $\\texttt{MyTypes}$) and the altered set of simulated agents (in whatever you named your copied version), let's investigate what this means for micro- and macroeconomic outcomes. In the code block below, use both lists of agents and the data tools you wrote above to investigate the following questions:\n", + "\n", + "1. Did introducing very impatient households generate a substantial proportion of hand-to-mouth households?\n", + " - Define 'hand to mouth' as households whose annual MPC is greater than 0.7\n", + "2. Did introducing very impatient households affect the simulated model's ability to match the empirical distribution of wealth and its aggregate level?\n", + "3. Much of the \"behavioral\" consumption literature concludes, when consumers are found to have very high MPC's, that the standard optimal consumption model \"doesn't work\" \n", + " * Given what you have found, can you reject the hypothesis that hand-to-mouth households arise in the data because they are very impatient?\n", + "\n", + "Use the markdown block below the code block to briefly answer those questions." + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "### PROBLEM -- Plot the new distribution of wealth\n", + "\n", + "The $\\texttt{matplotlib}$ library provides plotting functionality that replicates Matlab's plot features (more or less). As an example of how to use it, we have written a few lines of code that plot the empirical vs simulated Lorenz curves. Write some code that plots the CDF of the MPC before and after adding very impatient households, and plots the DIFFERENCES between the Lorenz curves across the two populations. Interpret the two graphs." + ] + } + ], + "metadata": { + "jupytext": { + "cell_metadata_filter": "collapsed,code_folding", + "formats": "ipynb,py:percent" + }, + "kernelspec": { + "display_name": "Python 3", + "language": "python", + "name": "python3" + }, + "language_info": { + "codemirror_mode": { + "name": "ipython", + "version": 3 + }, + "file_extension": ".py", + "mimetype": "text/x-python", + "name": "python", + "nbconvert_exporter": "python", + "pygments_lexer": "ipython3", + "version": "3.7.1" + }, + "latex_envs": { + "LaTeX_envs_menu_present": true, + "autoclose": false, + "autocomplete": true, + "bibliofile": "biblio.bib", + "cite_by": "apalike", + "current_citInitial": 1, + "eqLabelWithNumbers": true, + "eqNumInitial": 1, + "hotkeys": { + "equation": "Ctrl-E", + "itemize": "Ctrl-I" + }, + "labels_anchors": false, + "latex_user_defs": false, + "report_style_numbering": false, + "user_envs_cfg": false + }, + "varInspector": { + "cols": { + "lenName": 16, + "lenType": 16, + "lenVar": 40 + }, + "kernels_config": { + "python": { + "delete_cmd_postfix": "", + "delete_cmd_prefix": "del ", + "library": "var_list.py", + "varRefreshCmd": "print(var_dic_list())" + }, + "r": { + "delete_cmd_postfix": ") ", + "delete_cmd_prefix": "rm(", + "library": "var_list.r", + "varRefreshCmd": "cat(var_dic_list()) " + } + }, + "types_to_exclude": [ + "module", + "function", + "builtin_function_or_method", + "instance", + "_Feature" + ], + "window_display": false + } + }, + "nbformat": 4, + "nbformat_minor": 4 +} diff --git a/notebooks/Structural-Estimates-From-Empirical-MPCs-Fagereng-et-al-Problems-and-Solutions.ipynb b/notebooks/Structural-Estimates-From-Empirical-MPCs-Fagereng-et-al-Problems-and-Solutions.ipynb new file mode 100644 index 0000000..add8a63 --- /dev/null +++ b/notebooks/Structural-Estimates-From-Empirical-MPCs-Fagereng-et-al-Problems-and-Solutions.ipynb @@ -0,0 +1,670 @@ +{ + "cells": [ + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "# Making Structural Estimates From Empirical Results\n", + "\n", + "This notebook conducts a quick and dirty structural estimation based on Table 9 of \"MPC Heterogeneity and Household Balance Sheets\" by Fagereng, Holm, and Natvik , who use Norweigian administrative data on income, household assets, and lottery winnings to examine the MPC from transitory income shocks (lottery prizes). Their Table 9 reports an estimated MPC broken down by quartiles of bank deposits and\n", + "prize size; this table is reproduced here as $\\texttt{MPC_target_base}$. In this demo, we use the Table 9 estimates as targets in a simple structural estimation, seeking to minimize the sum of squared differences between simulated and estimated MPCs by changing the (uniform) distribution of discount factors. The essential question is how well their results be rationalized by a simple one-asset consumption-saving model. \n", + "\n", + "\n", + "The function that estimates discount factors includes several options for estimating different specifications:\n", + "\n", + "1. TypeCount : Integer number of discount factors in discrete distribution; can be set to 1 to turn off _ex ante_ heterogeneity (and to discover that the model has no chance to fit the data well without such heterogeneity).\n", + "2. AdjFactor : Scaling factor for the target MPCs; user can try to fit estimated MPCs scaled down by (e.g.) 50%.\n", + "3. T_kill : Maximum number of years the (perpetually young) agents are allowed to live. Because this is quick and dirty, it's also the number of periods to simulate.\n", + "4. Splurge : Amount of lottery prize that an individual will automatically spend in a moment of excitement (perhaps ancient tradition in Norway requires a big party when you win the lottery), before beginning to behave according to the optimal consumption function. The patterns in Table 9 can be fit much better when this is set around \\$700 --> 0.7. That doesn't seem like an unreasonable amount of money to spend on a memorable party.\n", + "5. do_secant : Boolean indicator for whether to use \"secant MPC\", which is average MPC over the range of the prize. MNW believes authors' regressions are estimating this rather than point MPC. When False, structural estimation uses point MPC after receiving prize. NB: This is incompatible with Splurge > 0.\n", + "6. drop_corner : Boolean for whether to include target MPC in the top left corner, which is greater than 1. Authors discuss reasons why the MPC from a transitory shock *could* exceed 1. Option is included here because this target tends to push the estimate around a bit." + ] + }, + { + "cell_type": "code", + "execution_count": 1, + "metadata": { + "code_folding": [ + 0 + ] + }, + "outputs": [], + "source": [ + "# Import python tools\n", + "\n", + "import sys\n", + "import os\n", + "\n", + "import numpy as np\n", + "from copy import deepcopy" + ] + }, + { + "cell_type": "code", + "execution_count": 2, + "metadata": { + "code_folding": [ + 0 + ] + }, + "outputs": [], + "source": [ + "# Import needed tools from HARK\n", + "\n", + "from HARK.utilities import approxUniform, getPercentiles\n", + "from HARK.parallel import multiThreadCommands\n", + "from HARK.estimation import minimizeNelderMead\n", + "from HARK.ConsumptionSaving.ConsIndShockModel import *\n", + "from HARK.cstwMPC.SetupParamsCSTW import init_infinite" + ] + }, + { + "cell_type": "code", + "execution_count": 3, + "metadata": { + "code_folding": [ + 0 + ] + }, + "outputs": [], + "source": [ + "# Set key problem-specific parameters\n", + "\n", + "TypeCount = 8 # Number of consumer types with heterogeneous discount factors\n", + "AdjFactor = 1.0 # Factor by which to scale all of MPCs in Table 9\n", + "T_kill = 100 # Don't let agents live past this age\n", + "Splurge = 0.0 # Consumers automatically spend this amount of any lottery prize\n", + "do_secant = True # If True, calculate MPC by secant, else point MPC\n", + "drop_corner = False # If True, ignore upper left corner when calculating distance" + ] + }, + { + "cell_type": "code", + "execution_count": 4, + "metadata": { + "code_folding": [ + 0 + ] + }, + "outputs": [], + "source": [ + "# Set standard HARK parameter values\n", + "\n", + "base_params = deepcopy(init_infinite)\n", + "base_params['LivPrb'] = [0.975]\n", + "base_params['Rfree'] = 1.04/base_params['LivPrb'][0]\n", + "base_params['PermShkStd'] = [0.1]\n", + "base_params['TranShkStd'] = [0.1]\n", + "base_params['T_age'] = T_kill # Kill off agents if they manage to achieve T_kill working years\n", + "base_params['AgentCount'] = 10000\n", + "base_params['pLvlInitMean'] = np.log(23.72) # From Table 1, in thousands of USD\n", + "base_params['T_sim'] = T_kill # No point simulating past when agents would be killed off" + ] + }, + { + "cell_type": "code", + "execution_count": 5, + "metadata": { + "code_folding": [ + 0 + ] + }, + "outputs": [], + "source": [ + "# Define the MPC targets from Fagereng et al Table 9; element i,j is lottery quartile i, deposit quartile j\n", + "\n", + "MPC_target_base = np.array([[1.047, 0.745, 0.720, 0.490],\n", + " [0.762, 0.640, 0.559, 0.437],\n", + " [0.663, 0.546, 0.390, 0.386],\n", + " [0.354, 0.325, 0.242, 0.216]])\n", + "MPC_target = AdjFactor*MPC_target_base" + ] + }, + { + "cell_type": "code", + "execution_count": 6, + "metadata": { + "code_folding": [ + 0 + ] + }, + "outputs": [], + "source": [ + "# Define the four lottery sizes, in thousands of USD; these are eyeballed centers/averages\n", + "\n", + "lottery_size = np.array([1.625, 3.3741, 7.129, 40.0])" + ] + }, + { + "cell_type": "code", + "execution_count": 7, + "metadata": { + "code_folding": [ + 0 + ], + "lines_to_next_cell": 1 + }, + "outputs": [], + "source": [ + "# Make several consumer types to be used during estimation\n", + "\n", + "BaseType = IndShockConsumerType(**base_params)\n", + "EstTypeList = []\n", + "for j in range(TypeCount):\n", + " EstTypeList.append(deepcopy(BaseType))\n", + " EstTypeList[-1](seed = j)" + ] + }, + { + "cell_type": "code", + "execution_count": 8, + "metadata": { + "code_folding": [ + 0 + ] + }, + "outputs": [], + "source": [ + "# Define the objective function\n", + "\n", + "def FagerengObjFunc(center,spread,verbose=False):\n", + " '''\n", + " Objective function for the quick and dirty structural estimation to fit\n", + " Fagereng, Holm, and Natvik's Table 9 results with a basic infinite horizon\n", + " consumption-saving model (with permanent and transitory income shocks).\n", + "\n", + " Parameters\n", + " ----------\n", + " center : float\n", + " Center of the uniform distribution of discount factors.\n", + " spread : float\n", + " Width of the uniform distribution of discount factors.\n", + " verbose : bool\n", + " When True, print to screen MPC table for these parameters. When False,\n", + " print (center, spread, distance).\n", + "\n", + " Returns\n", + " -------\n", + " distance : float\n", + " Euclidean distance between simulated MPCs and (adjusted) Table 9 MPCs.\n", + " '''\n", + " # Give our consumer types the requested discount factor distribution\n", + " beta_set = approxUniform(N=TypeCount,bot=center-spread,top=center+spread)[1]\n", + " for j in range(TypeCount):\n", + " EstTypeList[j](DiscFac = beta_set[j])\n", + "\n", + " # Solve and simulate all consumer types, then gather their wealth levels\n", + " multiThreadCommands(EstTypeList,['solve()','initializeSim()','simulate()','unpackcFunc()'])\n", + " WealthNow = np.concatenate([ThisType.aLvlNow for ThisType in EstTypeList])\n", + "\n", + " # Get wealth quartile cutoffs and distribute them to each consumer type\n", + " quartile_cuts = getPercentiles(WealthNow,percentiles=[0.25,0.50,0.75])\n", + " for ThisType in EstTypeList:\n", + " WealthQ = np.zeros(ThisType.AgentCount,dtype=int)\n", + " for n in range(3):\n", + " WealthQ[ThisType.aLvlNow > quartile_cuts[n]] += 1\n", + " ThisType(WealthQ = WealthQ)\n", + "\n", + " # Keep track of MPC sets in lists of lists of arrays\n", + " MPC_set_list = [ [[],[],[],[]],\n", + " [[],[],[],[]],\n", + " [[],[],[],[]],\n", + " [[],[],[],[]] ]\n", + "\n", + " # Calculate the MPC for each of the four lottery sizes for all agents\n", + " for ThisType in EstTypeList:\n", + " ThisType.simulate(1)\n", + " c_base = ThisType.cNrmNow\n", + " MPC_this_type = np.zeros((ThisType.AgentCount,4))\n", + " for k in range(4): # Get MPC for all agents of this type\n", + " Llvl = lottery_size[k]\n", + " Lnrm = Llvl/ThisType.pLvlNow\n", + " if do_secant:\n", + " SplurgeNrm = Splurge/ThisType.pLvlNow\n", + " mAdj = ThisType.mNrmNow + Lnrm - SplurgeNrm\n", + " cAdj = ThisType.cFunc[0](mAdj) + SplurgeNrm\n", + " MPC_this_type[:,k] = (cAdj - c_base)/Lnrm\n", + " else:\n", + " mAdj = ThisType.mNrmNow + Lnrm\n", + " MPC_this_type[:,k] = cAdj = ThisType.cFunc[0].derivative(mAdj)\n", + "\n", + " # Sort the MPCs into the proper MPC sets\n", + " for q in range(4):\n", + " these = ThisType.WealthQ == q\n", + " for k in range(4):\n", + " MPC_set_list[k][q].append(MPC_this_type[these,k])\n", + "\n", + " # Calculate average within each MPC set\n", + " simulated_MPC_means = np.zeros((4,4))\n", + " for k in range(4):\n", + " for q in range(4):\n", + " MPC_array = np.concatenate(MPC_set_list[k][q])\n", + " simulated_MPC_means[k,q] = np.mean(MPC_array)\n", + "\n", + " # Calculate Euclidean distance between simulated MPC averages and Table 9 targets\n", + " diff = simulated_MPC_means - MPC_target\n", + " if drop_corner:\n", + " diff[0,0] = 0.0\n", + " distance = np.sqrt(np.sum((diff)**2))\n", + " if verbose:\n", + " print(simulated_MPC_means)\n", + " else:\n", + " print (center, spread, distance)\n", + " return distance" + ] + }, + { + "cell_type": "code", + "execution_count": 9, + "metadata": { + "code_folding": [ + 0 + ] + }, + "outputs": [ + { + "name": "stdout", + "output_type": "stream", + "text": [ + "0.92 0.03 1.1274854942184123\n", + "0.9660000000000001 0.03 1.8595059870322312\n", + "0.92 0.0315 1.1283488603479197\n", + "0.874 0.0315 0.778255871453904\n", + "0.8280000000000001 0.03225 0.6819825156919915\n", + "0.8280000000000002 0.03075 0.6835548812203114\n", + "0.7360000000000001 0.033 0.7922890441302506\n", + "0.782 0.03225 0.7016715189874164\n", + "0.8740000000000001 0.03075 0.7788170641661598\n", + "0.805 0.031875 0.6805742675552975\n", + "0.8049999999999998 0.033375 0.6787844220096427\n", + "0.7934999999999997 0.03468750000000001 0.6852355238234841\n", + "0.7819999999999998 0.033 0.700889842861641\n", + "0.8165 0.0324375 0.677362729820926\n", + "0.8164999999999997 0.033937499999999995 0.6757164456766519\n", + "0.8222499999999997 0.03496874999999999 0.6758511425548946\n", + "0.8279999999999997 0.03299999999999999 0.6811133592390257\n", + "0.8107499999999999 0.03328125 0.676894640632367\n", + "0.8107499999999996 0.03478124999999999 0.6750631689086809\n", + "0.8078749999999992 0.03595312499999999 0.6744239196038181\n", + "0.8136249999999989 0.036609374999999986 0.6724284249651289\n", + "0.8150624999999985 0.03827343749999998 0.6703322941257293\n", + "0.806437499999998 0.04028906249999997 0.6692403829292708\n", + "0.8014062499999974 0.043464843749999954 0.6673189410747502\n", + "0.8085937499999967 0.045785156249999945 0.6604269189061285\n", + "0.8089531249999955 0.05070117187499992 0.65272712055137\n", + "0.7952968749999945 0.0558925781249999 0.6531048166528524\n", + "0.8028437499999925 0.06312890624999987 0.6352275674142442\n", + "0.8035624999999902 0.07296093749999982 0.6174053756797356\n", + "0.8172187499999912 0.06776953124999985 0.623279644640036\n", + "0.8118281249999859 0.09002929687499975 0.5843314701962605\n", + "0.813265624999981 0.10969335937499966 0.5516622208832312\n", + "0.79960937499998 0.11488476562499964 0.5453880007399536\n", + "0.7908046874999743 0.13844238281249954 0.5163269956570604\n", + "0.8005078124999652 0.17517480468749938 0.5499092597796972\n", + "0.7780468749999585 0.20392382812499923 0.5813614142333464\n", + "0.8044609374999754 0.13325097656249957 0.5202086128131443\n", + "0.7947578124999846 0.09651855468749973 0.5805560040839527\n", + "0.7990703124999701 0.15551074218749947 0.5060419354103581\n", + "0.785414062499969 0.16070214843749947 0.5034386878700592\n", + "0.775890624999966 0.17442773437499942 0.5149023099777296\n", + "0.7936796874999648 0.17777050781249937 0.5315857186141032\n", + "0.791523437499972 0.1482744140624995 0.5061530602276895\n", + "0.7929609374999671 0.1679384765624994 0.5082715311300752\n", + "0.7918828124999708 0.15319042968749946 0.5033949436309413\n", + "0.7782265624999698 0.15838183593749947 0.512748835721533\n", + "0.7938593749999701 0.15622851562499945 0.5028877731574135\n", + "0.8003281249999719 0.14871679687499945 0.5068348206273852\n", + "0.7891425781249697 0.15770581054687446 0.502519441768042\n", + "0.7911191406249689 0.16074389648437443 0.5022974415782882\n", + "0.7907373046874677 0.1645206298828119 0.5032698407410588\n", + "0.7864023437499685 0.1622211914062494 0.5027664061147642\n", + "0.7882666015624689 0.16072302246093692 0.502198620174269\n", + "0.7902431640624681 0.16376110839843686 0.5026328874780666\n", + "0.7894177246093443 0.15921963500976505 0.5021703660917155\n", + "0.7865651855468443 0.15919876098632751 0.5030573631478745\n", + "0.7899806518554378 0.1603576126098627 0.502160531034932\n", + "0.7911317749023132 0.15885422515869083 0.5022769519932859\n", + "0.78898289489743 0.1602558231353754 0.502180579074867\n", + "0.7904154815673521 0.15932142448425235 0.5021833317477105\n", + "0.7893410415649105 0.16002222347259465 0.5021165086178974\n", + "0.7899039688110039 0.1611602010726923 0.5021112183082238\n", + "0.7901470909118338 0.16213048410415593 0.5022990867023371\n", + "0.7892643585204766 0.16082481193542425 0.502159403561549\n", + "0.7894434318542168 0.16070801210403385 0.5021404531991109\n", + "0.7898015785216975 0.1604744124412531 0.50213329203524\n", + "0.7897120418548274 0.16053281235694827 0.5021302497927074\n", + "0.789532968521087 0.16064961218833868 0.5021304652782825\n", + "0.7896672735213923 0.1605620123147959 0.502126210894908\n", + "0.789577736854522 0.16062041223049106 0.5021314791648644\n", + "0.7896448893546748 0.16057661229371967 0.5021356844024427\n", + "0.7896225051879572 0.16059121227264347 0.5021256061827057\n", + "0.7897856211661981 0.1608611066937441 0.5021324277978072\n", + "0.7897408528327629 0.16089030665159165 0.5021362355798749\n", + "0.7897744290828392 0.16086840668320598 0.5021389064710859\n", + "0.7897632369994805 0.16087570667266787 0.502129658550051\n", + "0.7898447949886009 0.1610106538832182 0.5021074951519786\n", + "0.7899855268001243 0.1612951482832426 0.5021245728056754\n", + "0.7899299543499633 0.16119028788059891 0.5021135412553295\n", + "0.7898188094496416 0.16098056707531155 0.5021025392131131\n", + "0.7897632369994805 0.16087570667266787 0.502129658550051\n", + "0.7897596356272387 0.16083101988583742 0.5021341894826656\n", + "0.7898678855150626 0.16107790577597858 0.5021133757712383\n", + "0.7898318022191213 0.16099561047926486 0.5021068384032057\n", + "0.7898613891303228 0.16107038407400193 0.5021036662483996\n", + "Optimization terminated successfully.\n", + " Current function value: 0.502103\n", + " Iterations: 41\n", + " Function evaluations: 85\n", + "Time to estimate is 126.31276273727417 seconds.\n", + "Finished estimating for scaling factor of 1.0 and \"splurge amount\" of $0.0\n", + "Optimal (beta,nabla) is [0.78981881 0.16098057], simulated MPCs are:\n", + "[[0.77361336 0.68317127 0.56461082 0.40476962]\n", + " [0.74354975 0.66482752 0.55301552 0.39626053]\n", + " [0.70353353 0.63512154 0.5305429 0.3793119 ]\n", + " [0.5613238 0.50428804 0.4125933 0.29261249]]\n", + "Distance from Fagereng et al Table 9 is 0.5021025392131131\n" + ] + } + ], + "source": [ + "# Conduct the estimation\n", + "\n", + "guess = [0.92,0.03]\n", + "f_temp = lambda x : FagerengObjFunc(x[0],x[1])\n", + "opt_params = minimizeNelderMead(f_temp, guess, verbose=True)\n", + "print('Finished estimating for scaling factor of ' + str(AdjFactor) + ' and \"splurge amount\" of $' + str(1000*Splurge))\n", + "print('Optimal (beta,nabla) is ' + str(opt_params) + ', simulated MPCs are:')\n", + "dist = FagerengObjFunc(opt_params[0],opt_params[1],True)\n", + "print('Distance from Fagereng et al Table 9 is ' + str(dist))" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "### PROBLEM\n", + "\n", + "See what happens if you do not allow a splurge amount at all. Hint: Think about how this question relates to the `drop_corner` option.\n", + "\n", + "Explain why you get the results you do, and comment on possible interpretations of the \"splurge\" that might be consistent with economic theory. \n", + "Hint: What the authors are able to measure is actually the marginal propensity to EXPEND, not the marginal propensity to CONSUME as it is defined in our benchmark model." + ] + }, + { + "cell_type": "code", + "execution_count": null, + "metadata": {}, + "outputs": [], + "source": [ + "# Put your solution here" + ] + }, + { + "cell_type": "code", + "execution_count": null, + "metadata": {}, + "outputs": [], + "source": [ + "My solution may be a little bit lost, but it seems that splurge is off by default in this notebook. Here is the result that I get:\n", + "\n", + "Optimization terminated successfully.\n", + " Current function value: 0.502103\n", + " Iterations: 41\n", + " Function evaluations: 85\n", + "Time to estimate is 126.31276273727417 seconds.\n", + "Finished estimating for scaling factor of 1.0 and \"splurge amount\" of $0.0\n", + "Optimal (beta,nabla) is [0.78981881 0.16098057], simulated MPCs are:\n", + "[[0.77361336 0.68317127 0.56461082 0.40476962]\n", + " [0.74354975 0.66482752 0.55301552 0.39626053]\n", + " [0.70353353 0.63512154 0.5305429 0.3793119 ]\n", + " [0.5613238 0.50428804 0.4125933 0.29261249]]\n", + "Distance from Fagereng et al Table 9 is 0.5021025392131131" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "### PROBLEM\n", + "\n", + "Call the _Marginal Propensity to Continue Consuming_ (MPCC) in year `t+n` the proportion of lottery winnings that get spent in year `t+n`. That is, if consumption is higher in year `t+2` by an amount corresponding to 14 percent of lottery winnings, we would say _the MPCC in t+2 is 14 percent.\n", + "\n", + "For the baseline version of the model with the \"splurge\" component, calculate the MPCC's for years `t+1` through `t+3` and plot them together with the MPC in the first year (including the splurge component)\n" + ] + }, + { + "cell_type": "code", + "execution_count": 10, + "metadata": {}, + "outputs": [ + { + "name": "stdout", + "output_type": "stream", + "text": [ + "0.92 0.03 0.5995682664167464\n", + "0.9660000000000001 0.03 1.130526413517784\n", + "0.92 0.0315 0.597671310092481\n", + "0.874 0.0315 0.5061650143812053\n", + "0.8280000000000001 0.03225 0.59981841411314\n", + "0.874 0.033 0.5035549531897446\n", + "0.8509999999999998 0.0345 0.5408387132488528\n", + "0.828 0.033 0.5989885580694853\n", + "0.897 0.031875 0.5054741189538555\n", + "0.8969999999999999 0.033375 0.5028620312472362\n", + "0.9084999999999999 0.034312499999999996 0.5326596368122481\n", + "0.8739999999999999 0.0345 0.5010726235732905\n", + "0.8624999999999998 0.0358125 0.5159409531795565\n", + "0.8969999999999999 0.034875 0.5003131242372941\n", + "0.9084999999999999 0.0358125 0.5304329762718867\n", + "0.874 0.036000000000000004 0.4985021346052793\n", + "0.8625 0.0373125 0.5134811834621759\n", + "0.897 0.036375000000000005 0.49782654092459505\n", + "0.9085000000000001 0.0373125 0.5279457638988614\n", + "0.874 0.037500000000000006 0.49560211522901404\n", + "0.8625 0.0388125 0.5109296661011822\n", + "0.8969999999999999 0.037875000000000006 0.4953943097975099\n", + "0.9084999999999999 0.0388125 0.5254650016449012\n", + "0.8739999999999999 0.03900000000000001 0.4928661374412297\n", + "0.8624999999999998 0.0403125 0.5082181205250403\n", + "0.8969999999999999 0.03937500000000001 0.49261141421460813\n", + "0.9084999999999999 0.0403125 0.5229681951789342\n", + "0.874 0.04050000000000001 0.48990861824633103\n", + "0.8625 0.0418125 0.5054686921656505\n", + "0.897 0.04087500000000001 0.4897110830606013\n", + "0.9085000000000001 0.0418125 0.5206171732175974\n", + "0.874 0.04200000000000001 0.4868678763226638\n", + "0.8625 0.043312500000000004 0.5027419379790272\n", + "0.8969999999999999 0.04237500000000001 0.4867799205038012\n", + "0.9084999999999999 0.043312500000000004 0.5182456286742236\n", + "0.8739999999999999 0.04350000000000001 0.4836179483109191\n", + "0.8624999999999998 0.044812500000000005 0.4997959307968112\n", + "0.8969999999999999 0.04387500000000001 0.48391374677589316\n", + "0.874 0.04500000000000001 0.4804747025071423\n", + "0.8625 0.046312500000000006 0.4966828724861714\n", + "0.8509999999999999 0.04462500000000001 0.5249102262601493\n", + "0.8855 0.04406250000000001 0.4745011083246477\n", + "0.8855000000000002 0.045562500000000006 0.4711703088748082\n", + "0.8912500000000003 0.04659374999999999 0.4712069648454334\n", + "0.8970000000000001 0.044625 0.48250328061785325\n", + "0.87975 0.04490625000000001 0.47485016047918316\n", + "0.8912500000000001 0.04471875 0.4753090436510006\n", + "0.882625 0.04485937500000001 0.4731625674865742\n", + "0.8826250000000002 0.046359375 0.46990234746404624\n", + "0.8811875000000002 0.04750781250000001 0.4682060500297226\n", + "0.8840625000000004 0.04821093750000001 0.46552706600412597\n", + "0.8847812500000005 0.04988671875 0.4614849107211036\n", + "0.8804687500000006 0.05183203125000001 0.4587794115882465\n", + "0.8779531250000008 0.054966796875 0.4532504175932726\n", + "0.8815468750000011 0.057345703124999994 0.44528242773692\n", + "0.8817265625000017 0.062264648437499986 0.43316579519004766\n", + "0.874898437500002 0.06734472656249998 0.42544348619001787\n", + "0.8699570312500029 0.07607373046874999 0.41038006500623064\n", + "0.8737304687500038 0.08337158203124997 0.389602904190066\n", + "0.8716191406250053 0.09757397460937495 0.37378241496389153\n", + "0.8598496093750065 0.11138305664062495 0.36345383861881203\n", + "0.8489111328125087 0.13594226074218746 0.3694789582686576\n", + "0.861511718750009 0.1328833007812499 0.37989380462316574\n", + "0.8636230468750075 0.11868090820312494 0.36773446425460327\n", + "0.8518535156250087 0.13248999023437494 0.36769421247153705\n", + "0.8480800781250077 0.12519213867187495 0.36700452993776067\n", + "0.8560761718750056 0.10408520507812496 0.37158964315708626\n", + "0.8529091796875079 0.12538879394531244 0.36475519633421577\n", + "0.8646787109375067 0.11157971191406243 0.3661528020588679\n", + "0.8605290527343821 0.11498281860351556 0.36346451782428607\n", + "0.8674694824218807 0.10097708129882807 0.3690240850073766\n", + "0.8565492553711012 0.11928586578369135 0.363197637473252\n", + "0.8558698120117256 0.11568610382080075 0.3632247653230306\n", + "0.8525694580078202 0.12358891296386715 0.3643221082309368\n", + "0.85802957153321 0.1144345207214355 0.36318421061962464\n", + "0.8587090148925856 0.11803428268432611 0.3636342492056962\n", + "0.8565796127319406 0.11627314853668208 0.3629579296434173\n", + "0.8580599288940494 0.11142180347442623 0.36345993938033083\n", + "0.8569269237518382 0.11731985020637507 0.362981559594337\n", + "0.8554769649505689 0.11915847802162166 0.36309071263773696\n", + "0.8561151165962292 0.11797748869657512 0.36307848933312065\n", + "0.8573914198875497 0.11561551004648205 0.3628977587035381\n", + "0.85802957153321 0.1144345207214355 0.36318421061962464\n", + "0.8570441088676521 0.11456880837678905 0.36320326891199617\n", + "0.8569562200307916 0.11663208974897857 0.3629331688947342\n", + "0.8577680271864009 0.11597445125877853 0.3629529003227922\n", + "0.8574709235727858 0.11604912557825442 0.36296570158998215\n", + "0.8571738199591707 0.1161237998977303 0.3628885768049734\n", + "0.8569855163097452 0.11594432929158206 0.36290871163945315\n", + "0.8575797235369754 0.11579498065263029 0.3628991743687462\n", + "0.8574311717301679 0.11583231781236825 0.36289209646855536\n", + "0.8572135718017889 0.11634060766361651 0.36285448552494814\n", + "0.8571246477589087 0.11670315647218371 0.36292638525593796\n", + "0.8569562200307916 0.11663208974897857 0.3629331688947342\n", + "0.8573124338053238 0.11603226079652082 0.36292845814650454\n", + "0.8571936958804798 0.11623220378067341 0.362886522731231\n", + "0.8573223717659784 0.11608646273799238 0.36293972327882507\n", + "0.8570848959162904 0.11648634870629755 0.36288574097077114\n", + "0.8571047718375995 0.11659475258924067 0.3629220894769194\n", + "0.8571714648697597 0.11632284098281523 0.362879219537611\n", + "0.8573001407552581 0.11617709994013418 0.3628803869484818\n", + "0.8572463295455162 0.11625441213167503 0.36289141664014485\n", + "0.8571925183357743 0.11633172432321587 0.362865660770145\n", + "0.8571492338590396 0.11641347818495704 0.36288078998470197\n", + "Optimization terminated successfully.\n", + " Current function value: 0.362854\n", + " Iterations: 51\n", + " Function evaluations: 104\n", + "Time to estimate is 168.52163887023926 seconds.\n", + "Finished estimating for scaling factor of 1.0 and \"splurge amount\" of $700.0\n", + "Optimal (beta,nabla) is [0.85721357 0.11634061], simulated MPCs are:\n", + "[[0.78125074 0.74901398 0.69774099 0.57004272]\n", + " [0.68171547 0.6409357 0.5710499 0.3972561 ]\n", + " [0.61000431 0.57033915 0.49325371 0.30493686]\n", + " [0.43831495 0.41055401 0.34400477 0.19399841]]\n", + "Distance from Fagereng et al Table 9 is 0.36285448552494814\n" + ] + } + ], + "source": [ + "# Baseline model with splurge\n", + "\n", + "# Now we enable the splurge by setting splurge to the suggested value of 0.7\n", + "Splurge = 0.7\n", + "\n", + "guess = [0.92,0.03]\n", + "f_temp = lambda x : FagerengObjFunc(x[0],x[1])\n", + "opt_params = minimizeNelderMead(f_temp, guess, verbose=True)\n", + "print('Finished estimating for scaling factor of ' + str(AdjFactor) + ' and \"splurge amount\" of $' + str(1000*Splurge))\n", + "print('Optimal (beta,nabla) is ' + str(opt_params) + ', simulated MPCs are:')\n", + "dist = FagerengObjFunc(opt_params[0],opt_params[1],True)\n", + "print('Distance from Fagereng et al Table 9 is ' + str(dist))" + ] + }, + { + "cell_type": "code", + "execution_count": null, + "metadata": {}, + "outputs": [], + "source": [ + "# Still need to add the t+n MPCs and plot them" + ] + } + ], + "metadata": { + "cite2c": { + "citations": { + "6202365/SUE56C4B": { + "author": [ + { + "family": "Fagereng", + "given": "Andreas" + }, + { + "family": "Holm", + "given": "Martin B." + }, + { + "family": "Natvik", + "given": "Gisle J." + } + ], + "genre": "discussion paper", + "id": "6202365/SUE56C4B", + "issued": { + "year": 2017 + }, + "publisher": "Statistics Norway", + "title": "MPC Heterogeneity and Household Balance Sheets", + "type": "report" + } + } + }, + "jupytext": { + "cell_metadata_filter": "collapsed,code_folding", + "formats": "ipynb,py:percent" + }, + "kernelspec": { + "display_name": "Python 3", + "language": "python", + "name": "python3" + }, + "language_info": { + "codemirror_mode": { + "name": "ipython", + "version": 3 + }, + "file_extension": ".py", + "mimetype": "text/x-python", + "name": "python", + "nbconvert_exporter": "python", + "pygments_lexer": "ipython3", + "version": "3.7.1" + }, + "varInspector": { + "cols": { + "lenName": 16, + "lenType": 16, + "lenVar": 40 + }, + "kernels_config": { + "python": { + "delete_cmd_postfix": "", + "delete_cmd_prefix": "del ", + "library": "var_list.py", + "varRefreshCmd": "print(var_dic_list())" + }, + "r": { + "delete_cmd_postfix": ") ", + "delete_cmd_prefix": "rm(", + "library": "var_list.r", + "varRefreshCmd": "cat(var_dic_list()) " + } + }, + "types_to_exclude": [ + "module", + "function", + "builtin_function_or_method", + "instance", + "_Feature" + ], + "window_display": false + } + }, + "nbformat": 4, + "nbformat_minor": 4 +}