Deterministic Growth Model Dynamic Program

(This is my version of the example at Sargent and Stachurski’s quant-econ website. Please observe the license file at the root of that repository.)

In this notebook we’ll implement the deterministic growth model as a dynamic programming problem. We will assume log utility to get a closed form solution. Remember that the problem is defined as \[\begin{align} V(k) &= \max_{0<k'<f(k)} \ln(f(k) - k') + \beta V(k')\\ f(k) & = k^\alpha\\ k_0 & \text{ given} \end{align}\]

Representing a function on \(\mathbb{R}\) in a computer

Fire up R

Next, because of our log assumption, we know that there is a closed form solution here. It is characterized by 2 constants \(c_1,c_2\). We know the true solution to the value function, denoted \(V^*\):

We will now apply the bellman operator to the functional in the above definition. The operator takes a current guess \(V^i\) and returns the next iterate \(V^{i+1}\). We define the operator as \[\begin{align} T(V)(k) =& \max_{0<k'<f(k)} \ln(f(k) - k') + \beta V(k') \\ V^{i+1}(k) =& \max_{0<k'<f(k)} \ln(f(k) - k') + \beta V^{i}(k') \end{align}\]

Now we can start the value function iteration:

Fork me on GitHub