Changeset 693 for library/bdm/stat
- Timestamp:
- 11/02/09 17:27:29 (15 years ago)
- Location:
- library/bdm/stat
- Files:
-
- 5 modified
Legend:
- Unmodified
- Added
- Removed
-
library/bdm/stat/emix.cpp
r675 r693 54 54 } 55 55 56 shared_ptr< mpdf> emix::condition ( const RV &rv ) const {56 shared_ptr<pdf> emix::condition ( const RV &rv ) const { 57 57 bdm_assert ( isnamed(), "rvs are not assigned" ); 58 58 mratio *tmp = new mratio ( this, rv ); 59 return shared_ptr< mpdf>(tmp);59 return shared_ptr<pdf>(tmp); 60 60 } 61 61 … … 203 203 }; 204 204 205 void mprod::set_elements (const Array<shared_ptr< mpdf> > &mFacs ) {206 mpdfs = mFacs;205 void mprod::set_elements (const Array<shared_ptr<pdf> > &mFacs ) { 206 pdfs = mFacs; 207 207 dls.set_size ( mFacs.length() ); 208 208 209 rv = get_composite_rv ( mpdfs, true );209 rv = get_composite_rv ( pdfs, true ); 210 210 dim = rv._dsize(); 211 211 212 for ( int i = 0; i < mpdfs.length(); i++ ) {213 RV rvx = mpdfs ( i )->_rvc().subt ( rv );212 for ( int i = 0; i < pdfs.length(); i++ ) { 213 RV rvx = pdfs ( i )->_rvc().subt ( rv ); 214 214 rvc.add ( rvx ); // add rv to common rvc 215 215 } 216 216 dimc=rvc._dsize(); 217 217 218 // rv and rvc established = > we can link them with mpdfs219 for ( int i = 0; i < mpdfs.length(); i++ ) {218 // rv and rvc established = > we can link them with pdfs 219 for ( int i = 0; i < pdfs.length(); i++ ) { 220 220 dls ( i ) = new datalink_m2m; 221 dls ( i )->set_connection ( mpdfs ( i )->_rv(), mpdfs ( i )->_rvc(), _rv(), _rvc() );221 dls ( i )->set_connection ( pdfs ( i )->_rv(), pdfs ( i )->_rvc(), _rv(), _rvc() ); 222 222 } 223 223 } … … 239 239 240 240 } 241 // mprod::mprod ( Array< mpdf*> mFacs, bool overlap) : mpdf ( RV(), RV() ), n ( mFacs.length() ), epdfs ( n ), mpdfs ( mFacs ), rvinds ( n ), rvcinrv ( n ), irvcs_rvc ( n ) {241 // mprod::mprod ( Array<pdf*> mFacs, bool overlap) : pdf ( RV(), RV() ), n ( mFacs.length() ), epdfs ( n ), pdfs ( mFacs ), rvinds ( n ), rvcinrv ( n ), irvcs_rvc ( n ) { 242 242 // int i; 243 243 // bool rvaddok; 244 244 // // Create rv 245 245 // for ( i = 0;i < n;i++ ) { 246 // rvaddok=rv.add ( mpdfs ( i )->_rv() ); //add rv to common rvs.247 // // If rvaddok==false, mpdfs overlap => assert error.248 // epdfs ( i ) = & ( mpdfs ( i )->posterior() ); // add pointer to epdf246 // rvaddok=rv.add ( pdfs ( i )->_rv() ); //add rv to common rvs. 247 // // If rvaddok==false, pdfs overlap => assert error. 248 // epdfs ( i ) = & ( pdfs ( i )->posterior() ); // add pointer to epdf 249 249 // }; 250 250 // // Create rvc 251 251 // for ( i = 0;i < n;i++ ) { 252 // rvc.add ( mpdfs ( i )->_rvc().subt ( rv ) ); //add rv to common rvs.252 // rvc.add ( pdfs ( i )->_rvc().subt ( rv ) ); //add rv to common rvs. 253 253 // }; 254 254 // 255 255 // // independent = true; 256 // //test rvc of mpdfs and fill rvinds256 // //test rvc of pdfs and fill rvinds 257 257 // for ( i = 0;i < n;i++ ) { 258 258 // // find ith rv in common rv 259 // rvsinrv ( i ) = mpdfs ( i )->_rv().dataind ( rv );259 // rvsinrv ( i ) = pdfs ( i )->_rv().dataind ( rv ); 260 260 // // find ith rvc in common rv 261 // rvcinrv ( i ) = mpdfs ( i )->_rvc().dataind ( rv );261 // rvcinrv ( i ) = pdfs ( i )->_rvc().dataind ( rv ); 262 262 // // find ith rvc in common rv 263 // irvcs_rvc ( i ) = mpdfs ( i )->_rvc().dataind ( rvc );263 // irvcs_rvc ( i ) = pdfs ( i )->_rvc().dataind ( rvc ); 264 264 // // 265 265 // /* if ( rvcinrv ( i ).length() >0 ) {independent = false;} -
library/bdm/stat/emix.h
r675 r693 35 35 At present the only supported operation is evallogcond(). 36 36 */ 37 class mratio: public mpdf {37 class mratio: public pdf { 38 38 protected: 39 //! Nominator in the form of mpdf39 //! Nominator in the form of pdf 40 40 const epdf* nom; 41 41 … … 50 50 //!Default constructor. By default, the given epdf is not copied! 51 51 //! It is assumed that this function will be used only temporarily. 52 mratio ( const epdf* nom0, const RV &rv, bool copy = false ) : mpdf ( ), dl ( ) {52 mratio ( const epdf* nom0, const RV &rv, bool copy = false ) : pdf ( ), dl ( ) { 53 53 // adjust rv and rvc 54 54 … … 178 178 //! Update already existing marginal density \c target 179 179 void marginal ( const RV &rv, emix &target ) const; 180 shared_ptr< mpdf> condition ( const RV &rv ) const;180 shared_ptr<pdf> condition ( const RV &rv ) const; 181 181 182 182 //Access methods … … 283 283 Note that 284 284 */ 285 class mprod: public mpdf {285 class mprod: public pdf { 286 286 private: 287 Array<shared_ptr< mpdf> > mpdfs;288 289 //! Data link for each mpdfs287 Array<shared_ptr<pdf> > pdfs; 288 289 //! Data link for each pdfs 290 290 Array<shared_ptr<datalink_m2m> > dls; 291 291 … … 300 300 /*!\brief Constructor from list of mFacs 301 301 */ 302 mprod ( const Array<shared_ptr< mpdf> > &mFacs ) {302 mprod ( const Array<shared_ptr<pdf> > &mFacs ) { 303 303 set_elements ( mFacs ); 304 304 } 305 //! Set internal \c mpdfs from given values306 void set_elements (const Array<shared_ptr< mpdf> > &mFacs );305 //! Set internal \c pdfs from given values 306 void set_elements (const Array<shared_ptr<pdf> > &mFacs ); 307 307 308 308 double evallogcond ( const vec &val, const vec &cond ) { 309 309 int i; 310 310 double res = 0.0; 311 for ( i = mpdfs.length() - 1; i >= 0; i-- ) {312 /* if ( mpdfs(i)->_rvc().count() >0) {313 mpdfs ( i )->condition ( dls ( i )->get_cond ( val,cond ) );311 for ( i = pdfs.length() - 1; i >= 0; i-- ) { 312 /* if ( pdfs(i)->_rvc().count() >0) { 313 pdfs ( i )->condition ( dls ( i )->get_cond ( val,cond ) ); 314 314 } 315 315 // add logarithms 316 316 res += epdfs ( i )->evallog ( dls ( i )->pushdown ( val ) );*/ 317 res += mpdfs ( i )->evallogcond (317 res += pdfs ( i )->evallogcond ( 318 318 dls ( i )->pushdown ( val ), 319 319 dls ( i )->get_cond ( val, cond ) … … 344 344 vec smpi; 345 345 // Hard assumption here!!! We are going backwards, to assure that samples that are needed from smp are already generated! 346 for ( int i = ( mpdfs.length() - 1 ); i >= 0; i-- ) {347 // generate contribution of this mpdf348 smpi = mpdfs(i)->samplecond(dls ( i )->get_cond ( smp , cond ));346 for ( int i = ( pdfs.length() - 1 ); i >= 0; i-- ) { 347 // generate contribution of this pdf 348 smpi = pdfs(i)->samplecond(dls ( i )->get_cond ( smp , cond )); 349 349 // copy contribution of this pdf into smp 350 350 dls ( i )->pushup ( smp, smpi ); … … 356 356 //! \code 357 357 //! { class='mprod'; 358 //! mpdfs = (..., ...); // list of mpdfs in the order of chain rule358 //! pdfs = (..., ...); // list of pdfs in the order of chain rule 359 359 //! } 360 360 //! \endcode 361 361 //!@} 362 362 void from_setting ( const Setting &set ) { 363 Array<shared_ptr< mpdf> > atmp; //temporary Array364 UI::get ( atmp, set, " mpdfs", UI::compulsory );363 Array<shared_ptr<pdf> > atmp; //temporary Array 364 UI::get ( atmp, set, "pdfs", UI::compulsory ); 365 365 set_elements ( atmp ); 366 366 } … … 460 460 461 461 462 /*! \brief Mixture of mpdfs with constant weights, all mpdfs are of equal RV and RVC462 /*! \brief Mixture of pdfs with constant weights, all pdfs are of equal RV and RVC 463 463 464 464 */ 465 class mmix : public mpdf {465 class mmix : public pdf { 466 466 protected: 467 //! Component ( mpdfs)468 Array<shared_ptr< mpdf> > Coms;467 //! Component (pdfs) 468 Array<shared_ptr<pdf> > Coms; 469 469 //!weights of the components 470 470 vec w; … … 474 474 475 475 //! Set weights \c w and components \c R 476 void set_parameters ( const vec &w0, const Array<shared_ptr< mpdf> > &Coms0 ) {476 void set_parameters ( const vec &w0, const Array<shared_ptr<pdf> > &Coms0 ) { 477 477 //!\todo check if all components are OK 478 478 Coms = Coms0; -
library/bdm/stat/exp_family.h
r679 r693 163 163 vec variance() const {return diag (R.to_mat());} 164 164 // mlnorm<sq_T>* condition ( const RV &rvn ) const ; <=========== fails to cmpile. Why? 165 shared_ptr< mpdf> condition ( const RV &rvn ) const;165 shared_ptr<pdf> condition ( const RV &rvn ) const; 166 166 167 167 // target not typed to mlnorm<sq_T, enorm<sq_T> > & … … 169 169 // haven't finished defining enorm yet), but the type 170 170 // is required 171 void condition ( const RV &rvn, mpdf &target ) const;171 void condition ( const RV &rvn, pdf &target ) const; 172 172 173 173 shared_ptr<epdf> marginal (const RV &rvn ) const; … … 367 367 */ 368 368 369 class mDirich: public mpdf_internal<eDirich> {369 class mDirich: public pdf_internal<eDirich> { 370 370 protected: 371 371 //! constant \f$ k \f$ of the random walk … … 376 376 vec betac; 377 377 public: 378 mDirich(): mpdf_internal<eDirich>(), _beta(iepdf._beta()){};378 mDirich(): pdf_internal<eDirich>(), _beta(iepdf._beta()){}; 379 379 void condition (const vec &val) {_beta = val/k+betac; }; 380 380 /*! Create Dirichlet random walk … … 391 391 */ 392 392 void from_setting (const Setting &set) { 393 mpdf::from_setting (set); // reads rv and rvc393 pdf::from_setting (set); // reads rv and rvc 394 394 if (_rv()._dsize()>0){ 395 395 rvc = _rv().copy_t(-1); … … 408 408 } 409 409 void validate() { 410 mpdf_internal<eDirich>::validate();410 pdf_internal<eDirich>::validate(); 411 411 bdm_assert(_beta.length()==betac.length(),"beta0 and betac are not compatible"); 412 412 if (_rv()._dsize()>0){ … … 644 644 645 645 //! Uniform density with conditional mean value 646 class mguni : public mpdf_internal<euni>{646 class mguni : public pdf_internal<euni>{ 647 647 //! function of the mean value 648 648 shared_ptr<fnc> mean; … … 656 656 //! load from 657 657 void from_setting(const Setting &set){ 658 mpdf::from_setting(set); //reads rv and rvc658 pdf::from_setting(set); //reads rv and rvc 659 659 UI::get(delta,set,"delta",UI::compulsory); 660 660 mean = UI::build<fnc>(set,"mean",UI::compulsory); … … 672 672 */ 673 673 template < class sq_T, template <typename> class TEpdf = enorm > 674 class mlnorm : public mpdf_internal< TEpdf<sq_T> >674 class mlnorm : public pdf_internal< TEpdf<sq_T> > 675 675 { 676 676 protected: … … 683 683 //! \name Constructors 684 684 //!@{ 685 mlnorm() : mpdf_internal< TEpdf<sq_T> >() {};686 mlnorm (const mat &A, const vec &mu0, const sq_T &R) : mpdf_internal< TEpdf<sq_T> >() {685 mlnorm() : pdf_internal< TEpdf<sq_T> >() {}; 686 mlnorm (const mat &A, const vec &mu0, const sq_T &R) : pdf_internal< TEpdf<sq_T> >() { 687 687 set_parameters (A, mu0, R); 688 688 } … … 724 724 */ 725 725 void from_setting (const Setting &set) { 726 mpdf::from_setting (set);726 pdf::from_setting (set); 727 727 728 728 UI::get (A, set, "A", UI::compulsory); … … 734 734 }; 735 735 void validate() { 736 mpdf_internal<TEpdf<sq_T> >::validate();736 pdf_internal<TEpdf<sq_T> >::validate(); 737 737 bdm_assert (A.rows() == mu_const.length(), "mlnorm: A vs. mu mismatch"); 738 738 bdm_assert (A.rows() == _R().rows(), "mlnorm: A vs. R mismatch"); … … 747 747 SHAREDPTR2 ( mlnorm, chmat ); 748 748 749 //! Mpdf with general function for mean value749 //! pdf with general function for mean value 750 750 template<class sq_T> 751 class mgnorm : public mpdf_internal< enorm< sq_T > >751 class mgnorm : public pdf_internal< enorm< sq_T > > 752 752 { 753 753 private: … … 757 757 public: 758 758 //!default constructor 759 mgnorm() : mpdf_internal<enorm<sq_T> >() { }759 mgnorm() : pdf_internal<enorm<sq_T> >() { } 760 760 //!set mean function 761 761 inline void set_parameters (const shared_ptr<fnc> &g0, const sq_T &R0); … … 782 782 783 783 void from_setting (const Setting &set) { 784 mpdf::from_setting(set);784 pdf::from_setting(set); 785 785 shared_ptr<fnc> g = UI::build<fnc> (set, "g", UI::compulsory); 786 786 … … 863 863 The standard deviation of the walk is then: \f$\mu/\sqrt(k)\f$. 864 864 */ 865 class mgamma : public mpdf_internal<egamma>865 class mgamma : public pdf_internal<egamma> 866 866 { 867 867 protected: … … 875 875 public: 876 876 //! Constructor 877 mgamma() : mpdf_internal<egamma>(), k (0),877 mgamma() : pdf_internal<egamma>(), k (0), 878 878 _beta (iepdf._beta()) { 879 879 } … … 895 895 */ 896 896 void from_setting (const Setting &set) { 897 mpdf::from_setting (set); // reads rv and rvc897 pdf::from_setting (set); // reads rv and rvc 898 898 vec betatmp; // ugly but necessary 899 899 UI::get (betatmp, set, "beta", UI::compulsory); … … 903 903 } 904 904 void validate() { 905 mpdf_internal<egamma>::validate();905 pdf_internal<egamma>::validate(); 906 906 907 907 dim = _beta.length(); … … 921 921 The standard deviation of the walk is then: \f$ \mu/\sqrt(k)\f$. 922 922 */ 923 class migamma : public mpdf_internal<eigamma>923 class migamma : public pdf_internal<eigamma> 924 924 { 925 925 protected: … … 936 936 //! \name Constructors 937 937 //!@{ 938 migamma() : mpdf_internal<eigamma>(),938 migamma() : pdf_internal<eigamma>(), 939 939 k (0), 940 940 _alpha (iepdf._alpha()), … … 942 942 } 943 943 944 migamma (const migamma &m) : mpdf_internal<eigamma>(),944 migamma (const migamma &m) : pdf_internal<eigamma>(), 945 945 k (0), 946 946 _alpha (iepdf._alpha()), … … 1074 1074 1075 1075 */ 1076 class mlognorm : public mpdf_internal<elognorm>1076 class mlognorm : public pdf_internal<elognorm> 1077 1077 { 1078 1078 protected: … … 1084 1084 public: 1085 1085 //! Constructor 1086 mlognorm() : mpdf_internal<elognorm>(),1086 mlognorm() : pdf_internal<elognorm>(), 1087 1087 sig2 (0), 1088 1088 mu (iepdf._mu()) { … … 1221 1221 1222 1222 //! Random Walk on inverse Wishart 1223 class rwiWishartCh : public mpdf_internal<eiWishartCh>1223 class rwiWishartCh : public pdf_internal<eiWishartCh> 1224 1224 { 1225 1225 protected: … … 1474 1474 1475 1475 template<class sq_T> 1476 shared_ptr< mpdf> enorm<sq_T>::condition ( const RV &rvn ) const1476 shared_ptr<pdf> enorm<sq_T>::condition ( const RV &rvn ) const 1477 1477 { 1478 1478 mlnorm<sq_T> *tmp = new mlnorm<sq_T> (); 1479 shared_ptr< mpdf> narrow(tmp);1479 shared_ptr<pdf> narrow(tmp); 1480 1480 condition ( rvn, *tmp ); 1481 1481 return narrow; … … 1483 1483 1484 1484 template<class sq_T> 1485 void enorm<sq_T>::condition ( const RV &rvn, mpdf &target ) const1485 void enorm<sq_T>::condition ( const RV &rvn, pdf &target ) const 1486 1486 { 1487 1487 typedef mlnorm<sq_T> TMlnorm; -
library/bdm/stat/merger.cpp
r682 r693 5 5 namespace bdm { 6 6 7 merger_base::merger_base ( const Array<shared_ptr< mpdf> > &S ):7 merger_base::merger_base ( const Array<shared_ptr<pdf> > &S ): 8 8 Npoints(0), DBG(false), dbg_file(0) { 9 9 set_sources ( S ); … … 134 134 135 135 136 sprintf ( dbg_str, " Mpdf%d", niter );136 sprintf ( dbg_str, "pdf%d", niter ); 137 137 for ( int i = 0; i < Npoints; i++ ) { 138 138 Mix_pdf ( i ) = Mix.logpred ( Smp_ex.get_col ( i ) ); … … 145 145 } 146 146 //Importace weighting 147 for ( int i = 0; i < mpdfs.length(); i++ ) {147 for ( int i = 0; i < pdfs.length(); i++ ) { 148 148 lw_src = 0.0; 149 149 //======== Same RVs =========== 150 150 //Split according to dependency in rvs 151 if ( mpdfs ( i )->dimension() == dim ) {151 if ( pdfs ( i )->dimension() == dim ) { 152 152 // no need for conditioning or marginalization 153 lw_src = mpdfs ( i )->evallogcond_m ( Smp , vec(0));153 lw_src = pdfs ( i )->evallogcond_m ( Smp , vec(0)); 154 154 } else { 155 155 // compute likelihood of marginal on the conditional variable 156 if ( mpdfs ( i )->dimensionc() > 0 ) {156 if ( pdfs ( i )->dimensionc() > 0 ) { 157 157 // Make marginal on rvc_i 158 shared_ptr<epdf> tmp_marg = Mpred->marginal ( mpdfs ( i )->_rvc() );158 shared_ptr<epdf> tmp_marg = Mpred->marginal ( pdfs ( i )->_rvc() ); 159 159 //compute vector of lw_src 160 160 for ( int k = 0; k < Npoints; k++ ) { 161 // Here val of tmp_marg = cond of mpdfs(i) ==> calling dls->get_cond161 // Here val of tmp_marg = cond of pdfs(i) ==> calling dls->get_cond 162 162 lw_src ( k ) += tmp_marg->evallog ( dls ( i )->get_cond ( Smp ( k ) ) ); 163 163 } … … 168 168 } 169 169 // Compute likelihood of the missing variable 170 if ( dim > ( mpdfs ( i )->dimension() + mpdfs ( i )->dimensionc() ) ) {170 if ( dim > ( pdfs ( i )->dimension() + pdfs ( i )->dimensionc() ) ) { 171 171 /////////////// 172 // There are variales unknown to mpdfs(i) : rvzs173 shared_ptr< mpdf> tmp_cond = Mpred->condition ( rvzs ( i ) );172 // There are variales unknown to pdfs(i) : rvzs 173 shared_ptr<pdf> tmp_cond = Mpred->condition ( rvzs ( i ) ); 174 174 // Compute likelihood 175 175 vec lw_dbg = lw_src; … … 187 187 // Compute likelihood of the partial source 188 188 for ( int k = 0; k < Npoints; k++ ) { 189 lw_src ( k ) += mpdfs ( i )->evallogcond ( dls ( i )->pushdown ( Smp ( k ) ),189 lw_src ( k ) += pdfs ( i )->evallogcond ( dls ( i )->pushdown ( Smp ( k ) ), 190 190 dls ( i )->get_cond ( Smp ( k ) )); 191 191 } -
library/bdm/stat/merger.h
r679 r693 46 46 protected: 47 47 //! Elements of composition 48 Array<shared_ptr< mpdf> > mpdfs;49 50 //! Data link for each mpdf in mpdfs48 Array<shared_ptr<pdf> > pdfs; 49 50 //! Data link for each pdf in pdfs 51 51 Array<datalink_m2e*> dls; 52 52 53 //! Array of rvs that are not modelled by mpdfs at all, \f$ z_i \f$53 //! Array of rvs that are not modelled by pdfs at all, \f$ z_i \f$ 54 54 Array<RV> rvzs; 55 55 … … 90 90 91 91 //!Constructor from sources 92 merger_base ( const Array<shared_ptr< mpdf> > &S );92 merger_base ( const Array<shared_ptr<pdf> > &S ); 93 93 94 94 //! Function setting the main internal structures 95 void set_sources ( const Array<shared_ptr< mpdf> > &Sources ) {96 mpdfs = Sources;97 Nsources = mpdfs.length();95 void set_sources ( const Array<shared_ptr<pdf> > &Sources ) { 96 pdfs = Sources; 97 Nsources = pdfs.length(); 98 98 //set sizes 99 99 dls.set_size ( Sources.length() ); … … 101 101 zdls.set_size ( Sources.length() ); 102 102 103 rv = get_composite_rv ( mpdfs, /* checkoverlap = */ false );103 rv = get_composite_rv ( pdfs, /* checkoverlap = */ false ); 104 104 105 105 RV rvc; 106 106 // Extend rv by rvc! 107 for ( int i = 0; i < mpdfs.length(); i++ ) {108 RV rvx = mpdfs ( i )->_rvc().subt ( rv );107 for ( int i = 0; i < pdfs.length(); i++ ) { 108 RV rvx = pdfs ( i )->_rvc().subt ( rv ); 109 109 rvc.add ( rvx ); // add rv to common rvc 110 110 } … … 117 117 // create links between sources and common rv 118 118 RV xytmp; 119 for ( int i = 0; i < mpdfs.length(); i++ ) {120 //Establich connection between mpdfs and merger119 for ( int i = 0; i < pdfs.length(); i++ ) { 120 //Establich connection between pdfs and merger 121 121 dls ( i ) = new datalink_m2e; 122 dls ( i )->set_connection ( mpdfs ( i )->_rv(), mpdfs ( i )->_rvc(), rv );123 124 // find out what is missing in each mpdf125 xytmp = mpdfs ( i )->_rv();126 xytmp.add ( mpdfs ( i )->_rvc() );122 dls ( i )->set_connection ( pdfs ( i )->_rv(), pdfs ( i )->_rvc(), rv ); 123 124 // find out what is missing in each pdf 125 xytmp = pdfs ( i )->_rv(); 126 xytmp.add ( pdfs ( i )->_rvc() ); 127 127 // z_i = common_rv-xy 128 128 rvzs ( i ) = rv.subt ( xytmp ); … … 185 185 //check if sources overlap: 186 186 bool OK = true; 187 for ( int i = 0; i < mpdfs.length(); i++ ) {187 for ( int i = 0; i < pdfs.length(); i++ ) { 188 188 OK &= ( rvzs ( i )._dsize() == 0 ); // z_i is empty 189 OK &= ( mpdfs ( i )->_rvc()._dsize() == 0 ); // y_i is empty189 OK &= ( pdfs ( i )->_rvc()._dsize() == 0 ); // y_i is empty 190 190 } 191 191 192 192 if ( OK ) { 193 mat lW = zeros ( mpdfs.length(), eSmp._w().length() );193 mat lW = zeros ( pdfs.length(), eSmp._w().length() ); 194 194 195 195 vec emptyvec ( 0 ); 196 for ( int i = 0; i < mpdfs.length(); i++ ) {196 for ( int i = 0; i < pdfs.length(); i++ ) { 197 197 for ( int j = 0; j < eSmp._w().length(); j++ ) { 198 lW ( i, j ) = mpdfs ( i )->evallogcond ( eSmp._samples() ( j ), emptyvec );198 lW ( i, j ) = pdfs ( i )->evallogcond ( eSmp._samples() ( j ), emptyvec ); 199 199 } 200 200 } … … 313 313 merger_mix ():Ncoms(0), effss_coef(0), stop_niter(0) { } 314 314 315 merger_mix ( const Array<shared_ptr< mpdf> > &S ):315 merger_mix ( const Array<shared_ptr<pdf> > &S ): 316 316 Ncoms(0), effss_coef(0), stop_niter(0) { 317 317 set_sources ( S ); … … 319 319 320 320 //! Set sources and prepare all internal structures 321 void set_sources ( const Array<shared_ptr< mpdf> > &S ) {321 void set_sources ( const Array<shared_ptr<pdf> > &S ) { 322 322 merger_base::set_sources ( S ); 323 323 Nsources = S.length();