text: In addition to what’s in Anaconda, this lecture will need the following libraries:
  !pip install --upgrade quantecon
  Overview library
  Let’s start with some imports:
  import numpy as np import matplotlib.pyplot as plt %matplotlib inline import quantecon as qe import scipy.sparse as sparse from quantecon import compute_fixed_point from quantecon.markov import DiscreteDP
  How to Read this Lecture¶
  We use dynamic programming many applied lectures, such as
  The objective of this lecture is to provide a more systematic and theoretical treatment, including algorithms and implementation while focusing on the discrete case.
  Code¶..
  The code for solving discrete DPs is available in ddp.py from the QuantEcon.py from our introductory lecture series, we solve a benchmark model that has an analytical solution.
  The exercise is to replicate this solution using
  DiscreteDP.
  Setup¶
  Details of the model can be found in the lecture on optimal growth.')
  178 ms ± 1.46 ms per loop (mean ± std. dev. of 7 runs, 10 loops each) 18.1 ms ± 197 µs per loop (mean ± std. dev. of 7 runs, 100 loops each) 20.7 ms ± 390 µs per loop (mean ± std. dev. of 7 runs, 10 loops each).580e-03 2 4.070e+00 2.591e-03 Iteration Distance Elapsed (seconds) --------------------------------------------- 1 5.518e+00 9.403e-04 2 4.070e+00 1.760e-03 3 3.866e+00 2.567e-03 4 3.673e+00 3.303e-03 Iteration Distance Elapsed (seconds) --------------------------------------------- 1 5.518e+00 9.582e-04 2 4.070e+00 1.858e-03 3 3.866e+00 2.684e-03 4 3.673e+00 3.481e-03 5 3.489e+00 4.201e-03 6 3.315e+00 4.897e-03
   #().