A generalized endogenous grid method for discrete-continuous choice
This paper extends Carroll's endogenous grid method (2006 "The method of endogenous gridpoints for solving dynamic stochastic optimization problems", Economic Letters) for models with sequential discrete and continuous choice. Unlike existing generalizations, we propose solution algorithm that inherits both advantages of the original method, namely it avoids all root finding operations, and also efficiently deals with restrictions on the continuous decision variable. To further speed up the solution, we perform the inevitable optimization across discrete decisions as more efficient computation of upper envelope of a set of piece-wise linear functions. We formulate the algorithm relying as little as possible on a particular model specification, and precisely define the class of dynamic stochastic optimal control problems it can be applied to. We illustrate our algorithm using finite horizon discrete sector choice model with consumption-savings decisions and borrowing constraints, and show that in comparison to the traditional approach the proposed method runs at least an order of magnitude faster to deliver the same precision of the solution. To implement the method we develop a generic software package that includes pseudo-language for easy model specification and computational modules which support both shared memory and cluster parallelization. The package is wrapped in a Matlab class and incurs low start-up cost to the user. The software package is accessible in public domain.