#include "estim/mixtures.h" #include "estim/arx.h" #include "stat/exp_family.h" using namespace bdm; //These lines are needed for use of cout and endl using std::cout; using std::endl; void disp_mix2D ( const MixEF &Mi ) { const eprod &ep=((const eprod&)(Mi.posterior())); int i; mat Var ( 2,2 ),M ( 1,2 ); for ( i=0; i last one is the weight ( ( egiw* ) ep ( i ) )->mean_mat ( M,Var ); cout << "Mean: "<< M <mean() < C1; C1.set_rv ( x ); C1.set_parameters ( m1,V1 ); enorm C2; C2.set_rv ( x ); C2.set_parameters ( m2,V2 ); Array Sim ( 2 ); Sim ( 0 ) =&C1;Sim ( 1 ) =&C2; emix Simul;Simul.set_rv ( x ); Simul.set_parameters ( "0.5 0.6", Sim, false ); // Sample parameters int ndat = 100; mat Smp =Simul.sample_m ( ndat ); cout << "Simulated means: " << m1 <<" and " << m2 < A ( 2 ); A ( 0 ) =&M1; A ( 1 ) =&M2; MixEF Post ( A,"0.5 0.5" ); cout << "Initial mixture:"<<-5,5>"<<-5,5>"<