Skip to article content
Back to Article
Appendix: Solving the illustrative G2EGM model with EGM^n
Download Article

Appendix: Solving the illustrative G2EGM model with EGM^n

1The problem for a retired household

I designate as wt(mt)\wFunc_{t}(\mRat_{t}) the problem of a retired household at time tt with total resources m\mRat. The retired household solves a simple consumption-savings problem with no income uncertainty and a certain next period pension of θ\underline{\tShkEmp}.

wt(mt)=maxctu(ct)+βwt+1(mt)s.t.at=mtctmt+1=Raat+θ\begin{split} \wFunc_{t}(\mRat_{t}) & = \max_{\cRat_{t}} \util(\cRat_{t}) + \DiscFac \wFunc_{t+1}(\mRat_{t}) \\ & \text{s.t.} \\ \aRat_{t} & = \mRat_{t} - \cRat_{t} \\ \mRat_{t+1} & = \Rfree_{\aRat} \aRat_{t} + \underline{\tShkEmp} \end{split}

Notice that there is no uncertainty and the household receives a retirement income θ\underline{\tShkEmp} every period until death.

2The problem for a worker household

The value function of a worker household is

Vt(mt,nt)=Eϵmax{vt(mt,nt,W)+σϵϵW,vt(mt,nt,R)+σϵϵR}\VFunc_{t}(\mRat_{t}, \nRat_{t}) = \Ex_\error \max \left\{ \vFunc_{t}(\mRat_{t}, \nRat_{t}, \Work) + \sigma_{\error} \error_{\Work} , \vFunc_{t}(\mRat_{t}, \nRat_{t}, \Retire) + \sigma_{\error} \error_{\Retire} \right\}

where the choice specific problem for a working household that decides to continue working is

vt(mt,nt,W)=maxct,dtu(ct)α+βEt[Vt+1(mt+1,nt+1)]s.t.at=mtctdtbt=nt+dt+g(dt)mt+1=Raat+θt+1nt+1=Rbbt\begin{split} \vFunc_{t}(\mRat_{t}, \nRat_{t}, \Work) & = \max_{\cRat_{t}, \dRat_{t}} \util(\cRat_{t}) - \kapShare + \DiscFac \Ex_{t} \left[ \VFunc_{t+1}(\mRat_{t+1}, \nRat_{t+1}) \right] \\ & \text{s.t.} \\ \aRat_{t} & = \mRat_{t} - \cRat_{t} - \dRat_{t} \\ \bRat_{t} & = \nRat_{t} + \dRat_{t} + \gFunc(\dRat_{t}) \\ \mRat_{t+1} & = \Rfree_{\aRat} \aRat_{t} + \tShkEmp_{t+1} \\ \nRat_{t+1} & = \Rfree_{\bRat} \bRat_{t} \end{split}

and the choice specific problem for a working household that decides to retire is

vt(mt,nt,R)=wt(mt+nt)\vFunc_{t}(\mRat_{t}, \nRat_{t}, \Retire) = \wFunc_{t}(\mRat_{t}+\nRat_{t})

3Applying the Sequential EGM

The first step is to define a post-decision value function. Once the household decides their level of consumption and pension deposits, they are left with liquid assets they are saving for the future and illiquid assets in their pension account which they can’t access again until retirement. The post-decision value function can be defined as

vt(at,bt)=βEt[Vt+1(mt+1,nt+1)]s.t.mt+1=Raat+θt+1nt+1=Rbbt\begin{split} \vEnd_{t}(\aRat_{t}, \bRat_{t}) & = \DiscFac \Ex_{t} \left[ \VFunc_{t+1}(\mRat_{t+1}, \nRat_{t+1}) \right] \\ & \text{s.t.} \\ \mRat_{t+1} & = \Rfree_{\aRat} \aRat_{t} + \tShkEmp_{t+1} \\ \nRat_{t+1} & = \Rfree_{\bRat} \bRat_{t} \end{split}

Then redefine the working agent’s problem as

