1 | % Random Variables |
---|
2 | a=struct('class','RV','names',{{'a'}}); |
---|
3 | b=struct('class','RV','names',{{'b'}}); |
---|
4 | ab=struct('class','RV','names',{{'a','b'}}); |
---|
5 | |
---|
6 | % Sources |
---|
7 | f1.class= 'enorm<ldmat>'; |
---|
8 | f1.mu = 3; |
---|
9 | f1.R = 1; |
---|
10 | f1.rv = b; |
---|
11 | |
---|
12 | % merger |
---|
13 | merger.class='merger_mix'; |
---|
14 | merger.method='lognormal'; |
---|
15 | merger.beta=2; |
---|
16 | merger.ncoms=20; |
---|
17 | merger.stop_niter=5; |
---|
18 | merger.effss_coef=1; |
---|
19 | %merger.dbg_file='merger_mix_dbg'; |
---|
20 | |
---|
21 | |
---|
22 | % 2D sources |
---|
23 | f3 = struct('class','enorm<ldmat>',... |
---|
24 | 'mu',[1,2],... |
---|
25 | 'R', [2 0; 0 1.5],... |
---|
26 | 'rv', ab); |
---|
27 | f4 = struct('class','egiw',... |
---|
28 | 'V',4*[5 2; 2 1],... |
---|
29 | 'nu', 4,... |
---|
30 | 'dimx', 1,... |
---|
31 | 'rv', ab); |
---|
32 | % 2D support |
---|
33 | support2.grid={[-5,5],[0.001,5]}; |
---|
34 | support2.nbins=[20,20]; |
---|
35 | |
---|
36 | % 2D |
---|
37 | vy2=merger_mx({f3,f1}, support2, merger) |
---|
38 | X=zeros(support2.nbins(1)); |
---|
39 | Y=zeros(support2.nbins(1)); |
---|
40 | Z=zeros(support2.nbins(1)); |
---|
41 | |
---|
42 | figure(2); |
---|
43 | subplot(1,3,1); |
---|
44 | hold off |
---|
45 | plot(vy2.support(1,:),vy2.support(2,:),'.','MarkerSize',4) |
---|
46 | hold on |
---|
47 | 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) |
---|