Changeset 190 for matlab

Show
Ignore:
Timestamp:
10/22/08 10:46:38 (16 years ago)
Author:
smidl
Message:

adaptation of merger for changes and creation of datalink class

Files:
1 modified

Legend:

Unmodified
Added
Removed
  • matlab/merger_iter_debug.m

    r184 r190  
    33ndat = 1000; % check if true! 
    44 
     5XL = [-1 4]; 
     6YL= XL; 
     7 
    58figure(1); 
    6 for it=0:6 
     9for it=0:20 
    710    figure(it+1) 
    811    subplot(2,2,1); 
    9     hold off 
    1012    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); 
    1417         
    1518    subplot(2,2,2); 
    16     hold off 
    1719    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'); end 
     20    title('First source');  
     21    set(gca,'XLim',XL); 
     22    set(gca,'YLim',YL); 
    2123     
    2224    subplot(2,2,3); 
    23     hold off 
    2425    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); 
    2929     
    3030     
    3131    subplot(2,2,4); 
    3232    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); 
    3436     
    35   %  keyboard 
    3637end 
    3738 
     
    4344figure(it+2); 
    4445M1 = reshape(exp(Res1),Npoints,Npoints); 
    45 contour(XG,YG,M1); 
     46contour(XG,YG,M1,7); 
    4647 
    4748figure(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); 
     49hold off 
     50mm = max(max(Res2)); 
     51for i=1:size(Res2,1) 
     52    M2 = reshape(Res2(i,:),Npoints,Npoints); 
     53    contour(XG,YG,M2,[0:mm/7:mm]); 
     54    hold on 
     55end