vt(mt,nt,W)=maxct,dtu(ct)α+vt(at,bt)at=mtctdtbt=nt+dt+g(dt)\begin{split} \vFunc_{t}(\mRat_{t}, \nRat_{t}, \Work) & = \max_{\cRat_{t}, \dRat_{t}} \util(\cRat_{t}) - \kapShare + \vEnd_{t}(\aRat_{t}, \bRat_{t}) \\ \aRat_{t} & = \mRat_{t} - \cRat_{t} - \dRat_{t} \\ \bRat_{t} & = \nRat_{t} + \dRat_{t} + \gFunc(\dRat_{t}) \\ \end{split}

Clearly, the structure of the problem remains the same, and this is the problem that G2EGM solves. We’ve only moved some of the stochastic mechanics out of the problem. Now, we can apply the sequential EGMn method. Let the agent first decide dt\dRat_{t}, the deposit amount into their retirement; we will call this the deposit problem, or outer loop. Thereafter, the agent will have net liquid assets of lt\lRat_{t} and pension assets of bt\bRat_{t}.

vt(mt,nt,W)=maxdtv~t(lt,bt)s.t.lt=mtdtbt=nt+dt+g(dt)\begin{split} \vFunc_{t}(\mRat_{t}, \nRat_{t}, \Work) & = \max_{\dRat_{t}} \vOpt_{t}(\lRat_{t}, \bRat_{t}) \\ & \text{s.t.} \\ \lRat_{t} & = \mRat_{t} - \dRat_{t} \\ \bRat_{t} & = \nRat_{t} + \dRat_{t} + \gFunc(\dRat_{t}) \end{split}

Now, the agent can move on to picking their consumption and savings; we can call this the pure consumption problem or inner loop.

v~t(lt,bt)=maxctu(ct)α+vt(at,bt)s.t.at=ltct\begin{split} \vOpt_{t}(\lRat_{t}, \bRat_{t}) & = \max_{\cRat_{t}} \util(\cRat_{t}) - \kapShare + \vEnd_{t}(\aRat_{t}, \bRat_{t}) \\ & \text{s.t.} \\ \aRat_{t} & = \lRat_{t} - \cRat_{t} \\ \end{split}

Because we’ve already made the pension decision, the amount of pension assets does not change in this loop and it just passes through to the post-decision value function.

4Solving the problem

4.1Solving the Inner Consumption Saving Problem

Let’s start with the pure consumption-saving problem, which we can summarize by substitution as

v~t(lt,bt)=maxctu(ct)α+vt(ltct,bt)\vOpt_{t}(\lRat_{t}, \bRat_{t}) = \max_{\cRat_{t}} \util(\cRat_{t}) - \kapShare + \vEnd_{t}(\lRat_{t} - \cRat_{t}, \bRat_{t})

The first-order condition is

u(ct)=vta(ltct,bt)=vta(at,bt)\util'(\cRat_{t}) = \vEnd_{t}^{\aRat}(\lRat_{t}-\cRat_{t}, \bRat_{t}) = \vEnd_{t}^{\aRat}(\aRat_{t}, \bRat_{t})

We can invert this Euler equation as in standard EGM to obtain the consumption function.

ct(at,bt)=u1(vta(at,bt))\cEndFunc_{t}(\aRat_{t}, \bRat_{t}) = \util'^{-1}\left(\vEnd_{t}^{\aRat}(\aRat_{t}, \bRat_{t})\right)

Again as before, lt(at,bt)=ct(at,bt)+at\lEndFunc_{t}(\aRat_{t}, \bRat_{t}) = \cEndFunc_{t}(\aRat_{t}, \bRat_{t}) + \aRat_{t}. To sum up, using an exogenous grid of (at,bt)(\aRat_{t}, \bRat_{t}) we obtain the trio (ct(at,bt),lt(at,bt),bt)(\cEndFunc_{t}(\aRat_{t}, \bRat_{t}), \lEndFunc_{t}(\aRat_{t}, \bRat_{t}), \bRat_{t}) which provides an interpolating function for our optimal consumption decision rule over the (l,b)(\lRat, \bRat) grid. Without loss of generality, assume lt=lt(at,bt)\lEndFunc_{t} = \lEndFunc_{t}(\aRat_{t}, \bRat_{t}) and define the interpolating function as

cˇt(lt,bt)ct(at,bt)\cTarg_{t}(\lEndFunc_{t}, \bRat_{t}) \equiv \cEndFunc_{t}(\aRat_{t}, \bRat_{t})

