August 9, 2023

Motivation

  • Remember the optimal capital accumulation problem we solved last week:

\[V(k) = \max_{k'} u(c) + \beta V(k')\] \[c + k' = k^\alpha + (1-\delta)k.\]

  • We forced capital to be in discrete set:

\[D_k = \{k_1,k_2,...,K_N\},\]

  • and solved subject to the same constraint:

\[V(k) = \max_{k' \in D_k} u(c) + \beta V(k')\]

Problems

  • This is a good way to get started, but:
  1. It forces you to do optimization via grid search.
  2. Might need a lot of grid points to get a good approximation.
  3. The optimal decision might be between or outside the grid.
  4. Don’t know what agent does when between grid points.

Interpolation

  • Interpolation: Approximation of a function with a set of known points.
  • The mathematical science of connecting the dots.

Types of Interpolation

There are many ways to connect the dots because you can do whatever you want in between them.

Common ways:

  1. Polynomial Interpolation: Fit degree N polynomial to the data
    • Problem 1: Data points are not always on the fitted line.
    • Problem 2: Strange things can happen at the tails (Runge’s phenomenon)
  2. Linear/Spline Interpolation: Draw lines between points.
    • Linear: Assume that the line is straight.
    • Spline: Assume the line is a polynomial of degree N.

Linear interpolation

  • Discrete domain: \(\{x_1, x_2, ..., x_N\}\).
  • Discrete range: \(\{f(x_1), f(x_2), ..., f(x_N)\}\).

Linear interpolation L(x): When \(x \in [x_i, x_{i+1}]\)

\[ L(x) = f(x_i) + (x-x_i) \frac{f(x_{i+1}) - f(x_i)}{x_{i+1}-x_{i}}\]

Problems:

  1. Derivative can change drastically at grid points.
  2. Derivative is constant between grid points.

Linear Interpolation Examples

Cubic Spline Interpolation

  • Fit cubic polynomial between all points.
  • N points \((x_i, f(x_i))\). When \(x \in [x_i, x_{i+1}]\):

\[ S_i(x) = a_i + b_ix + c_ix^2 + d_ix^3\]

  • This adds some curvature to the approximation (not always a good thing!)
  • N points, so there are N-1 intervals and 4(N-1) coefficients.

Solving for Cubic Spline Coefficients

  • 2(N-1) end point conditions: \[S_i(x) = f(x_i) \text{ and } S_{i-1} = f(x_i)\]

  • 2(N-2) continuity of 1st and 2nd derivative conditions: \[S_{i-1}'(x_i) = S_i'(x_i) \text{ and } S_{i-1}''(x_i) = S_i''(x_i)\]

  • Two final equations: Assume derivatives at endpoints are equal to rise-over-run from nearest endpoints.

  • Benefits: Cubic Interpolation is smooth with continuous derivatives.

  • This can cause problems sometimes.

Cubic Spline Interpolation Examples

Multivariate Interpolation

-These methods can be extended to multivariate case.

  • Bivariate Linear Interpolation

  • Discrete domain: \(\{(x_1,y_1), (x_2,y_2), ..., (x_N,y_N)\}\).

  • Discrete range: \(\{f(x_1,y_1), f(x_2,y_2), ..., f(x_N,y_N)\}\).

Bivariate Linear Interpolation B(x,y): When \((x,y) \in [x_i, x_{i+1}]\times[y_i, y_{i+1}]\)

\[ B(x,y) = \frac{1}{(x_{i+1}-x_{i})(y_{i+1}-y_{i})} [x_{i+1}-x\hspace{1em} x-x_i] \\\times \left[\matrix{f(x_{i}, y_{i})\hspace{2em}f(x_i, y_{i+1}) \\ f(x_{i+1}, y_{i})\hspace{1em}f(x_{i+1}, y_{i+1})}\right]\left[\matrix{y_{i+1} - y \\ y - y_{i}}\right]\]