Apply a Tikhonov regularization, the functional to be minimized is
F = FD + lambda1 * F1 + lambda2 * F2
= sum_(i=1)^M (y_i-u(x_i))^2 +
+ lambda1 * dintegral (du/dx)^2+(du/dy)^2 dA +
+ lambda2 * dintegral (d^2u/dx^2)^2+(d^2u/dy^2)^2+2*(d^2u/dxdy) dA
With lambda1 = 0 and lambda2>0 this leads to a thin plate smoothing spline.
Parameters:
Return values:
See also: tpaps, regularization, demo regularization2D.
The following code
M = 100; lambda1 = 0; lambda2 = 0.05; x = 2*rand(M,1)-1; y = 2*rand(M,1)-1; z = x.*y + 0.1*randn(M,1); data = [x,y,z]; [grid,u] = regularization2D(data,[-1 1;-1 1],[50 50],lambda1,lambda2); figure() mesh(grid.x, grid.y,u) xlabel('x'); ylabel('y'); hold on plot3(data(:,1),data(:,2),data(:,3),'*b','Markersize',2) hold off view([30,30]);
Produces the following figure
Figure 1 |
---|
The following code
lambda1 = 0; lambda2 = 0.01; M = 4; angles = [1:M]/M*2*pi; data = zeros(M+1,3); data(M+1,3) = 1; data(1:M,1) = cos(angles); data(1:M,2) = sin(angles); [grid,u] = regularization2D(data,[-1.5 1.5;-1.5 1.5],[50 50],lambda1,lambda2); figure() mesh(grid.x, grid.y,u) xlabel('x'); ylabel('y'); hold on plot3(data(:,1),data(:,2),data(:,3),'*b','Markersize',2) hold off
Produces the following figure
Figure 1 |
---|
Package: splines