For completeness, we derive the envelope conditions as well, and as we will see, these will be useful when solving the next section.

v~tl(lt,bt)=vta(at,bt)=u(ct)v~tb(lt,bt)=vtb(at,bt)\begin{split} \vOpt_{t}^{\lRat}(\lRat_{t}, \bRat_{t}) & = \vEnd_{t}^{\aRat}(\aRat_{t}, \bRat_{t}) = \util'(\cRat_{t}) \\ \vOpt_{t}^{\bRat}(\lRat_{t}, \bRat_{t}) & = \vEnd_{t}^{\bRat}(\aRat_{t}, \bRat_{t}) \end{split}

4.2Solving the Outer Pension Deposit Problem

Now, we can move on to solving the deposit problem, which we can also summarize as

vt(mt,nt,W)=maxdtv~t(mtdt,nt+dt+g(dt))\vFunc_{t}(\mRat_{t}, \nRat_{t}, \Work) = \max_{\dRat_{t}} \vOpt_{t}(\mRat_{t} - \dRat_{t}, \nRat_{t} + \dRat_{t} + \gFunc(\dRat_{t}))

The first-order condition is

v~tl(lt,bt)(1)+v~tb(lt,bt)(1+g(dt))=0\vOpt_{t}^{\lRat}(\lRat_{t}, \bRat_{t})(-1) + \vOpt_{t}^{\bRat}(\lRat_{t}, \bRat_{t})(1+\gFunc'(\dRat_{t})) = 0

Rearranging this equation gives

g(dt)=v~tl(lt,bt)v~tb(lt,bt)1\gFunc'(\dRat_{t}) = \frac{\vOpt_{t}^{\lRat}(\lRat_{t}, \bRat_{t})}{\vOpt_{t}^{\bRat}(\lRat_{t}, \bRat_{t})} - 1

Assuming that g(d)\gFunc'(\dRat) exists and is invertible, we can find

dt(lt,bt)=g1(v~tl(lt,bt)v~tb(lt,bt)1)\dEndFunc_{t}(\lRat_{t}, \bRat_{t}) = \gFunc'^{-1}\left( \frac{\vOpt_{t}^{\lRat}(\lRat_{t}, \bRat_{t})}{\vOpt_{t}^{\bRat}(\lRat_{t}, \bRat_{t})} - 1 \right)

Using this, we can back out nt\nRat_{t} as

nt(lt,bt)=btdt(lt,bt)g(dt(lt,bt))\nEndFunc_{t}(\lRat_{t}, \bRat_{t}) = \bRat_{t} - \dEndFunc_{t}(\lRat_{t}, \bRat_{t}) - \gFunc(\dEndFunc_{t}(\lRat_{t}, \bRat_{t}))

and mt\mRat_{t} as

mt(lt,bt)=lt+dt(lt,bt)\mEndFunc_{t}(\lRat_{t}, \bRat_{t}) = \lRat_{t} + \dEndFunc_{t}(\lRat_{t}, \bRat_{t})

In sum, given an exogenous grid (lt,bt)(\lRat_{t}, \bRat_{t}) we obtain the triple (mt(lt,bt),nt(lt,bt),dt(lt,bt))\left(\mEndFunc_{t}(\lRat_{t}, \bRat_{t}), \nEndFunc_{t}(\lRat_{t}, \bRat_{t}), \dEndFunc_{t}(\lRat_{t}, \bRat_{t})\right), which we can use to create an interpolator for the decision rule dt\dRat_{t}.

To close the solution method, the envelope conditions are

vtm(mt,nt,W)=v~tl(lt,bt)vtn(mt,nt,W)=v~tb(lt,bt)\begin{split} \vFunc_{t}^{\mRat}(\mRat_{t}, \nRat_{t}, \Work) & = \vOpt_{t}^{\lRat}(\lRat_{t}, \bRat_{t}) \\ \vFunc_{t}^{\nRat}(\mRat_{t}, \nRat_{t}, \Work) & = \vOpt_{t}^{\bRat}(\lRat_{t}, \bRat_{t}) \end{split}

5Is g invertible?

We’ve already seen that u()\util'(\cdot) is invertible, but is g\gFunc?

g(d)=χlog(1+d)g(d)=χ1+dg1(y)=χ/y1\gFunc(\dRat) = \xFer \log(1+\dRat) \qquad \gFunc'(\dRat) = \frac{\xFer}{1+\dRat} \qquad \gFunc'^{-1}(y) = \xFer/y - 1

6The Post-Decision Value and Marginal Value Functions

vt(a,b)=βEt[V(mt+1,nt+1)]s.t.mt+1=Raat+θt+1nt+1=Rbbt\begin{split} \vEnd_{t}(\aRat, \bRat) & = \DiscFac \Ex_{t} \left[ \VFunc(\mRat_{t+1}, \nRat_{t+1}) \right] \\ & \text{s.t.} \\ \mRat_{t+1} & = \Rfree_{\aRat} \aRat_{t} + \tShkEmp_{t+1} \\ \nRat_{t+1} & = \Rfree_{\bRat} \bRat_{t} \end{split}

and

vta(at,bt)=βRaEt[Vt+1m(mt+1,nt+1)]s.t.mt+1=Raat+θt+1nt+1=Rbbt\begin{split} \vEnd_{t}^{\aRat}(\aRat_{t}, \bRat_{t}) & = \DiscFac \Rfree_{\aRat} \Ex_{t} \left[ \VFunc^{\mRat}_{t+1}(\mRat_{t+1}, \nRat_{t+1}) \right] \\ & \text{s.t.} \\ \mRat_{t+1} & = \Rfree_{\aRat} \aRat_{t} + \tShkEmp_{t+1} \\ \nRat_{t+1} & = \Rfree_{\bRat} \bRat_{t} \end{split}

and

vtb(at,bt)=βRbEt[Vt+1n(mt+1,nt+1)]s.t.mt+1=Raat+θt+1nt+1=Rbbt\begin{split} \vEnd_{t}^{\bRat}(\aRat_{t}, \bRat_{t}) & = \DiscFac \Rfree_{\bRat} \Ex_{t} \left[ \VFunc^{\nRat}_{t+1}(\mRat_{t+1}, \nRat_{t+1}) \right] \\ & \text{s.t.} \\ \mRat_{t+1} & = \Rfree_{\aRat} \aRat_{t} + \tShkEmp_{t+1} \\ \nRat_{t+1} & = \Rfree_{\bRat} \bRat_{t} \end{split}

7Taste Shocks

From discrete choice theory and from DCEGM paper, we know that

Et[Vt+1(mt+1,nt+1,ϵt+1)]=σlog[D{W,R}exp(vt+1(mt+1,nt+1,D)σϵ)]\Ex_{t} \left[ \VFunc_{t+1}(\mRat_{t+1}, \nRat_{t+1}, \error_{t+1}) \right] = \sigma \log \left[ \sum_{\Decision \in \{\Work, \Retire\}} \exp \left( \frac{\vFunc_{t+1}(\mRat_{t+1}, \nRat_{t+1}, \Decision)}{\sigma_\error} \right) \right]

and

Pt(D  mt+1,nt+1)=exp(vt+1(mt+1,nt+1,D)/σϵ)D{W,R}exp(vt+1(mt+1,nt+1,D)σϵ)\Prob_{t}(\Decision ~ \lvert ~ \mRat_{t+1}, \nRat_{t+1}) = \frac{\exp \left( \vFunc_{t + 1}(\mRat_{t+1}, \nRat_{t+1}, \Decision) / \sigma_\error \right) }{ \sum\limits_{\Decision \in \{\Work, \Retire\}} \exp \left( \frac{\vFunc_{t+1}(\mRat_{t+1}, \nRat_{t+1}, \Decision)}{\sigma_\error} \right)}

the first-order conditions are therefore

v~ˋtm(mt+1,nt+1)=D{W,R}Pt(D  mt+1,nt+1)vt+1m(mt+1,nt+1,D)\vOptAlt_{t}^{\mRat}(\mRat_{t+1}, \nRat_{t+1}) = \sum_{\Decision \in \{\Work, \Retire\}} \Prob_{t}(\Decision ~ \lvert ~ \mRat_{t+1}, \nRat_{t+1}) \vFunc_{t+1}^{\mRat}(\mRat_{t+1}, \nRat_{t+1}, \Decision)
Content
Conclusion