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