[321] | 1 | itload('iter_cond_debug3.it'); |
---|
| 2 | |
---|
| 3 | ndat = 1000; % check if true! |
---|
| 4 | |
---|
| 5 | prop_mean=zeros(3,40); |
---|
| 6 | prop_var=zeros(3,40); |
---|
| 7 | for it=0:39 |
---|
| 8 | si = num2str(it); |
---|
| 9 | eval(['eff_w(it+1) = 1/(w' si '''*w' si ');']); |
---|
| 10 | eval(['prop_mean(1:3,it+1) = Mpred_mean' si ';']); |
---|
| 11 | eval(['prop_var(1:3,it+1) = Mpred_var' si '(1:3);']); |
---|
| 12 | end |
---|
| 13 | |
---|
| 14 | figure(2) |
---|
| 15 | subplot(1,2,1) |
---|
| 16 | hold off |
---|
| 17 | plot(eff_w) |
---|
| 18 | xlabel('iteration'); |
---|
| 19 | title('Effective sample size'); |
---|
| 20 | %title('Non-normalized importance weights') |
---|
| 21 | |
---|
| 22 | subplot(1,2,2); |
---|
| 23 | hold off |
---|
| 24 | plot(prop_mean'); |
---|
| 25 | hold on |
---|
| 26 | plot(prop_mean'+2*sqrt(prop_var'),'.'); |
---|
| 27 | plot(prop_mean'-2*sqrt(prop_var'),'.'); |
---|
| 28 | |
---|
| 29 | %plot(ones(size(prop_mean,2),1)*[3 2],'--') |
---|
| 30 | xlabel('iteration'); |
---|
| 31 | title('Mean value of the joint merger $\tilde{f}(\bm{x})$'); |
---|
| 32 | |
---|
| 33 | % itload('../merger_iter_test.it'); |
---|
| 34 | % XG = reshape(Grid(1,:),Npoints,Npoints); |
---|
| 35 | % YG = reshape(Grid(2,:),Npoints,Npoints); |
---|
| 36 | % |
---|
| 37 | % figure(2); |
---|
| 38 | % M1 = reshape(exp(Res1),Npoints,Npoints); |
---|
| 39 | % contour(XG,YG,M1,7); |
---|
| 40 | % |
---|
| 41 | % figure(3); |
---|
| 42 | % hold off |
---|
| 43 | % mm = max(max(Res2)); |
---|
| 44 | % for i=1:size(Res2,1) |
---|
| 45 | % M2 = reshape(Res2(i,:),Npoints,Npoints); |
---|
| 46 | % contour(XG,YG,M2,[0:mm/7:mm]); |
---|
| 47 | % hold on |
---|
| 48 | % end |
---|
| 49 | |
---|