Changeset 1013 for applications
- Timestamp:
- 05/27/10 23:07:49 (15 years ago)
- Location:
- applications/bdmtoolbox
- Files:
-
- 2 modified
Legend:
- Unmodified
- Added
- Removed
-
applications/bdmtoolbox/mex/mixef_init.cpp
r1002 r1013 54 54 MixEF mix; 55 55 mix.init(&(*com1),Data,no_com); 56 mix.bayes_batch(Data,zeros(0,Data.cols()),ones(Data.cols()));56 // mix.bayes_batch(Data,zeros(0,Data.cols())); 57 57 shared_ptr<epdf> p=mix.epredictor(vec(0)); 58 58 UIFile prf; -
applications/bdmtoolbox/tutorial/userguide/mixef_basic.m
r1005 r1013 5 5 com.rgr = RV({},[],[]); 6 6 7 Data = randn(2,20);7 Data = [randn(2,50) randn(2,50)+10*ones(2,50)]; 8 8 9 9 [Mix0,P0]=mixef_init(Data,com); 10 11 10 % show predictor 12 11 13 12 Pred = bm_epredictor(Mix0); 13 figure(1); 14 hold off 15 plot(Data(1,:), Data(2,:),'.'); 16 hold on 14 17 epdf_2dplot(Pred); 15 18 … … 29 32 % normalize weights 30 33 w = exp(log_w_nn-max(log_w_nn)); 31 w = w/sum(w) ;34 w = w/sum(w) 32 35 33 36 for c=1:n 34 37 yt = Data(:,t); 35 [MixQB.Coms{c}]=bm_bayes (MixQB.Coms{c}, yt);38 [MixQB.Coms{c}]=bm_bayesweighted(MixQB.Coms{c}, yt, [], w(c)); 36 39 end 40 MixQB.weights = bm_bayes(MixQB.weights, w); 37 41 end 38 42 toc … … 40 44 tic 41 45 % should be the same as: 42 %MixQBc = bm_bayes_batch(MixQB,Data);46 MixQBc = bm_bayes_batch(MixQB,Data); 43 47 toc 44 48 45 49 %% display results 46 50 51 PredQB = bm_epredictor(MixQB); 47 52 figure(2); 48 PredQB = bm_epredictor(MixQB); 49 epdf_2dplot(Pred); 53 hold off 54 plot(Data(1,:), Data(2,:),'.'); 55 hold on 56 epdf_2dplot(PredQB); 50 57 51 58 %% relations between components … … 56 63 end 57 64 end 65 figure(3) 58 66 imagesc(Batta_dist);