Show
Ignore:
Timestamp:
05/27/10 23:07:49 (14 years ago)
Author:
smidl
Message:

Flatten has an extra argument

Location:
applications/bdmtoolbox
Files:
2 modified

Legend:

Unmodified
Added
Removed
  • applications/bdmtoolbox/mex/mixef_init.cpp

    r1002 r1013  
    5454        MixEF mix; 
    5555        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())); 
    5757        shared_ptr<epdf> p=mix.epredictor(vec(0)); 
    5858        UIFile prf; 
  • applications/bdmtoolbox/tutorial/userguide/mixef_basic.m

    r1005 r1013  
    55com.rgr = RV({},[],[]); 
    66 
    7 Data = randn(2,20); 
     7Data = [randn(2,50) randn(2,50)+10*ones(2,50)]; 
    88 
    99[Mix0,P0]=mixef_init(Data,com); 
    10  
    1110% show predictor 
    1211 
    1312Pred = bm_epredictor(Mix0); 
     13figure(1); 
     14hold off 
     15plot(Data(1,:), Data(2,:),'.'); 
     16hold on 
    1417epdf_2dplot(Pred); 
    1518 
     
    2932    % normalize weights 
    3033    w = exp(log_w_nn-max(log_w_nn)); 
    31     w = w/sum(w); 
     34    w = w/sum(w) 
    3235     
    3336    for c=1:n 
    3437        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)); 
    3639    end 
     40    MixQB.weights = bm_bayes(MixQB.weights, w); 
    3741end 
    3842toc 
     
    4044tic 
    4145% should be the same as: 
    42 % MixQBc = bm_bayes_batch(MixQB,Data); 
     46MixQBc = bm_bayes_batch(MixQB,Data); 
    4347toc 
    4448 
    4549%% display results 
    4650 
     51PredQB = bm_epredictor(MixQB); 
    4752figure(2); 
    48 PredQB = bm_epredictor(MixQB); 
    49 epdf_2dplot(Pred); 
     53hold off 
     54plot(Data(1,:), Data(2,:),'.'); 
     55hold on 
     56epdf_2dplot(PredQB); 
    5057 
    5158%% relations between components 
     
    5663    end 
    5764end 
     65figure(3) 
    5866imagesc(Batta_dist);