0001
0002
0003
0004
0005
0006
0007
0008 addpath('Functions')
0009
0010 close all
0011
0012
0013 ss = plot_init;
0014 figure('name','Fig. 16.9: Profile smoothing','color','w',...
0015 'Position',[0.2*ss(1),0.2*ss(2),0.5*ss(1),0.5*ss(2)]);
0016
0017
0018 N = 45;
0019 factor_sigma = 1.5;
0020 Niter = 0;
0021 type_robust = zeros(4,1);
0022 print_type = 0;
0023 plot_type = 0;
0024
0025
0026 xs = [15,20,25,30]';
0027 zs = [-1.8,-2,2,0]'*2.5;
0028 out_in = [0,0,0]';
0029
0030
0031 sigma_e = 1.0;
0032 sigma_n = 0.25;
0033
0034 [zest,x1,x2,x3,Cov] = estimate_profile_robust_flat...
0035 (N,xs,zs,sigma_e,sigma_n,Niter,0,type_robust,print_type);
0036
0037 subplot(2,2,1); hold on
0038 plot(1:N,zest,'-k','LineWidth',2)
0039 plot(xs,zs,'.b','MarkerSize',20)
0040 axis equal
0041 title('flat reconstruction')
0042 xlim([5,50]);ylim([-20,15])
0043
0044
0045
0046 subplot(2,2,3); hold on
0047 plot(xs,zs,'.b','MarkerSize',15)
0048 plot(1:N,zest,'-k','LineWidth',2)
0049 plot(1:N,zest+3*factor_sigma*sqrt(diag(Cov)),'-r','LineWidth',1)
0050 plot(1:N,zest-3*factor_sigma*sqrt(diag(Cov)),'-r','LineWidth',1)
0051 title(['blow up factor for $\sigma_z = ',num2str(factor_sigma),'$'])
0052 axis equal; xlim([5,50]); ylim([-20,15]);
0053
0054
0055
0056 sigma_e = 1.0;
0057 sigma_n = 0.25;
0058
0059 [zest,A,ver,weights,Cov] = estimate_profile_robust...
0060 (N,xs,zs,sigma_e,sigma_n,Niter,0,type_robust,print_type,plot_type);
0061
0062 subplot(2,2,2);hold on;
0063 plot(1:N,zest,'-k','LineWidth',2)
0064 plot(xs,zs,'.b','MarkerSize',20)
0065 title('smooth reconstruction')
0066 axis equal;xlim([5,50]);ylim([-20,15]);
0067
0068
0069 subplot(2,2,4);hold on;
0070 plot(xs,zs,'.b','MarkerSize',20)
0071 plot(1:N,zest,'-k','LineWidth',2)
0072 plot(1:N,zest+3*factor_sigma*sqrt(diag(Cov)),'-r','LineWidth',1)
0073 plot(1:N,zest-3*factor_sigma*sqrt(diag(Cov)),'-r','LineWidth',1)
0074 title(['blow up factor for $\sigma_z = ',num2str(factor_sigma),'$'])
0075 axis equal; xlim([5,50]);ylim([-20,15]);
0076
0077