0001
0002
0003
0004
0005
0006
0007
0008 close all
0009 clear all
0010
0011 addpath(genpath('../General_Functions/'));
0012 addpath('Functions')
0013
0014
0015
0016 ss = plot_init;
0017
0018 display('----- eliminate asymmetric outliers -----')
0019
0020
0021
0022
0023 init_rand = 8;
0024 N = 200;
0025 dens = 0.8;
0026 sigma_e = 0.5;
0027 sigma_n = 0.5;
0028 Poutlier = 0.4;
0029 Max_outlier = 25;
0030 type_outlier = 1;
0031
0032
0033 type_robust = [1,2,2,2];
0034
0035
0036
0037
0038
0039 print_type = 0;
0040 plot_type = 0;
0041
0042 Niter = 6;
0043 if type_outlier ==0
0044 factor_sigma = 1;
0045 else
0046 factor_sigma = 8;
0047 end
0048
0049
0050
0051 init_rand_seed(init_rand);
0052
0053
0054 [x,y,out_in,select,xs,ys] = ...
0055 generate_observed_AR2(N,sigma_e,sigma_n,Poutlier,Max_outlier,type_outlier,dens);
0056
0057
0058
0059 type_robust(1) = 0;
0060
0061
0062 xest = estimate_profile_robust...
0063 (N,select,ys,sigma_e/factor_sigma,sigma_n,Niter,type_outlier,...
0064 type_robust,print_type,plot_type);
0065
0066
0067
0068 type_robust(1) = 1;
0069 factor_sigma= 1;
0070
0071 xest_kraus = estimate_profile_robust...
0072 (N,select,ys,sigma_e/factor_sigma,sigma_n,Niter,type_outlier,...
0073 type_robust,print_type,plot_type);
0074
0075
0076
0077 figure('name','Fig. 16.17: Reconstruction of a profile with one-sided outliers',...
0078 'color','w', 'Position',[0.2*ss(1),0.1*ss(2),0.4*ss(1),0.8*ss(2)]);
0079
0080 subplot(2,1,1);hold on
0081 plot(1:N,x,'--r','LineWidth',3)
0082 plot(1:N,xest,'-k','LineWidth',2)
0083 plot(select,ys,'.b','MarkerSize',20)
0084 xlabel('$x$');ylabel('$z$');
0085 title('Fig. 16.17a: Reconstruction with one-sided $L_{12}$-weight function');
0086
0087 subplot(2,1,2);hold on
0088 plot(select,ys,'.b','MarkerSize',20)
0089 plot(1:N,x,'--r','LineWidth',3)
0090 plot(1:N,xest_kraus,'-k','LineWidth',2)
0091 xlabel('$x$');ylabel('$z$');
0092 title(['Fig. 16.17b: Reconstruction with the weight function of Kraus and Pfeifer,' ...
0093 ' $g = ', num2str(type_robust(2)),', w = ',num2str(type_robust(3)),'$']);
0094
0095