The Sequential Endogenous Grid Method
1A basic model¶
The baseline problem which I will use to demonstrate the Sequential Endogenous Grid Method (EGMn) is a discrete time version of Bodie et al. (1992) where a consumer has the ability to adjust their labor as well as their consumption in response to financial risk. The objective consists of maximizing the present discounted lifetime utility of consumption and leisure.
In particular, this example makes use of a utility function that is based on Example 1 in the paper, which is that of additively separable utility of labor and leisure as
where the term is introduced to allow for a balanced growth path as in Mertens & Ravn (2011). The use of additively separable utility is ad-hoc, as it will allow for the use of multiple EGM steps in the solution process, as we’ll see later.
This model represents a consumer who begins the period with a level of bank balances and a given wage offer . Simultaneously, they are able to choose consumption, labor intensity, and a risky portfolio share with the objective of maximizing their utility of consumption and leisure, as well as their future wealth.
The problem can be written in normalized recursive form[1] as
in which is the time supplied to labor net of leisure, is the market resources totaling bank balances and labor income, is the amount of saving assets held by the consumer, and is the risky share of assets, which induce a return on portfolio that results in next period’s bank balances normalized by next period’s permanent income .
2Restating the problem sequentially¶
We can make a few choices to create a sequential problem which will allow us to use multiple EGM steps in succession. First, the agent decides their labor-leisure trade-off and receives a wage. Their wage plus their previous bank balance then becomes their market resources. Second, given market resources, the agent makes a pure consumption-saving decision. Finally, given an amount of savings, the consumer then decides their risky portfolio share.
Starting from the beginning of the period, we can define the labor-leisure problem as
The pure consumption-saving problem is then
Finally, the risky portfolio problem is
This sequential approach is explicitly modeled after the nested approaches explored in Clausen & Strub (2020) and Druedahl (2021). However, I will offer additional insights that expand on these methods. An important observation is that now, every single choice is self-contained in a subproblem, and although the structure is specifically chosen to minimize the number of state variables at every stage, the problem does not change by this structural imposition. This is because there is no additional information or realization of uncertainty that happens between decisions, as can be seen by the expectation operator being in the last subproblem. From the perspective of the consumer, these decisions are essentially simultaneous, but a careful organization into sub-period problems enables us to solve the model more efficiently and can provide key economic insights. In this problem, as we will see, a key insight will be the ability to explicitly calculate the marginal value of wealth and the Frisch elasticity of labor.
3The portfolio decision subproblem¶
As useful as it is to be able to use the EGM step more than once, there are clear problems where the EGM step is not applicable. This basic labor-portfolio choice problem demonstrates where we can use an additional EGM step, and where we can not. First, we go over a subproblem where we can not use the EGM step.
In reorganizing the labor-portfolio problem into subproblems, we assigned the utility of leisure to the leisure-labor subproblem and the utility of consumption to the consumption-savings subproblem. There are no more separable convex utility functions to assign to this problem, and even if we re-organized the problem in a way that moved one of the utility functions into this subproblem, they would not be useful in solving this subproblem via EGM as there is no direct relation between the risky share of portfolio and consumption or leisure. Therefore, the only way to solve this subproblem is through standard convex optimization and root-finding techniques.
Restating the problem in compact form gives
The first-order condition with respect to the risky portfolio share is then
Finding the optimal risky share requires numerical optimization and root-solving of the first-order condition. To close out the problem, we can calculate the envelope condition as
3.1A note on avoiding taking expectations more than once¶
We could instead define the portfolio choice subproblem as:
where
In this case, the process is similar. The only difference is that we don’t have to take expectations more than once. Given the next period’s solution, we can calculate the marginal value functions as:
If we are clever, we can calculate both of these in one step. Now, the optimal risky share can be found by the first-order condition and we can use it to evaluate the envelope condition.
4The consumption-saving subproblem¶
The consumption-saving EGM follows Carroll (2006) but I will cover it for exposition. We can begin the solution process by restating the consumption-savings subproblem in a more compact form, substituting the market resources constraint and ignoring the no-borrowing constraint for now. The problem is:
To solve, we derive the first-order condition with respect to which gives the familiar Euler equation:
Inverting the above equation is the (first) EGM step.
Given the utility function above, the marginal utility of consumption and its inverse are
Carroll (2006) demonstrates that by using an exogenous grid of points we can find the unique that optimizes the consumption-saving problem, since the first-order condition is necessary and sufficient. Further, using the market resources constraint, we can recover the exact amount of market resources that is consistent with this consumption-saving decision as
This is the ``endogenous’’ grid that is consistent with the exogenous decision grid . Now that we have a pair for each , we can construct an interpolating consumption function for market resources points that are off-the-grid.
The envelope condition will be useful in the next section, but for completeness is defined here.
5The labor-leisure subproblem¶
The labor-leisure subproblem can be restated more compactly as:
The first-order condition with respect to leisure implies the labor-leisure Euler equation
The marginal utility of leisure and its inverse are
Using an exogenous grid of and , we can find leisure as
In this case, it’s important to note that there are conditions for leisure itself. An agent with a small level of market resources might want to work more than their available time endowment, especially at higher levels of income , if the utility of leisure is not enough to compensate for their low wealth. In these situations, the optimal unconstrained leisure might be negative, so we must impose a constraint on the optimal leisure function. This is similar to the treatment of an artificial borrowing constraint in the pure consumption subproblem. From now on, let’s call this constrained optimal function , where
Then, we derive labor as . Finally, for each and as an exogenous grid, we can find the endogenous grid of bank balances as .
The envelope condition then provides a heterogeneous Frisch elasticity of labor as simply
6Alternative Parametrization¶
An alternative formulation for the utility of leisure is to state it in terms of the disutility of labor as in (references)
In this case, we can restate the problem as
The marginal utility of leisure and its inverse are
7Curvilinear Grids¶
Although EGMn seems to be a simple approach, there is one important caveat that we have not discussed, which is the details of the interpolation. In the pure consumption-savings problem, a one-dimensional exogenous grid of post-decision liquid assets results in a one-dimensional endogenous grid of total market resources . However, as we know from standard EGM, the spacing in the grid is different from the spacing in the grid as the inverted Euler equation is non-linear. This is no problem in a one-dimensional problem as we can simply use non-uniform linear interpolation.
However, the same is true of higher dimensional problems, where the exogenous grid gets mapped to a warped endogenous grid. In this case, it is not possible to use standard multi-linear interpolation, as the resulting endogenous grid is not rectilinear. Instead, I introduce a novel approach to interpolation that I call Warped Grid Interpolation (WGI), which is similar to White (2015)’s approach but computationally more efficient and robust. The details of this interpolation method will be further explained in Section 4, but for now, we show the resulting warped endogenous grid for the labor-leisure problem.
8Warped Grid Interpolation (WGI)¶
Assume we have a set of points indexed by in two-dimensional space for which we have corresponding functional values in a third dimension, such that . In practice, we are interested in cases where the are difficult to compute and is unknown, so we are unable to compute them at other values of and --- which is why we want to interpolate[2]. These points however are not evenly spaced and do not form a rectilinear grid which would make it easy to interpolate the function off the grid. Nevertheless, these points do have a regular structure as we will see.
In Figure 2, we can see the true function in three-dimensional space, along with the points for which we actually know the value of the function. The underlying regular structure comes from the points’ position in the matrix, the coordinates. If we join the points along every row and every column, we can see that the resulting grid is regular and piecewise affine (curvilinear).
In Figure 3 we see the values of the function at their index coordinate points in the matrix. We can see that there exists a mapping between the curvilinear grid and the index coordinates of the matrix.
The objective is to be able to interpolate the value of the function at any point off the grid, where presumably we are only interested in points internal to the curvilinear space and not outside the boundaries. For example, we can imagine that we want an approximation to the function at the point pictured Figure 4. If we could find the corresponding point in the coordinate grid, interpolation would be straightforward. We can find where the -coordinate of the point of interest intersects with the index-coordinates of the matrix. This is similar to assuming that we have 3 linear interpolators formed by connecting the points on the green lines in the x-direction, and for each interpolator we can approximate the corresponding y and z values using the grid data. Now, for each circle in Figure 4, we have a corresponding pair , and we can interpolate in the y-direction to find the corresponding z-value for the point’s y-coordinate[3].
As in Carroll (2009), where the utility of normalized consumption and leisure is defined as
For more examples of the Warped Grid Interpolation method in action, see the github project
alanlujan91/multinterp
.
- Bodie, Z., Merton, R. C., & Samuelson, W. F. (1992). Labor supply flexibility and portfolio choice in a life cycle model. Journal of Economic Dynamics & Control, 16(3–4), 427–449. 10.1016/0165-1889(92)90044-F
- Mertens, K., & Ravn, M. O. (2011). Understanding the aggregate effects of anticipated and unanticipated tax policy shocks. Review of Economic Dynamics, 14(1), 27–54. 10.1016/j.red.2010.07.004
- Clausen, A., & Strub, C. (2020). Reverse calculus and nested optimization. Journal of Economic Theory, 187(105019), 105019. 10.1016/j.jet.2020.105019
- Druedahl, J. (2021). A Guide on Solving Non-convex Consumption-Saving Models. Computational Economics, 58(3), 747–775. 10.1007/s10614-020-10045-x
- Carroll, C. D. (2006). The method of endogenous gridpoints for solving dynamic stochastic optimization problems. Economics Letters, 91(3), 312–320. 10.1016/j.econlet.2005.09.013