Changeset 429 for applications/bdmtoolbox/tutorial
- Timestamp:
- 07/27/09 13:12:23 (15 years ago)
- Files:
-
- 1 modified
Legend:
- Unmodified
- Added
- Removed
-
applications/bdmtoolbox/tutorial/merging/merge_frag.m
r411 r429 6 6 % Sources 7 7 f1.class= 'enorm<ldmat>'; 8 f1.mu = 3;8 f1.mu = 5; 9 9 f1.R = 1; 10 10 f1.rv = b; … … 13 13 Merger.class='merger_mix'; 14 14 Merger.method='lognormal'; 15 Merger.beta= 2;15 Merger.beta=1.2; 16 16 Merger.ncoms=20; 17 Merger.stop_niter=5 ;17 Merger.stop_niter=50; 18 18 Merger.effss_coef=1; 19 19 %Merger.dbg_file='merger_mix_dbg'; … … 23 23 f3 = struct('class','enorm<ldmat>',... 24 24 'mu',[1,2],... 25 'R', [ 2 0; 0 1.5],...25 'R', [1 -0.5; -0.5 1],... 26 26 'rv', ab); 27 f4 = struct('class','egiw',... 28 'V',4*[5 2; 2 1],... 29 'nu', 4,... 30 'dimx', 1,... 31 'rv', ab); 27 f4 = struct('class','mlnorm<ldmat>',... 28 'rv',a,... 29 'rvc', b,... 30 'A', 1,... 31 'const', 0,... 32 'R',1); 32 33 % 2D support 33 support2.grid={[-5,5],[0.001, 5]};34 support2.nbins=[ 20,20];34 support2.grid={[-5,5],[0.001,9]}; 35 support2.nbins=[30,30]; 35 36 36 37 % 2D 37 vy2=merger({f3,f1}, support2, Merger) 38 X=zeros(support2.nbins(1)); 39 Y=zeros(support2.nbins(1)); 40 Z=zeros(support2.nbins(1)); 38 %vy2=merger({f3,f1}, support2, Merger) 39 vy2=merger({f3,f4}, support2, Merger) 41 40 42 41 figure(2); 43 subplot(1,3,1); 42 subplot(2,2,1); 43 contour_2(vy2.support(1,:),vy2.support(2,:),vy2.source1) 44 % set(gca,'XLim',[-5,5]) 45 % set(gca,'YLim',[-1,7]) 46 title('Source 1') 47 subplot(2,2,2); 48 contour_2(vy2.support(1,:),vy2.support(2,:),vy2.source2') 49 % set(gca,'XLim',[-5,5]) 50 % set(gca,'YLim',[-1,7]) 51 title('Source 2') 52 53 subplot(2,2,3); 54 hold off 55 contour_2(vy2.support(1,:),vy2.support(2,:),vy2.mix) 56 % set(gca,'XLim',[-5,5]) 57 % set(gca,'YLim',[-1,7]) 58 title('Mixture Approximation') 59 60 subplot(2,2,4); 44 61 hold off 45 62 plot(vy2.support(1,:),vy2.support(2,:),'.','MarkerSize',4) 46 63 hold on 47 64 contour_2(vy2.support(1,:),vy2.support(2,:),vy2.weights) 48 subplot(1,3,2); 49 contour_2(vy2.support(1,:),vy2.support(2,:),vy2.source1)50 subplot(1,3,3); 51 contour_2(vy2.support(1,:),vy2.support(2,:),vy2.source2) 65 % set(gca,'XLim',[-5,5]) 66 % set(gca,'YLim',[-1,7]) 67 title('Weighted Empirical') 68