Skip to article content
Back to Article
Multivariate Interpolation on Unstructured Grids
Download Article

Multivariate Interpolation on Unstructured Grids

This section presents alternative interpolation methods for non-rectilinear grids. First, I present the relatively simple case of fast warped interpolation on a curvilinear grid, which improves upon the interpolation in White (2015). Then, I present a machine learning approach to interpolation on unstructured grids based on Gaussian Process Regression as presented in Scheidegger & Bilionis (2019).

1Unstructured Grids

Unstructured interpolation arises in many dynamic programming applications when using the Endogenous Grid Method because the first-order conditions might be highly non-linear and non-monotonic, or because boundary constraints induce kinks in the policy and value functions. In these cases, the grid points generated by the EGM step are not evenly spaced, leading to the need for curvilinear interpolation. We saw in the previous subsection an approach to curvilinear interpolation based on White (2015) that is incapable of interpolation on structured grids. A similar approach was presented in Ludwig & Schön (2018) which used Delaunay interpolation. However, this approach is not well suited for our purposes because triangulation can be computationally intensive and slow, often offsetting the efficiency gains from the Endogenous Grid Method.

As an alternative to these methods, I introduce the use of Gaussian Process Regression (GPR) along with the Endogenous Grid Method. GPR is computationally efficient, and tools exist to easily parallelize and take advantage of hardware such as Graphics Processing Units (GPU)[1].

1.1Gaussian Process Regression

A Gaussian Process is an infinite dimensional random process for which every subset of random variables is jointly Gaussian or has a multivariate normal distribution.

XN(μ,Σ)s.t.xiN(μi,σii)andσij=E[(xiμi)(xjμj)]i,j{1,,n}.\begin{gathered} \mathbf{X} \sim \mathcal{N}(\mathbf{\mu}, \mathbf{\Sigma}) \quad \text{s.t.} \quad x_i \sim \mathcal{N}(\mu_i, \sigma_ {ii}) \\ \text{and} \quad \sigma_{ij} = \Ex[(x_i - \mu_i)(x_j - \mu_j)] \quad \forall i,j \in \{1, \ldots, n\}. \end{gathered}

where

X=[x1x2xn]μ=[μ1μ2μn]Σ=[σ11σ12σ1nσ21σ22σ2nσn1σn2σnn].\mathbf{X} = \begin{bmatrix} x_1 \\ x_2 \\ \vdots \\ x_n \end{bmatrix} \quad \mathbf{\mu} = \begin{bmatrix} \mu_1 \\ \mu_2 \\ \vdots \\ \mu_n \end{bmatrix} \quad \mathbf{\Sigma} = \begin{bmatrix} \sigma_{11} & \sigma_{12} & \cdots & \sigma_{1n} \\ \sigma_{21} & \sigma_{22} & \cdots & \sigma_{2n} \\ \vdots & \vdots & \ddots & \vdots \\ \sigma_{n1} & \sigma_{n2} & \cdots & \sigma_{nn} \end{bmatrix}.

Being infinitely dimensional, a Gaussian Process can be used to represent a probability distribution over the space of functions in nn dimensions. Thus, a Gaussian Process Regression is used to find the best fit function to a set of data points.

P(fX)=N(fm,K)\mathbb{P}(\mathbf{f} | \mathbf{X}) = \mathcal{N}(\mathbf{f} | \mathbf{m}, \mathbf{K})

where f\mathbf{f} is the vector of function values at the points X\mathbf{X}, m\mathbf{m} is the mean of the function, and K\mathbf{K} is a kernel function that describes the covariance between the function values at different points.

A standard kernel function is the squared exponential kernel, or the radial basis function kernel, which is defined as

k(xi,xj)=σf2exp(12l2(xixj)(xixj)).k(\mathbf{x}_i, \mathbf{x}_j) = \sigma^2_f \exp\left(-\frac{1}{2l^2} (\mathbf{x}_i - \mathbf{x}_j)' (\mathbf{x}_i - \mathbf{x}_j)\right).

Using GPR to interpolate a function ff, we can both predict the value of the function at a point x\mathbf{x}_* and the uncertainty in the prediction, which provides useful information as to the accuracy of the approximation.

1.2An example of the GPR

In Figure 7, we see the function we are trying to approximate along with a sample of data points for which we know the value of the function. In practice, the value of the function is unknown and/or expensive to compute, so we must use a limited amount of data to approximate it.

The true function that we are trying to approximate and a sample of data points.

Figure 7:The true function that we are trying to approximate and a sample of data points.

As we discussed, a Gaussian Process is an infinite dimensional random process which can be used to represent a probability of distributions over the space of functions. In Figure 8, we see a random sample of functions from the GPR posterior, which is a Gaussian Process conditioned on fitting the data. From this small sample of functions, we can see that the GP generates functions that fit the data well, and the goal of GPR is to find the one function that best fits the data given some hyperparameters by minimizing the negative log-likelihood of the data.

A random sample of functions from the GPR posterior that fit the data. The goal of GPR is to find the function that best fits the data.

Figure 8:A random sample of functions from the GPR posterior that fit the data. The goal of GPR is to find the function that best fits the data.

In Figure 9, we see the result of GPR with a particular parametrization[2] of the kernel function. The dotted line shows the true function, while the blue dots show the known data points. GPR provides the mean function which best fits the data, represented in the figure as an orange line. The shaded region represents a 95% confidence interval, which is the uncertainty of the predicted function. Along with finding the best fit of the function, GPR provides the uncertainty of the prediction, which is useful information as to the accuracy of the approximation.

GPR finds the function that best fits the data given some hyperparameters. GPR then optimizes over the parameter space to find the function that minimizes the negative log-likelihood of the data.

Figure 9:GPR finds the function that best fits the data given some hyperparameters. GPR then optimizes over the parameter space to find the function that minimizes the negative log-likelihood of the data.

Footnotes
  1. Gardner et al. (2018)

  2. For details see notebook.

References
  1. White, M. N. (2015). The method of endogenous gridpoints in theory and practice. Journal of Economic Dynamics & Control, 60, 26–41. 10.1016/j.jedc.2015.08.001
  2. Scheidegger, S., & Bilionis, I. (2019). Machine learning for high-dimensional dynamic stochastic economies. Journal of Computational Science, 33, 68–82. 10.1016/j.jocs.2019.03.004
  3. Ludwig, A., & Schön, M. (2018). Endogenous Grids in Higher Dimensions: Delaunay Interpolation and Hybrid Methods. Computational Economics, 51(3), 463–492. 10.1007/s10614-016-9611-2
  4. Gardner, J. R., Pleiss, G., Bindel, D., Weinberger, K. Q., & Wilson, A. G. (2018). GPyTorch: Blackbox Matrix-Matrix Gaussian Process Inference with GPU Acceleration. Advances in Neural Information Processing Systems.
Content
The EGM^n in Higher Dimensions
Content
Conditions for using the Sequential Endogenous Grid Method