Endogenous Grid Method
Introduction
The Endogenous Grid Method (EGM) is a method to solve dynamic programming problems with one choice variable. It is particularly useful when the choice variable is continuous and the state space is high-dimensional. The EGM is a variant of the Value Function Iteration (VFI) algorithm that is more efficient in terms of computational time and memory usage.
API
BellmanSolver.EGM.do_EGM — Methoddo_EGM(
foc, env, lom, kp_grid, p_grid, trans_mat, β;
tol=1e-6, max_iter=1000, kwargs...
)Solve a dynamic programming problem using the endogenous grid method.
Arguments
foc::Function: First order condition functionenv::Function: Envelope condition functionlom::Function: Law of motion functionkp_grid::Vector{Float64}: Grid points for the capital stock at time t+1p_grid::Vector{Float64}: Grid points for the price of capitaltrans_mat::Matrix{Float64}: Transition matrixβ::Real: Discount factortol::Real: Tolerance for convergencemax_iter::Integer: Maximum number of iterationskwargs...: Additional keyword arguments forfoc,env, andlom
Returns
i_k_exog::Matrix{Float64}: Policy function for the capital stock at time titer::Integer: Number of iterations until convergence
Throws
error: If the algorithm does not converge aftermax_iteriterations