Jump to content

Multidimensional interpolation: Difference between revisions

From Wikibase
fix undefined polynomial name f → p when marking the query point; AI-assisted (RonzzWikiCowriter) (via update-page on MediaWiki MCP Server)
Line 262: Line 262:


{{Hidden example}}
{{Hidden example}}
'''Surface temperature over a square of weather stations, by successive 1D interpolation.'''
'''Surface temperature over a grid of weather stations (particular value by successive 1D interpolations)'''


Take the same sixteen weather stations as above.
Retake the same example as in [[#grid interpolation]]:
 
Sixteen weather stations sitting in a $4^\circ \times 4^\circ$ grid measure surface temperature at various latitudes and longitudes.
 
{| class="wikitable"
|+ Temperature ($^\circ$C) at each station
! latitude $\downarrow$ / longitude $\rightarrow$ !! $0^\circ$E !! $1^\circ$E !! $2^\circ$E !! $3^\circ$E
|-
! $53^\circ$N
| 18.4 || 19.1 || 20.6 || 21.8
|-
! $52^\circ$N
| 20.1 || 20.9 || 22.3 || 23.5
|-
! $51^\circ$N
| 21.7 || 22.5 || 23.9 || 25.0
|-
! $50^\circ$N
| 22.8 || 23.6 || 24.9 || 26.1
|}


What is the interpolated temperature at $51.6^\circ \textbf{N}, 1.4^\circ \textbf{E}$?
What is the interpolated temperature at $51.6^\circ \textbf{N}, 1.4^\circ \textbf{E}$?
Line 270: Line 289:
'''Algebraic solution''':
'''Algebraic solution''':


'''Step 1: interpolate in $x_1$ (latitude).''' Fix the longitude at each of its four known values, and interpolate the four readings along latitude with the one-dimensional Lagrange polynomial, evaluated at $x_1^*=51.6$:
'''Step 1: interpolate in $x_1$ (latitude).''' Interpolate the four readings of different latitudes with the one-dimensional Lagrange polynomial at each of the four known longitutdes,then evaluate the interpolating functions at $x_1^*=51.6$:


$$
$$
<!-- first develop the Lagrange polynomials at each longitude algebraically -->
L^{(x_1)}_{1}(51.6)=-0.056,\qquad L^{(x_1)}_{2}(51.6)=0.448,\qquad L^{(x_1)}_{3}(51.6)=0.672,\qquad L^{(x_1)}_{4}(51.6)=-0.064
L^{(x_1)}_{1}(51.6)=-0.056,\qquad L^{(x_1)}_{2}(51.6)=0.448,\qquad L^{(x_1)}_{3}(51.6)=0.672,\qquad L^{(x_1)}_{4}(51.6)=-0.064
$$
$$
Line 290: Line 310:
|}
|}


'''Step 2: interpolate in $x_2$ (longitude).''' Interpolate these four readings along longitude with the one-dimensional Lagrange polynomial in $x_2$, evaluated at $x_2^*=1.4$:
'''Step 2: interpolate in $x_2$ (longitude).''' Interpolate these four readings along longitude with the one-dimensional Lagrange polynomial in $x_2$, then evaluate at $x_2^*=1.4$:


<!-- This is actually wrong: only need to interpolate once with the four $y_{x_1^*,i_2} -->
$$
$$
<!-- first develop the Lagrange polynomial algebraically -->
L^{(x_2)}_{1}(1.4)=-0.064,\qquad L^{(x_2)}_{2}(1.4)=0.672,\qquad L^{(x_2)}_{3}(1.4)=0.448,\qquad L^{(x_2)}_{4}(1.4)=-0.056
L^{(x_2)}_{1}(1.4)=-0.064,\qquad L^{(x_2)}_{2}(1.4)=0.672,\qquad L^{(x_2)}_{3}(1.4)=0.448,\qquad L^{(x_2)}_{4}(1.4)=-0.056
$$
$$
Line 304: Line 326:
$$
$$


