0001
0002
0003
0004
0005
0006
0007
0008 addpath('Functions')
0009
0010 close all
0011
0012
0013 ss = plot_init;
0014
0015
0016
0017
0018 N = 45;
0019
0020
0021 Niter = 0;
0022 type_robust = zeros(4,1);
0023
0024
0025 print_type = 0;
0026 plot_type = 0;
0027 factor_sigma = 1.5;
0028
0029
0030
0031 display('----- demo reconstruct profile with flattening and smoothing -----')
0032
0033
0034 xs = [15,20,25,30]';
0035 zs = [-1.8,-2,2,0]'*2.5;
0036
0037
0038 sigma_e = 1.0;
0039 sigma_n = 0.25;
0040
0041 [zest_flat,tmp,tmp,tmp,Cov_flat] = estimate_profile_robust_flat...
0042 (N,xs,zs,sigma_e,sigma_n,Niter,0,type_robust,print_type);
0043
0044
0045
0046
0047
0048
0049
0050 sigma_e = 1.0;
0051 sigma_n = 0.25;
0052
0053 [zest_smooth,tmp,tmp,tmp,Cov_smooth] = estimate_profile_robust...
0054 (N,xs,zs,sigma_e,sigma_n,Niter,0,type_robust,print_type,plot_type);
0055
0056
0057
0058
0059
0060
0061 figure('name','Fig. 16.9 top: Profile smoothing','color','w',...
0062 'Position',[0.2*ss(1),0.2*ss(2),0.5*ss(1),0.5*ss(2)]);
0063
0064
0065 subplot(2,2,1); hold on
0066 plot(1:N,zest_flat,'-k','LineWidth',2)
0067 plot(xs,zs,'.b','MarkerSize',20)
0068 axis equal
0069 title('flat reconstruction','FontSize',16)
0070 xlim([5,50]);ylim([-20,15])
0071
0072
0073 subplot(2,2,3); hold on
0074 plot(xs,zs,'.b','MarkerSize',15)
0075 plot(1:N,zest_flat,'-k','LineWidth',2)
0076 plot(1:N,zest_flat+3*factor_sigma*sqrt(diag(Cov_flat)),'-r','LineWidth',1)
0077 plot(1:N,zest_flat-3*factor_sigma*sqrt(diag(Cov_flat)),'-r','LineWidth',1)
0078 title(['blow up factor for $\sigma_z = ',num2str(factor_sigma),'$'],'FontSize',16)
0079 axis equal; xlim([5,50]); ylim([-20,15]);
0080
0081
0082 subplot(2,2,2);hold on;
0083 plot(1:N,zest_smooth,'-k','LineWidth',2)
0084 plot(xs,zs,'.b','MarkerSize',20)
0085 title('smooth reconstruction','FontSize',16)
0086 axis equal;xlim([5,50]);ylim([-20,15]);
0087
0088
0089 subplot(2,2,4);hold on;
0090 plot(xs,zs,'.b','MarkerSize',20)
0091 plot(1:N,zest_smooth,'-k','LineWidth',2)
0092 plot(1:N,zest_smooth+3*factor_sigma*sqrt(diag(Cov_smooth)),'-r','LineWidth',1)
0093 plot(1:N,zest_smooth-3*factor_sigma*sqrt(diag(Cov_smooth)),'-r','LineWidth',1)
0094 title(['blow up factor for $\sigma_z = ',num2str(factor_sigma),'$'],'FontSize',16)
0095 axis equal; xlim([5,50]);ylim([-20,15]);
0096
0097
0098