0001
0002
0003
0004
0005
0006
0007
0008 addpath(genpath('../../General-Functions/'));
0009 addpath('Functions');
0010
0011 close all
0012
0013
0014 ss = plot_init;
0015
0016 disp('----- eliminate symmetric outliers -----')
0017
0018
0019
0020
0021 init_rand = 8;
0022 N = 200;
0023 dens = 0.8;
0024 sigma_e = 0.5;
0025 sigma_n = 0.5;
0026 Poutlier = 0.4;
0027 Max_outlier = 25;
0028 type_outlier = 0;
0029
0030
0031 type_robust = [0,2,2,2];
0032
0033
0034
0035
0036
0037 print_type = 0;
0038 plot_type = 0;
0039
0040 if type_outlier ==0
0041 Niter = 6;
0042 factor_sigma = 1;
0043 else
0044 Niter = 3;
0045 factor_sigma= 8;
0046 end
0047
0048
0049
0050 init_rand_seed(init_rand);
0051
0052
0053 [x,y,out_in,select,xs,ys] = ...
0054 generate_observed_AR2(N,sigma_e,sigma_n,Poutlier,Max_outlier,type_outlier,dens);
0055
0056
0057 [xest,A,ver,weights,Cov] = ...
0058 estimate_profile_robust...
0059 (N,select,ys,sigma_e/factor_sigma,sigma_n,Niter,type_outlier,...
0060 type_robust,print_type,plot_type);
0061
0062
0063 figure('name','Fig. 16.15 Reconstruction of profile with outliers','color','w',...
0064 'Position',[0.2*ss(1),0.2*ss(2),0.5*ss(1),0.5*ss(2)]);
0065 hold on;
0066 plot(1:N,x,'--r','LineWidth',3)
0067 plot(1:N,xest,'-k','LineWidth',3)
0068 plot(select,ys,'.b','MarkerSize',20)
0069
0070 title = (['Fig. 15.15: $N = ',num2str(N),'$, density $= ',num2str(dens),...
0071 '$, $s_e = ',num2str(sigma_e),'$, $s_n = ',num2str(sigma_e),...
0072 '$, $P($outlier$) = ',num2str(Poutlier),'$, $\max($outlier$) = ',num2str(Max_outlier),...
0073 '$, Niter$ = ',num2str(Niter),'$']);
0074 xlabel('$x$');ylabel('$z$');
0075