which agrees with the value obtained above from the full two-variable polynomial, without ever forming that polynomial: $4$ one-dimensional interpolations in latitude, followed by $1$ in longitude, sufficed.
which agrees with the value obtained in [[#grid interpolation]]
{{End hidden}}
{{End hidden}}



Revision as of 12:46, 28 October 2026

Languages: English · français · Esperanto

Multidimensional interpolation is the process of finding a multivariable function $f(x_1,\cdots,x_m)$ that for a definite set of datapoints $\{(x_{1,i},\cdots,x_{m,i},y_i)\mid i\in [0,n], i \in \mathbb{N}\}$ satisfies $f(x_{1,i},\cdots,x_{m,i})=y_i$.

Grid interpolation

via Lagrange polynomial in multiple variables

If a "grid" of $n^m$ datapoints, i.e., values of $y$ at all possible combinations of $n$ particular values in each of the $m$ variables

$$ \{(x_{1,i_1},\cdots,x_{m,i_m},y_{i_1,\cdots,i_m})\mid i_1,\cdots,i_m \in [0,n-1],\, i_1,\cdots,i_m \in \mathbb{N}\} $$

is known, then a multivariable-version of the Lagrange polynomial can be used to interpolate for $y$.

$$ P(x_1,\cdots,x_m)=\sum_{i_1=0}^{n-1}\cdots\sum_{i_m=0}^{n-1}y_{i_1,\cdots,i_m}\prod_{j=1}^{m}L^{(x_j)}_{i_j}(x_j),\qquad L^{(x_j)}_{i_j}(x_j)=\prod_{\substack{k=0\\k\neq i_j}}^{n-1}\frac{x_j-x_{j,k}}{x_{j,i_j}-x_{j,k}} $$

which is a multi-variable polynomial of degree at most $n-1$ in each variable unique for each set of datapoints.

Similar to the one-dimensional Lagrange polynomials,

$$ L^{(x_j)}_{i_j}(x_j)= \begin{cases} 1, & x_j=x_{j,i_j},\\ 0, & x_j=x_{j,i_k},\, i_k \in [0,n-1],\, i_k \neq i_j,\, i_k \in \mathbb{N} \end{cases} $$

which guarantees that $P(x_1,\cdots,x_m)=y(x_1,\cdots,x_m)$ at all datapoints.[1]

$P(x_1,\cdots,x_m)$ is also known as the tensor product Lagrange interpolant.

Pointwise interpolation

Pointwise interpolation estimates the value of $y$ at one particular point, $y(x_1^*,\cdots,x_m^*)$, without constructing a general interpolating function.

via successive 1D interpolation in each variable

If a "grid" of $n^m$ datapoints, i.e., values of $y$ at all possible combinations of $n$ particular values in each of the $m$ variables

$$ \{(x_{1,i_1},\cdots,x_{m,i_m},y_{i_1,\cdots,i_m})\mid i_1,\cdots,i_m \in [0,n-1],\, i_1,\cdots,i_m \in \mathbb{N}\} $$

is known, then first perform $n^{m-1}$ 1D interpolations in $x_1$, fixing $x_2,\cdots,x_m$ at all known values, obtaining $n^{m-1}$ interpolating functions $f^{(x_1)}_{i_2,i_3,\cdots,i_m}(x_1)$

Now evaluate each $f^{(x_1)}$ at $x_1=x_1^*$ to obtain $n^{m-1}$ interpolated datapoints

$$ \{(x_1^*,x_{2,i_2},\cdots,x_{m,i_m},y_{x_1^*,i_2,\cdots,i_m})\mid i_2,\cdots,i_m \in [0,n-1],\, i_2,\cdots,i_m \in \mathbb{N}\} $$

Then perform $n^{m-2}$ 1D interpolations in $x_2$, fixing $x_3,\cdots,x_m$ at all known values, obtaining $n^{m-2}$ interpolating functions $f^{(x_2)}_{i_3,\cdots,i_m}(x_2)$

Now evaluate each $f^{(x_2)}$ at $x_2=x_2^*$ to obtain $n^{m-2}$ interpolated datapoints

$$ \{(x_1^*,x_2^*,x_{3,i_3}, \cdots,x_{m,i_m},y_{x_1^*,x_2^*,i_3,\cdots,i_m})\mid i_3,\cdots,i_m \in [0,n-1],\, i_3,\cdots,i_m \in \mathbb{N}\} $$

Then perform $n^{m-3}$ 1D interpolations in $x_3$, $n^{m-4}$ 1D interpolations in $x_4$, $\ldots$, $n$ 1D interpolations in $x_{m-1}$, and finally $1$ 1D interpolation in $x_m$ to obtain one interpolating function $f^{(x_m)}$.

Then the estimate of $y$ at $(x_1^*,\cdots,x_m^*)$ is $f^{(x_m)}(x_m^*)$.[2]

References