Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
41 changes: 10 additions & 31 deletions examples/ConsWealthUtilityModel/WealthUtilityConsumerType.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@
"\n",
"The typical consumption-saving model assumes that agents derive a flow of utility from consumption each period, with additively separable utility across time. In `HARK.ConsumptionSaving.ConsWealthUtility` module, we change this assumption to allow wealth (end-of-period assets) to enter the agent's utility function directly.\n",
"\n",
"This notebook concerns agents whose direct preferences for wealth are represented *multiplicatively* with consumption under a Cobb-Douglas aggregator. For *additive* direct preferences for wealth, see [the notebook for `CapitalistSpiritConsumerType`](./CapitalistSpiritConsumerType.ipynb) in the same module."
"This notebook concerns agents whose direct preferences for wealth are represented *multiplicatively* with consumption under a Cobb-Douglas aggregator. For *additive* direct preferences for wealth, see [the notebook](./CapitalistSpiritConsumerType.ipynb) for `CapitalistSpiritConsumerType` in the same module."
]
},
{
Expand Down Expand Up @@ -37,7 +37,7 @@
},
{
"cell_type": "markdown",
"id": "7fe39fa7",
"id": "6dea0dcf-dbfc-4743-af71-845221884b71",
"metadata": {},
"source": [
"$$\n",
Expand All @@ -64,23 +64,16 @@
"\n",
"A `WealthUtilityConsumerType`'s problem can be expressed as:\n",
"\n",
"$$\n",
"\\begin{equation*}\n",
" v_t(m_t) = \\max_{c_t}u(x_t) + \\DiscFac \\LivPrb_{t} \\mathbb{E}_{t} \\left[ (\\PermGroFac_{t+1} \\psi_{t+1})^{1-\\CRRA} v_{t+1}(m_{t+1}) \\right] ~~\\text{s.t.}\n",
"\\end{equation*}\n",
"$$\n",
"\n",
"$$\n",
"\\begin{eqnarray*}\n",
" v_t(m_t) &=& \\max_{c_t}u(x_t) + \\DiscFac \\LivPrb_{t} \\mathbb{E}_{t} \\left[ (\\PermGroFac_{t+1} \\psi_{t+1})^{1-\\CRRA} v_{t+1}(m_{t+1}) \\right] ~~\\text{s.t.} \\\\\n",
" u(x) &=& \\frac{x^{1-\\CRRA}}{1-\\CRRA}, \\\\\n",
" x_t &=& (a_t + \\WealthShift)^\\WealthShare c_t^{1-\\WealthShare}, \\\\\n",
" a_t &=& m_t - c_t, \\\\\n",
" a_t &\\geq& \\underline{a}, \\\\\n",
" m_{t+1} &=& a_t \\Rfree_{t+1}/(\\PermGroFac_{t+1} \\psi_{t+1}) + \\theta_{t+1}, \\\\\n",
" (\\psi_{t+1},\\theta_{t+1}) &\\sim& F_{t+1}, \\\\\n",
" \\mathbb{E}[\\psi] &=& 1. \\\\\n",
"\\end{eqnarray*}\n",
"$$\n"
"\\end{eqnarray*}\n"
]
},
{
Expand All @@ -106,12 +99,10 @@
"\n",
"In the standard consumption-saving model with CRRA utility over consumption only, the first order condition w.r.t consumption is trivial to invert; this is not the case when consumption and wealth are multiplicatively combined into a single term in the CRRA function. To start, we substitute the Cobb-Douglas aggregator into the CRRA utility function:\n",
"\n",
"$$\n",
"\\begin{eqnarray*}\n",
"u(\\cNrm, \\aNrm) &=& \\frac{\\left(\\cNrm^{1-\\WealthShare}(\\aNrm+\\WealthShift)^{\\WealthShare}\\right)^{1-\\CRRA}}{1-\\CRRA} \\\\\n",
"&=& \\frac{\\left(\\cNrm^{1-\\WealthShare}(\\mNrm - \\cNrm + \\WealthShift)^{\\WealthShare}\\right)^{1-\\CRRA}}{1-\\CRRA}.\n",
"\\end{eqnarray*}\n",
"$$\n"
"\\end{eqnarray*}\n"
]
},
{
Expand All @@ -121,14 +112,12 @@
"source": [
"Fixing market resources $\\mNrm$ at some value of interest, the marginal return to utility from consumption is:\n",
"\n",
"$$\n",
"\\begin{align*}\n",
"\\frac{\\text{d}}{\\text{d} \\cNrm} u(\\cNrm, \\mNrm-\\cNrm) &= \\left[ (1-\\WealthShare) \\cNrm^{-\\WealthShare} (\\mNrm - \\cNrm + \\WealthShift)^\\WealthShare - \\WealthShare \\cNrm^{1-\\WealthShare}(\\mNrm - \\cNrm + \\WealthShift)^{\\WealthShare-1} \\right] \\cdot \\left( (\\mNrm - \\cNrm + \\WealthShift)^\\WealthShare \\cNrm^{1-\\WealthShare} \\right)^{-\\CRRA} \\\\\n",
" &= \\left[ (1-\\WealthShare) \\left(\\frac{\\cNrm}{\\mNrm-\\cNrm + \\WealthShift}\\right)^{-\\WealthShare} - \\WealthShare \\left(\\frac{\\cNrm}{\\mNrm - \\cNrm + \\WealthShift} \\right)^{1-\\WealthShare} \\right] \\cdot \\left( (\\mNrm - \\cNrm + \\WealthShift)^\\WealthShare \\cNrm^{1-\\WealthShare} \\right)^{-\\CRRA} \\\\\n",
" &= \\left[ (1-\\WealthShare) \\left(\\frac{\\cNrm}{\\aNrm + \\WealthShift}\\right)^{-\\WealthShare} - \\WealthShare \\left(\\frac{\\cNrm}{\\aNrm + \\WealthShift} \\right)^{1-\\WealthShare} \\right] \\cdot \\left( (\\aNrm + \\WealthShift) (\\aNrm + \\WealthShift)^{\\WealthShare-1} \\cNrm^{1-\\WealthShare} \\right)^{-\\CRRA} \\\\\n",
" &= \\left[ (1-\\WealthShare) \\chi^{-\\WealthShare} - \\WealthShare \\chi^{1-\\WealthShare} \\right] \\cdot \\left( (\\aNrm + \\WealthShift) \\chi^{1-\\WealthShare} \\right)^{-\\CRRA}, ~~~~ \\chi \\equiv \\frac{\\cNrm}{\\aNrm + \\WealthShift}.\n",
"\\end{align*}\n",
"$$\n"
"\\end{align*}\n"
]
},
{
Expand All @@ -154,25 +143,19 @@
"source": [
"Consider the first order condition for optimality by taking the derivative of the maximand with respect to $\\cNrm$ and equating it to zero:\n",
"\n",
"$$\n",
"\\begin{equation}\n",
"\\frac{\\text{d}}{\\text{d} \\cNrm} u(\\cNrm_t, \\mNrm_t-\\cNrm_t) - \\mathfrak{v}'_t(\\mNrm_t - \\cNrm_t) = 0.\n",
"\\end{equation}\n",
"$$\n",
"\n",
"We can substitute the final form of the marginal return to consumption, move the second term to the right-hand side, and then rearrange slightly to get:\n",
"\n",
"$$\n",
"\\begin{equation*}\n",
"\\left[ (1-\\WealthShare) \\chi_t^{-\\WealthShare} - \\WealthShare \\chi_t^{1-\\WealthShare} \\right] \\cdot \\left( (\\aNrm_t + \\WealthShift) \\chi_t^{1-\\WealthShare} \\right)^{-\\CRRA} = \\mathfrak{v}'_t(\\aNrm_t) \\Longrightarrow\n",
"\\end{equation*}\n",
"$$\n",
"\n",
"$$\n",
"\\begin{equation*}\n",
"\\left[ (1-\\WealthShare) \\chi_t^{-\\WealthShare} - \\WealthShare \\chi_t^{1-\\WealthShare} \\right]^{-1/\\CRRA} \\cdot \\chi_t^{1-\\WealthShare} = \\underbrace{\\mathfrak{v}'_t(\\aNrm_t)^{-1/\\CRRA} / (\\aNrm_t + \\WealthShift)}_{\\equiv ~ \\omega_t}.\n",
"\\end{equation*}\n",
"$$\n"
"\\end{equation*}\n"
]
},
{
Expand All @@ -192,19 +175,15 @@
"source": [
"First, note that the expression in square brackets is not positive for all values of $\\chi > 0$, with the bounding condition defined by:\n",
"\n",
"$$\n",
"\\begin{equation*}\n",
"(1-\\WealthShare) \\chi^{-\\WealthShare} - \\WealthShare \\chi^{1-\\WealthShare} > 0 \\Longrightarrow (1-\\WealthShare) \\chi^{-\\WealthShare} > \\WealthShare \\chi^{1-\\WealthShare} \\Longrightarrow \\frac{1-\\WealthShare}{\\WealthShare} >\\chi.\n",
"\\end{equation*}\n",
"$$\n",
"\n",
"The expression in square brackets is raised to a negative power, hence we need only to consider values of $\\chi \\in (0, (1 -\\WealthShare)/\\WealthShare)$. These $\\chi$ values represent the *range* of the function that maps from $\\omega$ to $\\chi$, and we want our constructed approximation to cover as much of that range as possible. To do so, we will use the logit transformation to map from an auxiliary variable $z \\in \\R$ to $\\chi \\in (0, (1 -\\WealthShare)/\\WealthShare)$:\n",
"\n",
"$$\n",
"\\begin{equation*}\n",
"\\chi = \\frac{\\exp(z)}{1 + \\exp(z)} \\cdot \\frac{1-\\WealthShare}{\\WealthShare}.\n",
"\\end{equation*}\n",
"$$\n"
"\\end{equation*}\n"
]
},
{
Expand Down Expand Up @@ -335,7 +314,7 @@
"name": "stdout",
"output_type": "stream",
"text": [
"Solving a wealth-in-utility consumption-saving problem took 0.1080 seconds.\n"
"Solving a wealth-in-utility consumption-saving problem took 0.1052 seconds.\n"
]
}
],
Expand Down Expand Up @@ -407,7 +386,7 @@
"name": "stdout",
"output_type": "stream",
"text": [
"Solving a standard consumption-saving problem took 0.1040 seconds.\n"
"Solving a standard consumption-saving problem took 0.1050 seconds.\n"
]
}
],
Expand Down
Loading