Endogenous Grid Method

Consider a consumer facing fluctuating income ee. We will assume that ee takes NeN_e values and follows a Markov chain with transition probabilities Π(ee)\Pi(e'|e) where a prime denotes next period's value of a variable. The consumer can save in a risk-free bond at return RR. The budget constraint is therefore

a+c=Ra+e,a' + c = R a + e,

where aa is assets before interest. Let's suppose that there is a borrowing constraint a0.a \geq 0. The consumer wishes to maximize a utility function of

E0t=0βtu(ct)\mathbb E_0 \sum_{t=0}^\infty \beta^t u(c_t)

where u(c)=c1γ/(1γ)u(c) = c^{1-\gamma}/(1-\gamma).

The states of the consumer's problem are (a,e)(a,e) and so a solution to this problem can be represented as a function g(a,e)g(a,e) that gives the choice of aa'.

The Bellman equation is

V(a,e)=maxa0{u(Ra+ea)+βEV(a,e)},V(a,e) = \max_{a'\geq 0} \left\{ u(Ra + e - a') + \beta \mathbb E V(a',e') \right\},

where the expectation is taken over possible realizations of ee' conditional on ee. Notice that we are including uncertainty over idiosyncratic shocks even though we will (later) assume certainty equivalence (i.e. perfect foresight) over aggregate variables. For now we assume aggregate variables are constant.

The first-order and envelope conditions are

u(c)βEVa(a,e)Va(a,e)=Ru(c)\begin{aligned} u'(c) &\geq \beta \mathbb E V_a(a',e') \\ V_a(a,e) &= R u'(c) \end{aligned}

The heart of the endogenous grid method is as follows. Suppose this period we have states (a,e)(a,e) where we know ee, but as of yet we don't know aa. Suppose we save an amount aa' so we have g(a,e)=ag(a,e) = a' and we will have to determine aa. Given the function VaV_a that will prevail in the future, we use the first-order condition to solve for cc and then the budget constraint to solve for aa

a=(a+ce)/Ra = (a' +c - e)/R

(recall we know aa'). We then use the envelope condition to calculate Va(a,e)V_a(a,e) (i.e. the marginal value of assets today for a single (a,e)(a,e) pair. Doing this for many aa' values, we can map out the whole function Va(a,e)V_a(a,e).

This procedure started with a guess of the VaV_a function that prevails next period, and then produced the VaV_a function that prevails this period. We use the new function as our guess and apply the same steps again, repeating until the guess reproduces itself.

Implementation concepts

We now discuss some of the details of how we implement these ideas.

Approximating the decision rules

A function cannot itself be represented in a computer so the first decision we have to make is how to approximate the savings policy rule. Let AA be a grid of NAN_A points on values of aa with the first gridpoint at the borrowing constraint, zero in this case. Now let GG be a NA×NeN_A \times N_e matrix where each column is a vector of length NAN_A that represents the policy rule as a function of aa for one of the values of ee. The interpretation now is that if you have states (Ai,ej)(A_{i},e_j) then the policy rule calls for saving GijG_{ij}. For values of aa between two values of AiA_{i} and Ai+1A_{i+1} we will use linear interpolation to fill in the function.

Implementing the endogenous grid method

The endogenous grid method imposes a grid on aa'. We will use the same one that we use to approximate the savings policy. When we apply steps above, we find values of aa that map into the savings choices on the grid AA. This is almost what we want, but not quite. We want to know the values GG that correspond to the savings choices at current states AA, but what we have calculated is the states aa that map into the savings choices AA.

For a given current eje_j, the steps above yield a set of points A~\tilde A such that g(A~i,ej)=Aig(\tilde A_i,e_j) = A_i. What we would like is a set of savings levels GjG_{\cdot j} such that g(Ai,ej)=Gijg(A_i,e_j) = G_{ij}. We can use linear interpolation to find GjG_{\cdot j}.

Code

An example application of the endogenous grid method can be found in EGM.jl

Next step

We next discuss methods to analyze a population of households facing this type of consumption-savings problem, which brings us to the Aiyagari (1994) model.