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_EGMMethod
do_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 function
  • env::Function: Envelope condition function
  • lom::Function: Law of motion function
  • kp_grid::Vector{Float64}: Grid points for the capital stock at time t+1
  • p_grid::Vector{Float64}: Grid points for the price of capital
  • trans_mat::Matrix{Float64}: Transition matrix
  • β::Real: Discount factor
  • tol::Real: Tolerance for convergence
  • max_iter::Integer: Maximum number of iterations
  • kwargs...: Additional keyword arguments for foc, env, and lom

Returns

  • i_k_exog::Matrix{Float64}: Policy function for the capital stock at time t
  • iter::Integer: Number of iterations until convergence

Throws

  • error: If the algorithm does not converge after max_iter iterations
source