Consider a consumer facing fluctuating income . We will assume that takes values and follows a Markov chain with transition probabilities where a prime denotes next period's value of a variable. The consumer can save in a risk-free bond at return . The budget constraint is therefore
where is assets before interest. Let's suppose that there is a borrowing constraint The consumer wishes to maximize a utility function of
where .
The states of the consumer's problem are and so a solution to this problem can be represented as a function that gives the choice of .
The Bellman equation is
where the expectation is taken over possible realizations of conditional on . 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
The heart of the endogenous grid method is as follows. Suppose this period we have states where we know , but as of yet we don't know . Suppose we save an amount so we have and we will have to determine . Given the function that will prevail in the future, we use the first-order condition to solve for and then the budget constraint to solve for
(recall we know ). We then use the envelope condition to calculate (i.e. the marginal value of assets today for a single pair. Doing this for many values, we can map out the whole function .
This procedure started with a guess of the function that prevails next period, and then produced the 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.
We now discuss some of the details of how we implement these ideas.
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 be a grid of points on values of with the first gridpoint at the borrowing constraint, zero in this case. Now let be a matrix where each column is a vector of length that represents the policy rule as a function of for one of the values of . The interpretation now is that if you have states then the policy rule calls for saving . For values of between two values of and we will use linear interpolation to fill in the function.
The endogenous grid method imposes a grid on . We will use the same one that we use to approximate the savings policy. When we apply steps above, we find values of that map into the savings choices on the grid . This is almost what we want, but not quite. We want to know the values that correspond to the savings choices at current states , but what we have calculated is the states that map into the savings choices .
For a given current , the steps above yield a set of points such that . What we would like is a set of savings levels such that . We can use linear interpolation to find .
An example application of the endogenous grid method can be found in EGM.jl
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.