[Scilab-users] Surface smoothing in Scilab, immune to outliers

Calixte Denizet calixte.denizet at scilab-enterprises.com
Mon Mar 4 20:01:02 CET 2013


Hi Rafael,

You can try to use lsq_splin along the axes x and y.
It seems to work on the following example:

x = %pi * [-1:0.05:1]';
z = sin(x)*cos(x)';

f = gcf();
f.color_map = jetcolormap(32);
subplot(131);
xtitle("Exact values");
plot3d(x, x, z, 70, 70);
e=gce();
e.color_flag = 1;

z = z + 0.5*rand(z);
z(10,10)=5;
z(30,20)=5;
z(10,40)=5;

subplot(132);
xtitle("Perturbated values");
plot3d(x, x, z, 70, 70);
e=gce();
e.color_flag = 1;

zz=zeros(z);
w=linspace(-%pi,%pi,5)';
for i=1:size(z,'r')
[y,d]=lsq_splin(x', z(i,:), w);
zz(i,:)=interp(x', w, y, d);
end

for i=1:size(zz,'c')
[y,d]=lsq_splin(x, zz(:,i), w);
zz(:,i)=interp(x, w, y, d);
end

subplot(133);
xtitle("Smoothed values");
plot3d(x, x, zz, 70, 70);
e=gce();
e.color_flag = 1;

Best regards

Calixte

On 04/03/2013 04:36, Rafael Guerra wrote:
> Hello,
>
> Does somebody know if there are Scilab functions capable of replacing
> outliers via some local robust fitting in 2D, i.e., that smooths
> experimental data z=f(x,y) and is immune to strong outliers.
>
> PS: CASCI in Atoms has a lowess function which does this via local robust
> linear fitting but for functions of one variable only.
>
> Thanks and regards,
> Rafael Guerra
>
>
>
>
> --
> View this message in context: http://mailinglists.scilab.org/Surface-smoothing-in-Scilab-immune-to-outliers-tp4026119.html
> Sent from the Scilab users - Mailing Lists Archives mailing list archive at Nabble.com.
> _______________________________________________
> users mailing list
> users at lists.scilab.org
> http://lists.scilab.org/mailman/listinfo/users


-- 
Calixte Denizet
Software Development Engineer
-----------------------------------------------------------
Scilab Enterprises
143bis rue Yves Le Coz - 78000 Versailles, France
http://www.scilab-enterprises.com




More information about the users mailing list