Home > 16-Profilereconstruction > fig_16_17_asymmetric_outliers.m

fig_16_17_asymmetric_outliers

PURPOSE ^

% Fig. 16.17 page 756

SYNOPSIS ^

This is a script file.

DESCRIPTION ^

% Fig. 16.17 page 756
 Reconstruction of a profile with one-sided outliers

 Wolfgang Förstner 2014-08-06
 last changes: Susanne Wenzel 09/16
 wfoerstn@uni-bonn.de, wenzel@igg.uni-bonn.de

CROSS-REFERENCE INFORMATION ^

This function calls: This function is called by:

SOURCE CODE ^

0001 %% Fig. 16.17 page 756
0002 % Reconstruction of a profile with one-sided outliers
0003 %
0004 % Wolfgang Förstner 2014-08-06
0005 % last changes: Susanne Wenzel 09/16
0006 % wfoerstn@uni-bonn.de, wenzel@igg.uni-bonn.de
0007 
0008 close all
0009 clear all
0010 
0011 addpath(genpath('../General_Functions/'));
0012 addpath('Functions')
0013 
0014 
0015 %% plot settings
0016 ss = plot_init;
0017 
0018 display('----- eliminate asymmetric outliers -----')
0019 
0020 %% set parameters
0021 
0022 % params for generating the data
0023 init_rand = 8;     % may be changed for other example
0024 N = 200;           % number of points
0025 dens = 0.8;        % percentage of observed points in (0,1]
0026 sigma_e = 0.5;     % process noise
0027 sigma_n = 0.5;     % observation noise
0028 Poutlier = 0.4;    % fraction of outliers
0029 Max_outlier = 25;  % max(outlier)
0030 type_outlier = 1;  % asymmetric %type_outlier = 0; % symmetric
0031 
0032 % params for estimation
0033 type_robust  = [1,2,2,2]; %
0034     % 1. [0 = L1, 1 = Kraus,
0035     % 2. g_factor,
0036     % 3. w_factor
0037     % 4. 0,1,2,3 = 00,01,10,11 robust for points and dem
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 %% initialize random number generation by fixed seed
0051 init_rand_seed(init_rand);
0052 
0053 %% generate profile
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 %% reconstruct profile L1
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 %% reconstruct profile Kraus
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 %% plot
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

Generated on Mon 19-Sep-2016 01:11:04 by m2html © 2005