bilinear

View page source

dismod_at Bilinear Interpolation

Age Grid

We are given a grid of \(M\) age values \(\{ a_i \; | \; i = 0, \ldots , M-1 \}\).

Time Grid

We are also given a grid of \(N\) time values \(\{ t_j \; | \; j = 0, \ldots , N-1 \}\).

Function Grid

In addition, we are given a grid of function values to be interpolated

\[\left\{ \left. v_{i,j} = f( a_i , t_j ) \; \right| \; i = 0, \ldots , M-1 , j = 0 , \ldots , N-1 \right\} \; .\]

Interpolant

The corresponding interpolating function at age \(\alpha\) and time \(s\), \(f( \alpha , s )\) is defined as follows:

Bilinear

Consider the case where there is an index pair \(i < M-1\), \(j < N-1\) such that \(a_i \leq \alpha \leq a_{i+1}\) and \(t_j \leq s \leq t_{j+1}\). In this case the function is defined by

\[f( \alpha , s ) = \frac{a_{i+1} - \alpha}{a_{i+1} - a_i} \frac{t_{j+1} - s}{t_{j+1} - t_j} v_{i,j} + \frac{\alpha - a_i}{a_{i+1} - a_i} \frac{t_{j+1} - s}{t_{j+1} - t_j} v_{i+1,j} + \frac{a_{i+1} - s}{a_{i+1} - a_i} \frac{s - t_j}{t_{j+1} - t_j} v_{i,j+1} + \frac{\alpha - a_i}{a_{i+1} - a_i} \frac{s - t_j}{t_{j+1} - t_j} v_{i+1,j+1}\]

Note that

\(( \alpha , s)\)

\(f( \alpha, s)\)

\(( a_i , t_j )\)

\(v_{i,j}\)

\(( a_i , t_{j+1} )\)

\(v_{i,j+1}\)

\(( a_{i+1} , t_j )\)

\(v_{i+1,j}\)

\(( a_{i+1} , t_{j+1} )\)

\(v_{i+1,j+1}\)

Below Minimum Age

Consider the case where \(\alpha < a_0\) and there is an index \(j < N-1\) such that \(t_j \leq s \leq t_{j+1}\). In this case the function is defined by

\[f( \alpha , s ) = \frac{t_{j+1} - s}{t_{j+1} - t_j} v_{0,j} + \frac{s - t_j}{t_{j+1} - t_j} v_{0,j+1}\]

Above Maximum Age

Consider the case where \(a_{M-1} < \alpha\) and there is an index \(j < N-1\) such that \(t_j \leq s \leq t_{j+1}\). In this case the function is defined by

\[f( \alpha , s ) = \frac{t_{j+1} - s}{t_{j+1} - t_j} v_{M-1,j} + \frac{s - t_j}{t_{j+1} - t_j} v_{M-1,j+1}\]

Below Minimum Time

Consider the case where \(s < t_0\) and there is an index \(i < M-1\) such that \(a_i \leq \alpha \leq a_{i+1}\). In this case the function is defined by

\[f( \alpha , s ) = \frac{a_{i+1} - \alpha}{a_{i+1} - a_i} v_{i,0} + \frac{\alpha - a_i}{a_{i+1} - a_i} v_{i+1,0}\]

Above Maximum Time

Consider the case where \(t_{N-1} < s\) and there is an index \(i < M-1\) such that \(a_i \leq \alpha \leq a_{i+1}\). In this case the function is defined by

\[f( \alpha , s ) = \frac{a_{i+1} - \alpha}{a_{i+1} - a_i} v_{i,N-1} + \frac{\alpha - a_i}{a_{i+1} - a_i} v_{i+1,N-1}\]

Outside Both Limits

  1. If \(\alpha < a_0\) and \(s < t_0\), \(f( \alpha , s ) = v_{0,0}\).

  2. If \(\alpha < a_0\) and \(t_{N-1} < s\), \(f( \alpha , s ) = v_{0,N-1}\).

  3. If \(a_{M-1} < \alpha\) and \(t_{N-1} < s\), \(f( \alpha , s ) = v_{M-1,N-1}\).

  4. If \(a_{M-1} < \alpha\) and \(s < t_0\), \(f( \alpha , s ) = v_{M-1,0}\).

Plotting

Functions of age and time are usually plotted with age on the vertical axis and time on the horizontal axis. This is opposite the usual convention where the first variable is plotted on the horizontal axis and the second variable on the vertical axis.