1

Linear interpolation between values $A$ and $B$ can be defined as:

$f(x) = A(1-x)+Bx$

Bilinear interpolation between values $A,B,C,D$ is defined as:

$f(x,y) = g(x)(1-y) + h(x)y$

where

$g(x) = A(1-x)+Bx$

and

$h(x) = C(1-x)+Dx$

So, bilinear interpolation can be described more compactly like this:

$f(x,y) = (A(1-x)+Bx)(1-y) + (C(1-x)+Dx)y$

You can continue the pattern for trilinear interpolation and higher.

Is there a formula to describe $N$-Dimensional linear interpolation in this manner?

Alan Wolfe
  • 1,299

2 Answers2

3

Suppose you wish to perform an $n$-dimensional linear interpolation between a sequence of values labelled $$a(\underbrace{\pm 1,\ldots,\pm 1}_{n\text{ signs}})$$

Then the formula would be: $$ f(x_1,x_2,\ldots,x_n)=\sum_{\sigma_1,\sigma_2,\ldots,\sigma_n\in \{\pm 1\}}a(\sigma_1,\sigma_2,\ldots,\sigma_n)\prod_{i=1}^n\left.\begin{cases}x_i,& \sigma_i=1\\1-x_i,&\sigma_i=-1\end{cases}\right\}. $$ To prove this formula is correct, simply induct on $n$.

pre-kidney
  • 30,884
3

Yes. You have data at the corners of an $N$ dimensional hypercube. If you name your points with subscripts in binary and your variables with numbers from $0$ to $N-1$ it becomes easy to see. For $N=3$ you would have $f(x_0,x_1,x_2)=A_{000}(1-x_0)(1-x_1)(1-x_2)+A_{001}x_0(1-x_1)(1-x_2)+A_{010}(1-x_0)x_1(1-x_2)\dots +A_{111}x_0x_1x_2$.
Everywhere the data point has a $0$ in the subscript corresponds to a term $(1-x_i)$ and everywhere the data point has a $1$ in the subscript you get a term $x_i$

Ross Millikan
  • 383,099