Skip to content

Commit

Permalink
deploy: 794b211
Browse files Browse the repository at this point in the history
  • Loading branch information
MridulS committed Dec 13, 2023
1 parent b54c307 commit 80a5525
Show file tree
Hide file tree
Showing 8 changed files with 54 additions and 54 deletions.
40 changes: 20 additions & 20 deletions notebooks/DCEGM-Upper-Envelope.html
Original file line number Diff line number Diff line change
Expand Up @@ -666,26 +666,26 @@ <h1>The third (last) period of life<a class="headerlink" href="#the-third-last-p
<section id="the-agent-without-a-will">
<h2>The agent without a will<a class="headerlink" href="#the-agent-without-a-will" title="Permalink to this heading">#</a></h2>
<p>An agent who does not have a will simply consumes all of his available resources. Therefore, his value and consumption functions will be:</p>
<div class="amsmath math notranslate nohighlight" id="equation-0b6d6ea2-f1f5-4847-aac7-0f79f1104585">
<span class="eqno">(1)<a class="headerlink" href="#equation-0b6d6ea2-f1f5-4847-aac7-0f79f1104585" title="Permalink to this equation">#</a></span>\[\begin{equation}
<div class="amsmath math notranslate nohighlight" id="equation-9c9c0c92-bba6-477d-93e8-44cd15088eba">
<span class="eqno">(1)<a class="headerlink" href="#equation-9c9c0c92-bba6-477d-93e8-44cd15088eba" title="Permalink to this equation">#</a></span>\[\begin{equation}
V_3(m_3,W=0) = u(m_3)
\end{equation}\]</div>
<div class="amsmath math notranslate nohighlight" id="equation-a77c76fc-5c65-45b5-9a58-397859e110d6">
<span class="eqno">(2)<a class="headerlink" href="#equation-a77c76fc-5c65-45b5-9a58-397859e110d6" title="Permalink to this equation">#</a></span>\[\begin{equation}
<div class="amsmath math notranslate nohighlight" id="equation-5484cb69-b98b-4f21-928b-20fe72e4abb5">
<span class="eqno">(2)<a class="headerlink" href="#equation-5484cb69-b98b-4f21-928b-20fe72e4abb5" title="Permalink to this equation">#</a></span>\[\begin{equation}
c_3(m_3, W=0) = m_3
\end{equation}\]</div>
<p>Where <span class="math notranslate nohighlight">\(u(\cdot)\)</span> gives the utility from consumption. We assume a CRRA specification <span class="math notranslate nohighlight">\(u(c) = \frac{c^{1-\rho}}{1-\rho}\)</span>.</p>
</section>
<section id="the-agent-with-a-will">
<h2>The agent with a will<a class="headerlink" href="#the-agent-with-a-will" title="Permalink to this heading">#</a></h2>
<p>An agent who wrote a will decides how to allocate his available resources <span class="math notranslate nohighlight">\(m_3\)</span> between his consumption and a bequest. We assume an additive specification for the utility of a given consumption-bequest combination that follows a particular case in <a class="reference external" href="http://www.econ2.jhu.edu/people/ccarroll/Why.pdf">Carroll (2000)</a>. The component of utility from leaving a bequest <span class="math notranslate nohighlight">\(x\)</span> is assumed to be <span class="math notranslate nohighlight">\(\ln (x+1)\)</span>. Therefore, the agent’s value function is</p>
<div class="amsmath math notranslate nohighlight" id="equation-19a925e8-0362-4809-a854-09434a2383a3">
<span class="eqno">(3)<a class="headerlink" href="#equation-19a925e8-0362-4809-a854-09434a2383a3" title="Permalink to this equation">#</a></span>\[\begin{equation}
<div class="amsmath math notranslate nohighlight" id="equation-49d34bb1-ad97-427d-98ab-28610951eba0">
<span class="eqno">(3)<a class="headerlink" href="#equation-49d34bb1-ad97-427d-98ab-28610951eba0" title="Permalink to this equation">#</a></span>\[\begin{equation}
V_3(m_3, W=1) = \max_{0\leq c_3 \leq m_3} u(c_3) + \ln(m_3 - c_3 + 1)
\end{equation}\]</div>
<p>For ease of exposition we consider the case <span class="math notranslate nohighlight">\(\rho = 2\)</span>, where <a class="reference external" href="http://www.econ2.jhu.edu/people/ccarroll/Why.pdf">Carroll (2000)</a> shows that the optimal consumption level is given by</p>
<div class="amsmath math notranslate nohighlight" id="equation-2383fda0-952d-418f-af63-485350b76108">
<span class="eqno">(4)<a class="headerlink" href="#equation-2383fda0-952d-418f-af63-485350b76108" title="Permalink to this equation">#</a></span>\[\begin{equation}
<div class="amsmath math notranslate nohighlight" id="equation-9d03e530-6d31-4994-8838-4c0175d20cd6">
<span class="eqno">(4)<a class="headerlink" href="#equation-9d03e530-6d31-4994-8838-4c0175d20cd6" title="Permalink to this equation">#</a></span>\[\begin{equation}
c_3(m_3, W=1) = \min \left[m_3, \frac{-1 + \sqrt{1 + 4(m_3+1)}}{2} \right].
\end{equation}\]</div>
<p>The consumption function shows that <span class="math notranslate nohighlight">\(m_3=1\)</span> is the level of resources at which an important change of behavior occurs: agents leave bequests only for <span class="math notranslate nohighlight">\(m_3 &gt; 1\)</span>. Since an important change of behavior happens at this point, we call it a ‘kink-point’ and add it to our grids.</p>
Expand Down Expand Up @@ -774,8 +774,8 @@ <h1>The second period<a class="headerlink" href="#the-second-period" title="Perm
<section id="an-agent-who-decides-not-to-write-a-will">
<h2>An agent who decides not to write a will<a class="headerlink" href="#an-agent-who-decides-not-to-write-a-will" title="Permalink to this heading">#</a></h2>
<p>After deciding not to write a will, an agent solves the optimization problem expressed in the following conditional value function</p>
<div class="amsmath math notranslate nohighlight" id="equation-b1a8fb09-90a5-403e-8e61-87269b16b331">
<span class="eqno">(5)<a class="headerlink" href="#equation-b1a8fb09-90a5-403e-8e61-87269b16b331" title="Permalink to this equation">#</a></span>\[\begin{equation}
<div class="amsmath math notranslate nohighlight" id="equation-81c40eee-b177-4de4-8b8c-08dda955e409">
<span class="eqno">(5)<a class="headerlink" href="#equation-81c40eee-b177-4de4-8b8c-08dda955e409" title="Permalink to this equation">#</a></span>\[\begin{equation}
\begin{split}
\nu (m_2|w=0) &amp;= \max_{0\leq c \leq m_2} u(c) + \beta V_3(m_3,W=0)\\
s.t.&amp;\\
Expand Down Expand Up @@ -819,8 +819,8 @@ <h2>An agent who decides not to write a will<a class="headerlink" href="#an-agen
<section id="an-agent-who-decides-to-write-a-will">
<h2>An agent who decides to write a will<a class="headerlink" href="#an-agent-who-decides-to-write-a-will" title="Permalink to this heading">#</a></h2>
<p>An agent who decides to write a will also solves for his consumption dinamically. We assume that the lawyer that helps the agent write his will takes some fraction <span class="math notranslate nohighlight">\(\tau\)</span> of his total resources in period 3. Therefore, the evolution of resources is given by <span class="math notranslate nohighlight">\(m_3 = (1-\tau)(m_2 - c_2 + w)\)</span>. The conditional value function of the agent is therefore:</p>
<div class="amsmath math notranslate nohighlight" id="equation-f5afe31e-ea02-463d-8738-abd4d8496a69">
<span class="eqno">(6)<a class="headerlink" href="#equation-f5afe31e-ea02-463d-8738-abd4d8496a69" title="Permalink to this equation">#</a></span>\[\begin{equation}
<div class="amsmath math notranslate nohighlight" id="equation-8878b4fc-91fe-46d3-9817-ff63be08d5d0">
<span class="eqno">(6)<a class="headerlink" href="#equation-8878b4fc-91fe-46d3-9817-ff63be08d5d0" title="Permalink to this equation">#</a></span>\[\begin{equation}
\begin{split}
\nu (m_2|w=1) &amp;= \max_{0\leq c \leq m_2} u(c) + \beta V_3(m_3,W=1)\\
s.t.&amp;\\
Expand Down Expand Up @@ -863,16 +863,16 @@ <h2>An agent who decides to write a will<a class="headerlink" href="#an-agent-wh
<section id="the-decision-whether-to-write-a-will-or-not">
<h2>The decision whether to write a will or not<a class="headerlink" href="#the-decision-whether-to-write-a-will-or-not" title="Permalink to this heading">#</a></h2>
<p>With the conditional value functions at hand, we can now express and solve the decision of whether to write a will or not, and obtain the unconditional value and consumption functions.</p>
<div class="amsmath math notranslate nohighlight" id="equation-9ea0bcc1-9cb7-4eba-8629-c7c4e8a5e2fe">
<span class="eqno">(7)<a class="headerlink" href="#equation-9ea0bcc1-9cb7-4eba-8629-c7c4e8a5e2fe" title="Permalink to this equation">#</a></span>\[\begin{equation}
<div class="amsmath math notranslate nohighlight" id="equation-274c650f-1987-4b64-9582-d58464fcfd76">
<span class="eqno">(7)<a class="headerlink" href="#equation-274c650f-1987-4b64-9582-d58464fcfd76" title="Permalink to this equation">#</a></span>\[\begin{equation}
V_2(m_2) = \max \{ \nu (m_2|w=0), \nu (m_2|w=1) \}
\end{equation}\]</div>
<div class="amsmath math notranslate nohighlight" id="equation-8b4bc0fe-ab16-46fc-a644-350e0665dda3">
<span class="eqno">(8)<a class="headerlink" href="#equation-8b4bc0fe-ab16-46fc-a644-350e0665dda3" title="Permalink to this equation">#</a></span>\[\begin{equation}
<div class="amsmath math notranslate nohighlight" id="equation-dc8b15e9-2036-49c8-af79-706d8f354901">
<span class="eqno">(8)<a class="headerlink" href="#equation-dc8b15e9-2036-49c8-af79-706d8f354901" title="Permalink to this equation">#</a></span>\[\begin{equation}
w^*(m_2) = \arg \max_{w \in \{0,1\}} \{ \nu (m_2|w=w) \}
\end{equation}\]</div>
<div class="amsmath math notranslate nohighlight" id="equation-c49b4545-5951-4d05-8af4-41ec1ab6a281">
<span class="eqno">(9)<a class="headerlink" href="#equation-c49b4545-5951-4d05-8af4-41ec1ab6a281" title="Permalink to this equation">#</a></span>\[\begin{equation}
<div class="amsmath math notranslate nohighlight" id="equation-8dc825d4-8706-44c7-970b-deffca2d3adf">
<span class="eqno">(9)<a class="headerlink" href="#equation-8dc825d4-8706-44c7-970b-deffca2d3adf" title="Permalink to this equation">#</a></span>\[\begin{equation}
c_2(m_2) = c_2(m_2|w=w^*(m_2))
\end{equation}\]</div>
<p>We now construct these objects.</p>
Expand Down Expand Up @@ -945,8 +945,8 @@ <h2>The decision whether to write a will or not<a class="headerlink" href="#the-
<section class="tex2jax_ignore mathjax_ignore" id="the-first-period">
<h1>The first period<a class="headerlink" href="#the-first-period" title="Permalink to this heading">#</a></h1>
<p>In the first period, the agent simply observes his market resources and decides what fraction of them to consume. His problem is represented by the following value function</p>
<div class="amsmath math notranslate nohighlight" id="equation-f58fd020-5957-414c-a21f-fc4e321bcb45">
<span class="eqno">(10)<a class="headerlink" href="#equation-f58fd020-5957-414c-a21f-fc4e321bcb45" title="Permalink to this equation">#</a></span>\[\begin{equation}
<div class="amsmath math notranslate nohighlight" id="equation-c343858f-e513-467f-8d29-4085a409fe94">
<span class="eqno">(10)<a class="headerlink" href="#equation-c343858f-e513-467f-8d29-4085a409fe94" title="Permalink to this equation">#</a></span>\[\begin{equation}
\begin{split}
V (m_1) &amp;= \max_{0\leq c \leq m_1} u(c) + \beta V_2(m_2)\\
s.t.&amp;\\
Expand Down
8 changes: 4 additions & 4 deletions notebooks/Gentle-Intro-To-HARK-Buffer-Stock-Model.html
Original file line number Diff line number Diff line change
Expand Up @@ -507,13 +507,13 @@ <h2>The Consumer’s Problem with Transitory and Permanent Shocks<a class="heade
<section id="mathematical-description">
<h3>Mathematical Description<a class="headerlink" href="#mathematical-description" title="Permalink to this heading">#</a></h3>
<p>Our new type of consumer receives two income shocks at the beginning of each period. Permanent income would grow by a factor <span class="math notranslate nohighlight">\(\Gamma\)</span> in the absence of any shock , but its growth is modified by a shock, <span class="math notranslate nohighlight">\(\psi_{t+1}\)</span>:</p>
<div class="amsmath math notranslate nohighlight" id="equation-051fd55b-f210-4293-b9aa-8f6358d8009e">
<span class="eqno">(11)<a class="headerlink" href="#equation-051fd55b-f210-4293-b9aa-8f6358d8009e" title="Permalink to this equation">#</a></span>\[\begin{align}
<div class="amsmath math notranslate nohighlight" id="equation-199510d8-1c9c-44b1-a35d-63ef186c3c43">
<span class="eqno">(11)<a class="headerlink" href="#equation-199510d8-1c9c-44b1-a35d-63ef186c3c43" title="Permalink to this equation">#</a></span>\[\begin{align}
P_{t+1} &amp; = \Gamma P_{t}\psi_{t+1}
\end{align}\]</div>
<p>whose expected (mean) value is <span class="math notranslate nohighlight">\(\mathbb{E}_{t}[\psi_{t+1}]=1\)</span>. Actual income received <span class="math notranslate nohighlight">\(Y\)</span> is equal to permanent income <span class="math notranslate nohighlight">\(P\)</span> multiplied by a transitory shock <span class="math notranslate nohighlight">\(\theta\)</span>:</p>
<div class="amsmath math notranslate nohighlight" id="equation-57b7e613-3a3a-4f03-90a0-42b5f843cec1">
<span class="eqno">(12)<a class="headerlink" href="#equation-57b7e613-3a3a-4f03-90a0-42b5f843cec1" title="Permalink to this equation">#</a></span>\[\begin{align}
<div class="amsmath math notranslate nohighlight" id="equation-33fa30d1-a221-4c3c-b41a-dbdc8daca73f">
<span class="eqno">(12)<a class="headerlink" href="#equation-33fa30d1-a221-4c3c-b41a-dbdc8daca73f" title="Permalink to this equation">#</a></span>\[\begin{align}
Y_{t+1} &amp; = \Gamma P_{t+1}\theta_{t+1}
\end{align}\]</div>
<p>where again <span class="math notranslate nohighlight">\(\mathbb{E}_{t}[\theta_{t+1}] = 1\)</span>.</p>
Expand Down
16 changes: 8 additions & 8 deletions notebooks/Harmenberg-Aggregation.html
Original file line number Diff line number Diff line change
Expand Up @@ -604,8 +604,8 @@ <h2>First insight<a class="headerlink" href="#first-insight" title="Permalink to
\mWgtDstnMarg_{t}(\mNrm) \def \PermGroFac^{-t}\int_{\pLvl} \pLvl \times \mpLvlDstn_t(\mNrm,\pLvl) \, d\pLvl.
\end{equation*}\]</div>
<p>The definition allows us to rewrite</p>
<div class="amsmath math notranslate nohighlight" id="equation-68a61f24-4e51-4c70-a474-5c26de06ec54">
<span class="eqno">(13)<a class="headerlink" href="#equation-68a61f24-4e51-4c70-a474-5c26de06ec54" title="Permalink to this equation">#</a></span>\[\begin{equation}\label{eq:aggC}
<div class="amsmath math notranslate nohighlight" id="equation-147e1bd6-f392-430e-ba8c-c8594078dde5">
<span class="eqno">(13)<a class="headerlink" href="#equation-147e1bd6-f392-430e-ba8c-c8594078dde5" title="Permalink to this equation">#</a></span>\[\begin{equation}\label{eq:aggC}
\CLvl_{t} = \PermGroFac^t \int_{m} \cFunc(\mNrm) \times \mWgtDstnMarg_t(\mNrm) \, dm.
\end{equation}\]</div>
<p>There are no computational advances yet: We have merely hidden the joint distribution of <span class="math notranslate nohighlight">\((\mNrm,\pLvl)\)</span> inside the <span class="math notranslate nohighlight">\(\mWgtDstnMarg\)</span> object we have defined. This helps us notice that <span class="math notranslate nohighlight">\(\mWgtDstnMarg\)</span> is the only object besides the solution that we need in order to compute aggregate consumption. But we still have no practial way of computing or approximating <span class="math notranslate nohighlight">\(\mWgtDstnMarg\)</span>.</p>
Expand Down Expand Up @@ -689,8 +689,8 @@ <h1>The efficiency gain from using Harmenberg’s method<a class="headerlink" hr
<p>To demonstrate the gain in efficiency from using Harmenberg’s method, we will set up the following experiment.</p>
<p>Consider an economy populated by <a class="reference external" href="https://econ-ark.github.io/BufferStockTheory/">Buffer-Stock</a> savers, whose individual-level state variables are market resources <span class="math notranslate nohighlight">\(\mLvl_t\)</span> and permanent income <span class="math notranslate nohighlight">\(\pLvl_t\)</span>. Such agents have a <a class="reference external" href="https://econ-ark.github.io/BufferStockTheory/#The-Problem-Can-Be-Normalized-By-Permanent-Income">homothetic consumption function</a>, so that we can define normalized market resources <span class="math notranslate nohighlight">\(\mNrm_t \def \mLvl_t / \pLvl_t\)</span>, solve for a normalized consumption function <span class="math notranslate nohighlight">\(\cFunc(\cdot)\)</span>, and express the consumption function as <span class="math notranslate nohighlight">\(\cFunc(\mLvl,\pLvl) = \cFunc(\mNrm)\times\pLvl\)</span>.</p>
<p>Assume further that mortality, impatience, and permanent income growth are such that the economy converges to stable joint distribution of <span class="math notranslate nohighlight">\(\mNrm\)</span> and <span class="math notranslate nohighlight">\(\pLvl\)</span> characterized by the density function <span class="math notranslate nohighlight">\(f(\cdot,\cdot)\)</span>. Under these conditions, define the stable level of aggregate market resources and consumption as</p>
<div class="amsmath math notranslate nohighlight" id="equation-329af567-9db0-4f30-bdb0-b1d377571f8a">
<span class="eqno">(14)<a class="headerlink" href="#equation-329af567-9db0-4f30-bdb0-b1d377571f8a" title="Permalink to this equation">#</a></span>\[\begin{equation}
<div class="amsmath math notranslate nohighlight" id="equation-7c9e3690-ad42-44cd-bf90-fcf4b60df907">
<span class="eqno">(14)<a class="headerlink" href="#equation-7c9e3690-ad42-44cd-bf90-fcf4b60df907" title="Permalink to this equation">#</a></span>\[\begin{equation}
\MLvl \def \int \int \mNrm \times \pLvl \times f(\mNrm, \pLvl)\,d\mNrm \,d\pLvl, \,\,\, \CLvl \def \int \int \cFunc(\mNrm) \times \pLvl \times f(\mNrm, \pLvl)\,d\mNrm \,d\pLvl.
\end{equation}\]</div>
<p>If we could simulate the economy with a continuum of agents we would find that, over time, our estimate of aggregate market resources <span class="math notranslate nohighlight">\(\MLvlest_t\)</span> would converge to <span class="math notranslate nohighlight">\(\MLvl\)</span> and <span class="math notranslate nohighlight">\(\CLvlest_t\)</span> would converge to <span class="math notranslate nohighlight">\(\CLvl\)</span>. Therefore, if we computed our aggregate estimates at different periods in time we would find them to be close:</p>
Expand All @@ -702,13 +702,13 @@ <h1>The efficiency gain from using Harmenberg’s method<a class="headerlink" hr
\text{for } n&gt;0 \text{ and } t \text{ large enough}.
\end{equation*}\]</div>
<p>In practice, however, we rely on approximations using a finite number of agents <span class="math notranslate nohighlight">\(I\)</span>. Our estimates of aggregate market resources and consumption at time <span class="math notranslate nohighlight">\(t\)</span> are</p>
<div class="amsmath math notranslate nohighlight" id="equation-dc30da6e-e47b-4cdf-8da4-56ae1807690b">
<span class="eqno">(15)<a class="headerlink" href="#equation-dc30da6e-e47b-4cdf-8da4-56ae1807690b" title="Permalink to this equation">#</a></span>\[\begin{equation}
<div class="amsmath math notranslate nohighlight" id="equation-81ee5557-182e-4c91-8802-095fae69a011">
<span class="eqno">(15)<a class="headerlink" href="#equation-81ee5557-182e-4c91-8802-095fae69a011" title="Permalink to this equation">#</a></span>\[\begin{equation}
\MLvlest_t \def \frac{1}{I} \sum_{i=1}^{I} m_{i,t}\times\pLvl_{i,t}, \,\,\, \CLvlest_t \def \frac{1}{I} \sum_{i=1}^{I} \cFunc(m_{i,t})\times\pLvl_{i,t},
\end{equation}\]</div>
<p>under the basic simulation strategy or</p>
<div class="amsmath math notranslate nohighlight" id="equation-27be1132-dfdd-48e4-bb49-2d069cc3ac4b">
<span class="eqno">(16)<a class="headerlink" href="#equation-27be1132-dfdd-48e4-bb49-2d069cc3ac4b" title="Permalink to this equation">#</a></span>\[\begin{equation}
<div class="amsmath math notranslate nohighlight" id="equation-b9f5d9b4-65e3-491e-ae75-2cc48f00f586">
<span class="eqno">(16)<a class="headerlink" href="#equation-b9f5d9b4-65e3-491e-ae75-2cc48f00f586" title="Permalink to this equation">#</a></span>\[\begin{equation}
\MLvlest_t \def \frac{1}{I} \sum_{i=1}^{I} \tilde{m}_{i,t}, \,\,\, \CLvlest_t \def \frac{1}{I} \sum_{i=1}^{I} \cFunc(\tilde{m}_{i,t}),
\end{equation}\]</div>
<p>if we use Harmenberg’s method to simulate the distribution of normalized market resources under the permanent-income neutral measure.</p>
Expand Down
4 changes: 2 additions & 2 deletions notebooks/KeynesFriedmanModigliani.html
Original file line number Diff line number Diff line change
Expand Up @@ -509,8 +509,8 @@ <h2>1. The Keynesian consumption function<a class="headerlink" href="#the-keynes
</ol>
<p>This can be formalized as:</p>
<p>$</p>
<div class="amsmath math notranslate nohighlight" id="equation-1423c120-ebe1-4edc-8ad9-226ef1965a35">
<span class="eqno">(17)<a class="headerlink" href="#equation-1423c120-ebe1-4edc-8ad9-226ef1965a35" title="Permalink to this equation">#</a></span>\[\begin{eqnarray}
<div class="amsmath math notranslate nohighlight" id="equation-499db06a-2fe4-4202-afb8-2c9ccb221062">
<span class="eqno">(17)<a class="headerlink" href="#equation-499db06a-2fe4-4202-afb8-2c9ccb221062" title="Permalink to this equation">#</a></span>\[\begin{eqnarray}
c_t &amp; = &amp; a_0 + a_{1}y_t
\\ c_t - c_{t-1} &amp; = &amp; a_{1}(y_t - y_{t-1})
\end{eqnarray}\]</div>
Expand Down
Loading

0 comments on commit 80a5525

Please sign in to comment.