Thin Plate Splines are explained here, and a Mathematica implementation of that for real samples { { x1, y2, z1 }, { x2, y2, z2 }, ... , { xn, yn, zn } } is given here. As I understand it, the algorithm gives the function $f(x, y)$ that interpolates through the samples { { xi, yi, zi }, ... } and minimizes the bending energy $\int _{-\infty }^{\infty }\int _{-\infty }^{\infty }(D[f[x,y],\{x,1\}]^2+D[f[x,y],\{x,2\}]^2)dx$ $dy$. Now suppose I have the following:
data = {{1.0, 4.2}, {2.0, 9.3}, {4.0, 7.1}, {5.0, 4.3}, {8.0,
5.7}, {9.0, 10.2}, {10.0, 10.6}, {12.0, 7.2}};
How would I find the function $f(x)$ that interpolates the {xi,yi} data samples, and minimizes the bending energy $\int _{-\infty }^{\infty } (f''[x])^2 dx.$ ?
****** Edit ******
The Mathematica implementation I refer to above is the answer by J.M.
I give an improvement on that implementation below:
ThinPlateInterpolation::usage = "ThinPlateInterpolation[{{x1,y1,z1},{x2,y2,z2}..}] returns a CompiledFunction that gives a smooth interpolation between the points provided. The function returned is a function of two real numbers.";
ThinPlateInterpolation[points_?(And[Last[Dimensions@#] === 3, 3 <= First[Dimensions@#],MatrixQ[#, Element[#, Reals] &]] &)]:=
Module[{xs, ys, zs, xys, len, func, m, b, xx,yy},
{xs, ys, zs} = N@Transpose[points];
xys = Transpose[{xs, ys}];
len = Length[xs];
func = Compile[{{x0, _Real}, {y0, _Real},{xsys, _Real,2},{n, _Integer}},
Join[
With[{abs = Norm[#]},
If[abs == 0.0, 0.0, abs^2* Log[abs]]] & /@ (Table[{x0, y0},n] - xsys),
{1.0, x0, y0}]
];
m = func[#1, #2, xys, len] & @@@ xys;
m = m~Join~{ConstantArray[1.0, len]
~Join~{0., 0., 0.},
xs~Join~{0., 0., 0.}, ys~Join~{0., 0., 0.}};
b=zs~Join~{0., 0., 0.};
Compile @@ {{{xx, _Real}, {yy, _Real}},
Quiet[func[xx, yy, xys,len].
LinearSolve[m, b], {LinearSolve::luc,CompiledFunction::cfsa}]}
]
