'''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$.
'''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$.
== Methods ==
== Grid interpolation ==
=== Grid interpolation ===
=== via Lagrange polynomial in multiple variables ===
If a "grid" of $n^m$ datapoints is known, one on each combination of $n$ nodes in each of the $m$ 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
$$
$$
Line 11:
Line 11:
$$
$$
then the interpolant is the multivariable Lagrange polynomial
is known, then a multivariable-version of the Lagrange polynomial can be used to interpolate for $y$.
where $L^{(j)}_i$ is the [[Polynomial_interpolation#Lagrange_polynomial|Lagrange basis polynomial]] of the variable $x_j$, built on that variable's $n$ nodes.
which is a multi-variable polynomial of degree at most $n-1$ in each variable unique for each set of datapoints.
Each factor $L^{(j)}_{i_j}(x_j)$ equals one at the node $x_{j,i_j}$ and zero at the other $n-1$ nodes of $x_j$. The product of the $m$ factors is therefore one at the single datapoint $(x_{1,i_1},\cdots,x_{m,i_m})$ and zero at every other datapoint, so each of the $n^m$ terms carries exactly its own reading and vanishes at all the rest, and the sum passes through all $n^m$ datapoints.
Similar to the [[Polynomial_interpolation#Lagrange_polynomial|one-dimensional Lagrange polynomial]]s,
The result is the '''tensor product''' interpolant, and it is unique among polynomials of degree at most $n-1$ in each variable: a difference of two of them vanishes at all $n^m$ nodes, and such a difference, read as a polynomial of degree at most $n-1$ in $x_1$, has $n$ roots for every fixed choice of the other variables, so each of its coefficients vanishes at those choices, one variable at a time<ref>{{#cite:Q2392}}</ref>. In the Lagrange basis the coefficients are the readings themselves, so nothing is solved for: the $n^m$ coefficients and the $n^m$ datapoints are the same numbers.
which guarantees that $P(x_1,\cdots,x_m)=y(x_1,\cdots,x_m)$ at all datapoints.<ref>{{#cite:Q2392}}</ref>
<blockquote>
$P(x_1,\cdots,x_m)$ is also known as the '''tensor product Lagrange interpolant'''.
</blockquote>
{{Hidden example}}
{{Hidden example}}
'''Surface temperature over a square of weather stations.''' Sixteen stations sit on a $4\times4$ grid, spaced $1^\circ$ of longitude apart from west to east and $1^\circ$ of latitude apart from south to north. The readings are synthetic, constructed for this example:
'''Surface temperature over a square of weather stations.'''
Sixteen weather stations sitting in a $4^\circ \times 4^\circ$ grid measure surface temperature at various latitudes and longitudes.
With $m=2$ and $n=4$ the sum has $n^m=16$ terms, one per station. Number the longitude nodes $x_{1,1}=0$, $x_{1,2}=1$, $x_{1,3}=2$, $x_{1,4}=3$ and the latitude nodes $x_{2,1}=50$, $x_{2,2}=51$, $x_{2,3}=52$, $x_{2,4}=53$, so that $i_1=1$ is the column at $0^\circ$E and $i_2=1$ the row at $50^\circ$N, the bottom row of the table:
What is the interpolated temperature at $51.6^\circ \textbf{N}, 1.4^\circ \textbf{E}$?
'''Algebraic solution''':
Let $x_1$ represent the latitude, $x_2$ represent the longitude, and denote the surface temperature reading at row $i_1$, column $i_2$ by $y_{i_1,i_2}$.
Then the interpolating multi-variable Lagrange polynomial is
where $y_{i_1,i_2}$ is the reading in column $i_1$ and row $i_2$, and $L_{ji_j}$ is the general $L^{(j)}_{i_j}$ with the node index counted from $1$ rather than from $0$.
where
'''The eight basis polynomials.''' Four are built on the longitude nodes $0,1,2,3$ and are functions of $x_1$; four are built on the latitude nodes $50,51,52,53$ and are functions of $x_2$:
Collecting like powers reduces this to 16 monomials, of degree at most 3 in each variable; the large coefficients come from the latitude nodes sitting at 50 to 53 rather than at 0 to 3:
The individual terms are of order $10^4$ and cancel down to $22$, so several digits are lost and the sum has to be taken exactly; the code below does that.<!-- Suggestion: with terms of order 10^4 against a result of 22, about three digits cancel, so in IEEE double precision roughly thirteen of the sixteen remain and the float64 sum is already good to about 10^-11. If the point is precision rather than method, "the sum has to be carried in double precision" (or "in single precision several digits would be lost") may be the intended claim. --> The nested route of [[#Pointwise_interpolation|pointwise interpolation]] regroups these same 16 terms into two passes, with numbers no larger than the readings, and reaches the same result with nothing to cancel; the developed form is the harder of the two routes to evaluate, not the easier.
# one term per station: reading times its x1 polynomial times its x2 polynomial
# one term per station: reading times its x1 polynomial times its x2 polynomial
f = sp.expand(sum(sp.Rational(str(temperature[j][i])) * L1[i] * L2[j]
p = sp.expand(sum(sp.Rational(str(temperature[j][i])) * L1[j] * L2[i]
for j in range(4) for i in range(4)))
for j in range(4) for i in range(4)))
print(f)
print(p)
value = f.subs({x1: sp.Rational('1.4'), x2: sp.Rational('51.6')}) # 1.4 E, 51.6 N, exact
value = p.subs({x1: sp.Rational('51.6'), x2: sp.Rational('1.4')}) # 51.6 N, 1.4 E
print(value)
print(value)
print(float(value))
print(float(value))
</syntaxhighlight>
</syntaxhighlight>
The two coordinates go in as the decimals they are, and <code>sp.Rational</code> reads a decimal string exactly, so nothing is rounded: <code>value</code> is the exact $\tfrac{3455657}{156250}$, which prints as <code>22.1162048</code>, the number the developed form gave above.
'''Extra''': To plot the interpolating surface
Plotting the surface needs the sum evaluated on a mesh of arguments. This snippet stands on its own:
<syntaxhighlight lang="python" copy>
<syntaxhighlight lang="python" copy>
Line 165:
Line 180:
import matplotlib.pyplot as plt
import matplotlib.pyplot as plt
longitude = np.array([0.0, 1.0, 2.0, 3.0]) # nodes of x1
latitude = np.array([50.0, 51.0, 52.0, 53.0]) # nodes of x1
latitude = np.array([50.0, 51.0, 52.0, 53.0]) # nodes of x2
longitude = np.array([0.0, 1.0, 2.0, 3.0]) # nodes of x2
[[File:Bicubic grid interpolation temperature.png|thumb|none|560px|alt=Three-dimensional plot of a gently curving temperature surface over a longitude-latitude grid, with the sixteen station readings marked as red dots and one query point marked with a cross|The interpolating surface through the sixteen station readings, the tensor product of four longitude and four latitude basis polynomials. The query point at $1.4^\circ$E, $51.6^\circ$N is marked with a cross.]]
[[File:Bicubic grid interpolation temperature.png|thumb|none|560px|alt=Three-dimensional plot of a gently curving temperature surface over a longitude-latitude grid, with the sixteen station readings marked as red dots and one query point marked with a cross|The interpolating surface through the sixteen station readings constructed via Lagrange polynomials in two variables. $1.4^\circ$E, $51.6^\circ$N is marked with a cross.]]
The temperature falls from about $26\ ^\circ$C in the south-east to about $18\ ^\circ$C in the north-west, so the surface is dominated by a plane tilted towards the north-west, with a gentler curvature across it.
As observed, the surface is dominated by a plane tilted gently downwards from the south-east towards the north-west, predicting a gentle decrease in temperature along that direction.
{{End hidden}}
{{End hidden}}
=== Pointwise interpolation ===
== Pointwise interpolation ==
Pointwise interpolation (or '''point evaluation''') asks only for the value of $f$ at one new point $(x_1^*,\cdots,x_m^*)$ inside the data range, without constructing $f$ anywhere else. It says what is to be computed, not how $f$ is defined: the interpolation scheme, whether piecewise linear, a cubic spline, or a single polynomial, fixes the values everywhere, and pointwise evaluation fixes that only one of them is wanted. Building the whole interpolant is a separate undertaking, and the heavier one: the developed form of a high-degree polynomial in many variables runs to $n^m$ terms and, as [[#Grid_interpolation|grid interpolation]] showed, evaluating it develops large cancellations. The passes below never form it.
Pointwise interpolation estimates the value of $y$ at one particular point, $y(x_1^*,\cdots,x_m^*)$, without constructing a general interpolating function.
'''One variable at a time.''' A grid is a family of straight lines, one along each variable, and each of those lines is an ordinary one-dimensional dataset. A one-dimensional rule applied to the lines of one direction, and then to the lines of the next, reaches the query point, and the rule itself is a free choice. [[Person:Jeffrey R. Chasnov|Chasnov]] states the two-variable case in full: on an $(n+1)\times(n+1)$ grid, first perform $n+1$ one-dimensional interpolations in one variable, giving the interpolant at the $n+1$ points $(x_0,y^*),\cdots,(x_n,y^*)$ of the line crossed at the target coordinate, then a single one-dimensional interpolation in the other variable, giving the value at $(x^*,y^*)$. The two- and three-dimensional interpolation routines of numerical software address exactly this problem; MATLAB's are <code>interp2</code> and <code>interp3</code><ref>{{#cite:Q2421}}</ref>.
=== via successive 1D interpolation in each variable ===
'''The rule, named once.''' Let
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
be the value at $t$ that the chosen rule gives to readings $v_0,\cdots,v_{n-1}$ taken at the nodes $t_0,\cdots,t_{n-1}$ of one variable. The rule may be [[Piecewise_linear_interpolation|piecewise linear]], a cubic spline with whatever end condition ([[Cubic_spline_interpolation|cubic spline interpolation]]), a monotone or shape-preserving scheme, or a single polynomial through the whole line. Everything below holds for any of them.
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)$
'''Two variables.''' With readings $y_{i_1,i_2}$ on $n$ nodes per axis, the first pass holds $x_1$ at each of its nodes in turn and interpolates the $n$ readings of that line in $x_2$:
Now evaluate each $f^{(x_1)}$ at $x_1=x_1^*$ to obtain $n^{m-1}$ interpolated datapoints
The $n$ values $y^*_{i_1}$ are the interpolant at $(x_{1,i_1},x_2^*)$: the grid's lines, crossed at the target $x_2^*$. They are readings on a single line of the other direction, so one more pass finishes:
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
The first pass costs $n$ one-dimensional interpolations and the second costs $1$.
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^*)$.<ref>{{#cite:Q2421}}</ref>
{{Hidden example}}
'''Surface temperature over a grid of weather stations (particular value by successive 1D interpolations)'''
'''$m$ variables.''' Each pass removes one variable: the first leaves $n^{m-1}$ values, one per combination of the remaining nodes, the next $n^{m-2}$, and so on down to one, so the passes cost $n^{m-1}, n^{m-2}, \cdots, n^0$ interpolations whatever the rule:
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.
\sum_{k=0}^{m-1}n^{k}=\frac{n^{m}-1}{n-1}
$$
{| class="wikitable"
{| class="wikitable"
|+ One-dimensional interpolations for one query point, with $n=4$ nodes per axis
|+ Temperature ($^\circ$C) at each station
! $m$ !! first pass !! second pass !! third pass !! fourth pass !! total
'''What the rule changes, and what it does not.''' The passes run the same way for every rule, but what each pass has to read, and how smooth the result is, are the rule's doing:
What is the interpolated temperature at $51.6^\circ \textbf{N}, 1.4^\circ \textbf{E}$?
'''Algebraic solution''':
* a '''local''' rule, such as piecewise linear, reads only the two nodes bracketing the target on its line. Only the lines that bracket the target then need interpolating, so the work follows the stencil and not the grid: two lines in the first pass of the station example below, and two readings on each of them;
'''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 longitudes, then evaluate the interpolating functions at $x_1^*=51.6$.
* a '''global''' rule, such as a cubic spline or a single polynomial through the whole line, draws on every node of its line, so every line of every pass is interpolated. What is saved is then not the count of interpolations but everything that is never built: the coefficient form of the surface, and with it the cancellation that [[#Grid_interpolation|grid interpolation]] pays for;
* whichever the rule, each line interpolation reproduces the readings at its own nodes, so the composed value at a datapoint is exactly the reading there;
* smoothness is inherited: piecewise linear passes give a surface that is continuous but creased along the lines between cells, whereas spline passes give one that is smooth in each variable.
'''Rules linear in the readings.''' Nearly every rule computes its value as a weighted sum
whose weights $\varphi_k$ are fixed by the nodes and by $t$, but not by the readings: the hats of the two neighbouring nodes for a piecewise linear rule, the cardinal splines for a spline rule. Two passes with such a rule give
<blockquote>
The four Lagrange basis polynomials in $x_1$, built on the latitude nodes $50,51,52,53^\circ \textbf{N}$, are the same at every longitude.
in which the weights of the two directions multiply. The $n^2$ products are the same under either nesting of the two sums, and in $m$ variables under any order of the $m$ passes, so the order in which the variables are collapsed changes nothing<ref>{{#cite:Q2391}}</ref>. A rule that is not linear in its readings, such as a monotone or shape-preserving one, offers no such weights, and the passes may then answer differently in different orders.
Hence the four interpolated readings
'''The station grid again.''' Applied to the sixteen readings of [[#Grid_interpolation|grid interpolation]], the passes at $1.4^\circ$E, $51.6^\circ$N give, for three rules:
The last entry is the number that [[#Grid_interpolation|grid interpolation]] reaches by summing its 16 monomials, and not by accident: a line of four nodes has a single cubic piece, so on such a line the not-a-knot spline is the one cubic through its four readings, and the composed surface is the one that section builds. A longer line, or the natural end condition, departs from it; on these nearly planar readings the natural spline already differs in the fourth decimal, and on readings less nearly planar it would differ more.
'''Step 2: interpolate in $x_2$ (longitude).''' Interpolate the four interpolated readings $y_{51.6^\circ \textbf{N},i_2}$ with a one-dimensional Lagrange polynomial in $x_2$ (longitude$) to obtain the interpolating function $f^{(x_2)}(x_2)$. Evaluate $f$ at $x_2^*=1.4$ for $y(51.6,1.4)$.
The passes in code, with the rule passed in as an argument:
Four Lagrange basis polynomials, built on the longitude nodes $0,1,2,3^\circ \textbf{E}$:
Swapping the two variables in <code>nodes</code> and in <code>point</code> alike, and transposing the array of readings, returns the same three values, the two nestings differing only in the last bits of the floating-point sum.
which agrees with the value obtained in [[#Grid interpolation]].
{{End hidden}}
With the spline rule the passes touch the data twice: four longitude interpolations give $24.0936$, $23.0384$, $21.4328$, and $19.6656\ ^\circ$C on the rows at $50$, $51$, $52$, and $53^\circ$N, and one latitude interpolation of those four gives the reading at the query point. The piecewise linear rule touches four readings in all, which is the whole of its work.
<blockquote>
The piecewise scheme described above reads four readings instead of sixteen, and because these readings happen to be close to planar it also lands close: bilinear interpolation of the four stations surrounding the query point gives $22.100\ ^\circ$C, only $0.02\ ^\circ$C away from the grid interpolant. The two are not interchangeable, however: the bilinear interpolant is merely continuous where cells meet, whereas the grid interpolant is a single polynomial and therefore smooth everywhere.
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
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.
Surface temperature over a square of weather stations.
Sixteen weather stations sitting in a $4^\circ \times 4^\circ$ grid measure surface temperature at various latitudes and longitudes.
Temperature ($^\circ$C) at each station
latitude $\downarrow$ / longitude $\rightarrow$
$0^\circ$E
$1^\circ$E
$2^\circ$E
$3^\circ$E
$50^\circ$N
22.8
23.6
24.9
26.1
$51^\circ$N
21.7
22.5
23.9
25.0
$52^\circ$N
20.1
20.9
22.3
23.5
$53^\circ$N
18.4
19.1
20.6
21.8
What is the interpolated temperature at $51.6^\circ \textbf{N}, 1.4^\circ \textbf{E}$?
Algebraic solution:
Let $x_1$ represent the latitude, $x_2$ represent the longitude, and denote the surface temperature reading at row $i_1$, column $i_2$ by $y_{i_1,i_2}$.
Then the interpolating multi-variable Lagrange polynomial is
$$
P(x_1,x_2)=\sum_{i_1=1}^{4}\sum_{i_2=1}^{4}y_{i_1,i_2}\,L^{(x_1)}_{i_1}(x_1)\,L^{(x_2)}_{i_2}(x_2)
$$
importsympyasspx1,x2=sp.symbols('x1 x2')deflagrange_basis(nodes,x):"""The Lagrange basis polynomials on `nodes`, from the product formula."""basis=[]foriinnodes:p=sp.Integer(1)forkinnodes:ifk!=i:p*=(x-k)/(i-k)basis.append(sp.expand(p))returnbasislatitude=[50,51,52,53]# nodes of x1longitude=[0,1,2,3]# nodes of x2L1=lagrange_basis(latitude,x1)# L^(x1)_1 .. L^(x1)_4L2=lagrange_basis(longitude,x2)# L^(x2)_1 .. L^(x2)_4print(L1)print(L2)temperature=[[22.8,23.6,24.9,26.1],[21.7,22.5,23.9,25.0],[20.1,20.9,22.3,23.5],[18.4,19.1,20.6,21.8]]# row = latitude 50, 51, 52, 53; column = longitude 0, 1, 2, 3# one term per station: reading times its x1 polynomial times its x2 polynomialp=sp.expand(sum(sp.Rational(str(temperature[j][i]))*L1[j]*L2[i]forjinrange(4)foriinrange(4)))print(p)value=p.subs({x1:sp.Rational('51.6'),x2:sp.Rational('1.4')})# 51.6 N, 1.4 Eprint(value)print(float(value))
Extra: To plot the interpolating surface
importnumpyasnpimportmatplotlib.pyplotaspltlatitude=np.array([50.0,51.0,52.0,53.0])# nodes of x1longitude=np.array([0.0,1.0,2.0,3.0])# nodes of x2temperature=np.array([[22.8,23.6,24.9,26.1],[21.7,22.5,23.9,25.0],[20.1,20.9,22.3,23.5],[18.4,19.1,20.6,21.8]])# row = latitude, column = longitudedefL(nodes,x):"""The Lagrange basis polynomials on `nodes`, evaluated at x."""returnnp.array([np.prod([(x-k)/(i-k)forkinnodesifk!=i])foriinnodes])defp(x1,x2):"""2-variable Lagrange polynomial"""return(temperature*np.outer(L(latitude,x1),L(longitude,x2))).sum()lon_plot=np.linspace(0.0,3.0,121)lat_plot=np.linspace(50.0,53.0,121)surface=np.array([[p(x,y)foryinlon_plot]forxinlat_plot])fig=plt.figure(figsize=(9.0,6.8))ax=fig.add_subplot(111,projection="3d")ax.set_box_aspect((1.35,1.0,0.62))mesh_lon,mesh_lat=np.meshgrid(lon_plot,lat_plot)surf=ax.plot_surface(mesh_lon,mesh_lat,surface,cmap="RdYlBu_r",linewidth=0,antialiased=True,rstride=2,cstride=2,alpha=0.92)ax.scatter(np.tile(longitude,4),np.repeat(latitude,4),temperature.ravel(),s=70,color="#c0392b",edgecolor="black",linewidth=0.9,depthshade=False,label="16 weather stations")ax.scatter([1.4],[51.6],[p(51.6,1.4)],s=170,color="black",marker="X",depthshade=False,label=r"query point (1.4$^\circ$E, 51.6$^\circ$N)")ax.set_xlabel(r"longitude ($^\circ$E)",labelpad=10)ax.set_ylabel(r"latitude ($^\circ$N)",labelpad=10)ax.set_zlabel(r"temperature ($^\circ$C)",labelpad=8)ax.set_xticks(longitude)ax.set_yticks(latitude)ax.set_zlim(16.5,26.5)ax.view_init(elev=34,azim=-56)fig.colorbar(surf,shrink=0.55,pad=0.10,aspect=24,label=r"interpolated temperature ($^\circ$C)")ax.legend(loc="upper left",frameon=False,fontsize=9)plt.tight_layout()plt.show()
The interpolating surface through the sixteen station readings constructed via Lagrange polynomials in two variables. $1.4^\circ$E, $51.6^\circ$N is marked with a cross.
As observed, the surface is dominated by a plane tilted gently downwards from the south-east towards the north-west, predicting a gentle decrease in temperature along that direction.
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
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
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
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]
Surface temperature over a grid of weather stations (particular value by successive 1D interpolations)
Sixteen weather stations sitting in a $4^\circ \times 4^\circ$ grid measure surface temperature at various latitudes and longitudes.
Temperature ($^\circ$C) at each station
latitude $\downarrow$ / longitude $\rightarrow$
$0^\circ$E
$1^\circ$E
$2^\circ$E
$3^\circ$E
$50^\circ$N
22.8
23.6
24.9
26.1
$51^\circ$N
21.7
22.5
23.9
25.0
$52^\circ$N
20.1
20.9
22.3
23.5
$53^\circ$N
18.4
19.1
20.6
21.8
What is the interpolated temperature at $51.6^\circ \textbf{N}, 1.4^\circ \textbf{E}$?
Algebraic solution:
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 longitudes, then evaluate the interpolating functions at $x_1^*=51.6$.
Interpolated temperature ($^\circ$C) at $51.6^\circ$N
longitude $x_{2,i_2}$
$0^\circ$E
$1^\circ$E
$2^\circ$E
$3^\circ$E
$y_{x_1^*,i_2}$
20.7744
21.5808
22.9800
24.1352
Step 2: interpolate in $x_2$ (longitude). Interpolate the four interpolated readings $y_{51.6^\circ \textbf{N},i_2}$ with a one-dimensional Lagrange polynomial in $x_2$ (longitude$) to obtain the interpolating function $f^{(x_2)}(x_2)$. Evaluate $f$ at $x_2^*=1.4$ for $y(51.6,1.4)$.
Four Lagrange basis polynomials, built on the longitude nodes $0,1,2,3^\circ \textbf{E}$: