- Timestamp:
- 10/22/08 10:46:38 (16 years ago)
- Files:
-
- 1 modified
Legend:
- Unmodified
- Added
- Removed
-
matlab/merger_iter_debug.m
r184 r190 3 3 ndat = 1000; % check if true! 4 4 5 XL = [-1 4]; 6 YL= XL; 7 5 8 figure(1); 6 for it=0: 69 for it=0:20 7 10 figure(it+1) 8 11 subplot(2,2,1); 9 hold off10 12 si = num2str(it); 11 eval(['plot3(Smp' si '(1,:),Smp' si '(2,:),exp(Mpdf' si '),''r.'')']); 12 if i==0, title('Proposal & mix'); end 13 set(gca,'XLim',[-10,10]); 13 eval(['contour_2(Smp' si '(1,:),Smp' si '(2,:),exp(Mpdf' si '))']); 14 title('Proposal density '); 15 set(gca,'XLim',XL); 16 set(gca,'YLim',YL); 14 17 15 18 subplot(2,2,2); 16 hold off17 19 eval(['contour_2(Smp' si '(1,:),Smp' si '(2,:),exp(lW' si '(1,:)))']); 18 % hold on 19 % eval(['plot3(Smp' si '(1,:),Smp' si '(2,:),w' si ',''r.'')']);20 if i==0, title('Weighed Smp'); end20 title('First source'); 21 set(gca,'XLim',XL); 22 set(gca,'YLim',YL); 21 23 22 24 subplot(2,2,3); 23 hold off24 25 eval(['contour_2(Smp' si '(1,:),Smp' si '(2,:),exp(lW' si '(2,:)))']); 25 % eval(['plot3(Smp' si '(1,:),Smp' si '(2,:),w' si ',''.'')']); 26 % hold on 27 % eval(['plot3(Smp' si '(1,:),Smp' si '(2,:),w_is_' si ',''r.'')']); 28 if i==0, title('Weighed Smp'); end 26 title('Second source'); 27 set(gca,'XLim',XL); 28 set(gca,'YLim',YL); 29 29 30 30 31 31 subplot(2,2,4); 32 32 eval(['contour_2(Smp' si '(1,:),Smp' si '(2,:),w' si ')']); 33 if i==0, title('Resampled hist'); end 33 title('Merged density'); 34 set(gca,'XLim',XL); 35 set(gca,'YLim',YL); 34 36 35 % keyboard36 37 end 37 38 … … 43 44 figure(it+2); 44 45 M1 = reshape(exp(Res1),Npoints,Npoints); 45 contour(XG,YG,M1 );46 contour(XG,YG,M1,7); 46 47 47 48 figure(it+3); 48 M2 = reshape(exp(Res2),Npoints,Npoints); 49 contour(XG,YG,M2); 50 51 figure(it+4); 52 L1 = reshape(exp(lf1),Npoints,Npoints); 53 contour(XG,YG,L1); 49 hold off 50 mm = max(max(Res2)); 51 for i=1:size(Res2,1) 52 M2 = reshape(Res2(i,:),Npoints,Npoints); 53 contour(XG,YG,M2,[0:mm/7:mm]); 54 hold on 55 end