Discrete Dynamic Programming

Author

Pablo Winant

Markov Chains

A worker’s employment dynamics obey the stochastic matrix

\[P = \begin{bmatrix} 1-\alpha & \alpha \\ \beta & 1-\beta \end{bmatrix}\]

\[P = \begin{bmatrix} 1-\alpha & ... \\ \beta & ... \end{bmatrix}\]

with \(\alpha\in(0,1)\) and \(\beta\in (0,1)\). First line corresponds to employment, second line to unemployment.

Which is the stationary equilibrium? (choose any value for \(\alpha\) and \(\beta\))

In the long run, what will the the fraction \(p\) of time spent unemployed? (Denote by \(X_m\) the fraction of dates were one is unemployed)

Illustrate this convergence by generating a simulated series of length 10000 starting at \(X_0=1\). Plot \(X_m-p\) against \(m\). (Take \(\alpha=\beta=0.1\)).

Basic Asset Pricing model

A financial asset yields dividend \((x_t)\), which follows an AR1. It is evaluated using the stochastic discount factor: \(\rho_{0,t} = \beta^t \exp(y_t)\) where \(\beta<1\) and \(y_t\) is an \(AR1\). The price of the asset is given by \(p_0 = \sum_{t\geq 0} \rho_{0,t} U(x_t)\) where \(U(u)=\exp(u)^{0.5}/{0.5}\). Our goal is to find the pricing function \(p(x,y)\), which yields the price of the asset in any state.

Write down the recursive equation which must be satisfied by \(p\).

\[p_t = U(x_t) + \beta E_t \left[ \frac{e^{y_{t+1}}}{e^{y_t}} p_{t+1} \right]\]

Compute the ergodic distribution of \(x\) and \(y\).

Discretize processes \((x_t)\) and \((y_t)\) using 2 states each. How would you represent the unknown \(p()\)?

Solve for \(p()\) using successive approximations

Solve for \(p()\) by solving a linear system (homework)

Asset replacement (from Compecon)

At the beginning of each year, a manufacturer must decide whether to continue to operate an aging physical asset or replace it with a new one.

An asset that is \(a\) years old yields a profit contribution \(p(a)\) up to \(n\) years, at which point, the asset becomes unsafe and must be replaced by law.

The cost of a new asset is \(c\). What replacement policy maximizes profits?

Calibration: profit \(p(a)=50-2.5a-2.5a^2\). Maximum asset age: 5 years. Asset replacement cost: 75, annual discount factor \(\delta=0.9\).

p(a) = 50-2.5a-2.5a^2
p (generic function with 1 method)
using Plots
plot( [p(i) for i=0:5])

Define kind of problem, the state space, the actions, the reward function, and the Bellman updating equation

kind of problem: - discrete/finite state and actions space - infinite horizon - discrete dynamic programming problem (d.m.d.p.)

  • state-space: asset age \(a\in[0,1,2,3,4,5]\)
  • actions: \(x(a)\) keep/replace (\(\text{replace} in false/true\) if a<5)

Bellman updating equation:

\[ V(a) ← p(a) + \delta \begin{cases} V(0) - c \ \text{if x(a)=true} \\ V(a+1) \text{if x(a)=false} \\ V(0)-c \text{if a=5}\end{cases} \]

Solve the problem using Value Function Iteration

function bellman_step()

Solve the problem using Policy Iteration. Compare with VFI.