Changeset 182
- Timestamp:
- 10/17/08 10:28:15 (16 years ago)
- Files:
-
- 14 modified
Legend:
- Unmodified
- Added
- Removed
-
bdm/estim/arx.cpp
r180 r182 62 62 63 63 est.mean_mat(mu,R); 64 //here I know that mu can have only one column 64 65 tmp->set_parameters(mu.get_col(0),ldmat(R)); 65 66 return tmp; -
bdm/estim/merger.cpp
r180 r182 17 17 case 4: 18 18 break; 19 default: // Approximate conditional density 20 break; 19 21 } 20 22 return vec ( 0 ); … … 34 36 for ( int i=0;i<Ns;i++ ) { set_col_part ( Smp_ex,i,Smp ( i ) );} 35 37 36 dbg << Name ( "Smp 0" ) << Smp_ex;38 dbg << Name ( "Smp_0" ) << Smp_ex; 37 39 38 40 // Stuff for merging … … 45 47 mat V0=1e-8*eye ( rv.count() +1 ); 46 48 ARX A0 ( RV ( "{th_r }", vec_1 ( rv.count() * ( rv.count() +1 ) ) ),\ 47 V0, 4.0 ); //initial guess of Mix: zero mean, large variance49 V0, rv.count() *rv.count() +3.0 ); //initial guess of Mix: zero mean, large variance 48 50 49 51 … … 53 55 int niter = 0; 54 56 char str[100]; 55 56 vec Mix_pdf(Ns); 57 58 epdf* Mpred; 59 vec Mix_pdf ( Ns ); 57 60 while ( !converged ) { 58 61 //Re-estimate Mix … … 60 63 Mix.init ( &A0, Smp_ex, Nc ); 61 64 Mix.bayesB ( Smp_ex ); 62 65 Mpred = Mix.predictor(rv); // Allocation => must be deleted at the end!! 66 63 67 // Generate new samples 64 eSmp.set_samples ( M ix.predictor ( rv ));68 eSmp.set_samples ( Mpred ); 65 69 for ( int i=0;i<Ns;i++ ) { set_col_part ( Smp_ex,i,Smp ( i ) );} 66 70 67 71 sprintf ( str,"Mpdf%d",niter ); 68 for ( int i=0;i<Ns;i++){Mix_pdf(i) = Mix.logpred(Smp_ex.get_col(i));}72 for ( int i=0;i<Ns;i++ ) {Mix_pdf ( i ) = Mix.logpred ( Smp_ex.get_col ( i ) );} 69 73 dbg << Name ( str ) << Mix_pdf; 70 74 … … 74 78 //Importace weighting 75 79 for ( int i=0;i<n;i++ ) { 80 lw_src=0.0; 81 //======== Same RVs =========== 76 82 //Split according to dependency in rvs 77 //======== Same RVs ===========78 83 if ( rvsinrv ( i ).length() ==rv.count() ) { 79 84 // no need for conditioning or marginalization 80 for ( int j=0;j<Ns; j++ ) {85 for ( int j=0;j<Ns; j++ ) { // Smp is Array<> => for cycle 81 86 lw_src ( j ) =mpdfs ( i )->_epdf().evalpdflog ( Smp ( j ) ); 87 } 88 } 89 else { 90 vec smpk; 91 // compute likelihood of marginal on the conditional variable 92 if ( mpdfs ( i )->_rvc().count() >0 ) { 93 // Make marginal on rvc_i 94 epdf* tmp_marg = Mpred->marginal ( mpdfs ( i )->_rvc() ); 95 lw_src += tmp_marg->evalpdflog_m ( get_vec(Smp(i), irv_rvcs(i) ) ); 96 delete tmp_marg; 97 } 98 // Compute likelihood of the missing variable 99 if ( rv.count() > mpdfs ( i )->_rv().count() + mpdfs ( i )->_rvc().count() ) { 100 // There are variales unknown to mpdfs 101 RV z = ( rv.subt ( mpdfs ( i )->_rv() ) ).subt ( mpdfs ( i )->_rvc() ); 102 mpdf* tmp_cond = Mpred->condition ( z ); 103 // Indeces of rest rv in Smp 104 ivec zinrv=z.dataind ( rv ) ; 105 // Indeces of rest rvc in Smp 106 ivec zinrvc=tmp_cond->_rvc().dataind ( rv ); 107 // Compute likelihood 108 for ( int k= 0; k<Ns; k++ ) { 109 smpk=Smp( k ); 110 tmp_cond->condition ( get_vec ( smpk,zinrvc ) ); 111 lw_src ( k ) += tmp_cond->_epdf().evalpdflog ( get_vec ( smpk,zinrv ) ); 112 } 113 delete tmp_cond; 114 } 115 // Compute likelihood of the partial source 116 for ( int k= 0; k<Ns; k++ ) { 117 smpk=Smp( k ); 118 mpdfs ( i )->condition ( get_vec ( smpk,irvcs_rv(i) ) ); 119 lw_src ( k ) += mpdfs ( i )->_epdf().evalpdflog ( get_vec ( smpk, rvsinrv ( i ) ) ); 82 120 } 83 121 } … … 92 130 93 131 w = lognorm_merge ( lW ); //merge 94 132 95 133 sprintf ( str,"w%d",niter ); 96 134 dbg << Name ( str ) << w; 135 sprintf ( str,"lw_m%d",niter ); 136 dbg << Name ( str ) << lw_mix; 97 137 98 138 //Importance weighting … … 100 140 //renormalize 101 141 w /=sum ( w ); 142 143 sprintf ( str,"w_is_%d",niter ); 144 dbg << Name ( str ) << w; 102 145 103 146 eSmp.resample(); // So that it can be used in bayes … … 109 152 // ==== stopping rule === 110 153 niter++; 111 converged = ( niter> 3);154 converged = ( niter>20); 112 155 } 113 156 -
bdm/estim/merger.h
r180 r182 60 60 //! weight w is a 61 61 vec sample ( )const { return Mix._epdf().sample();} 62 double evalpdflog ( const vec &dt ) const{ vec dtf=zeros(dt.length()+1); dtf.set_subvector(0,dt); return Mix.logpred ( dtf );} 62 double evalpdflog ( const vec &dt ) const{ 63 vec dtf=ones(dt.length()+1); 64 dtf.set_subvector(0,dt); 65 return Mix.logpred ( dtf );} 63 66 vec mean()const {return Mix._epdf().mean();} 64 67 //! for future use 65 68 virtual ~merger() {}; 69 70 //! Access function 71 MixEF& _Mix() {return Mix;} 66 72 }; 67 73 -
bdm/stat/emix.cpp
r181 r182 31 31 } 32 32 33 // mprod::mprod ( Array<mpdf*> mFacs, bool overlap) : mpdf ( RV(), RV() ), n ( mFacs.length() ), epdfs ( n ), mpdfs ( mFacs ), rvinds ( n ), rvcinrv ( n ), rvcsinrvc ( n ) { 33 emix* emix::marginal(const RV &rv) const{ 34 Array<epdf*> Cn(Coms.length()); 35 for(int i=0;i<Coms.length();i++){Cn(i)=Coms(i)->marginal(rv);} 36 emix* tmp = new emix(rv); 37 tmp->set_parameters(w,Coms,false); 38 tmp->ownComs(); 39 return tmp; 40 } 41 42 mratio* emix::condition(const RV &rv) const{ 43 return new mratio(this,rv); 44 }; 45 46 // mprod::mprod ( Array<mpdf*> mFacs, bool overlap) : mpdf ( RV(), RV() ), n ( mFacs.length() ), epdfs ( n ), mpdfs ( mFacs ), rvinds ( n ), rvcinrv ( n ), irvcs_rvc ( n ) { 34 47 // int i; 35 48 // bool rvaddok; … … 54 67 // rvcinrv ( i ) = mpdfs ( i )->_rvc().dataind ( rv ); 55 68 // // find ith rvc in common rv 56 // rvcsinrvc ( i ) = mpdfs ( i )->_rvc().dataind ( rvc );69 // irvcs_rvc ( i ) = mpdfs ( i )->_rvc().dataind ( rvc ); 57 70 // // 58 71 // /* if ( rvcinrv ( i ).length() >0 ) {independent = false;} 59 // if ( rvcsinrvc ( i ).length() >0 ) {independent = false;}*/72 // if ( irvcs_rvc ( i ).length() >0 ) {independent = false;}*/ 60 73 // } 61 74 // }; -
bdm/stat/emix.h
r181 r182 19 19 20 20 using namespace itpp; 21 22 //this comes first because it is used inside emix! 23 24 /*! \brief Class representing ratio of two densities 25 which arise e.g. by applying the Bayes rule. 26 It represents density in the form: 27 \f[ 28 f(rv|rvc) = \frac{f(rv,rvc)}{f(rvc)} 29 \f] 30 where \f$ f(rvc) = \int f(rv,rvc) d\ rv \f$. 31 32 In particular this type of arise by conditioning of a mixture model. 33 34 At present the only supported operation is evalcond(). 35 */ 36 class mratio: public mpdf { 37 protected: 38 //! Nominator in the form of mpdf 39 const epdf* nom; 40 //!Denominator in the form of epdf 41 epdf* den; 42 //!flag for destructor 43 bool destroynom; 44 public: 45 //!Default constructor. By default, the given epdf is not copied! 46 //! It is assumed that this function will be used only temporarily. 47 mratio(const epdf* nom0, const RV &rv, bool copy=false):mpdf(rv,RV()){ 48 if (copy){ 49 // nom = nom0->_copy_(); 50 destroynom=true; 51 } else { 52 nom = nom0; 53 destroynom = false; 54 } 55 rvc = nom->_rv().subt(rv); 56 it_assert_debug(rvc.length()>0,"Makes no sense to use this object!"); 57 den = nom->marginal(rvc); 58 }; 59 double evalcond(const vec &val, const vec &cond) const { 60 return exp(nom->evalpdflog(concat(val,cond)) - den->evalpdflog(cond)); 61 } 62 //! Object takes ownership of nom and will destroy it 63 void ownnom(){destroynom=true;} 64 //! Default destructor 65 ~mratio(){delete den; if (destroynom) {delete nom;}} 66 }; 21 67 22 68 /*! … … 41 87 //!Default constructor 42 88 emix ( const RV &rv ) : epdf ( rv ) {}; 43 //! Set weights \c w and components \c Coms , Coms are not copied! 89 //! Set weights \c w and components \c Coms 90 //!By default Coms are copied inside. \param copy can be set to false if Coms live externally. Use method ownComs() if Coms should be destroyed by the destructor. 44 91 void set_parameters ( const vec &w, const Array<epdf*> &Coms, bool copy=true ); 45 92 … … 56 103 return log ( sum ); 57 104 }; 105 vec evalpdflog_m ( const mat &Val ) const { 106 vec x=ones(Val.cols()); 107 vec y(Val.cols()); 108 for (int i = 0; i < w.length(); i++ ) { 109 y = w ( i )*exp(Coms ( i )->evalpdflog_m ( Val ) ); 110 elem_mult_inplace(y,x); //result is in x 111 } 112 return log(x); 113 }; 114 115 emix* marginal ( const RV &rv ) const; 116 mratio* condition ( const RV &rv ) const; //why not mratio!! 58 117 59 118 //Access methods … … 78 137 Array<epdf*> epdfs; 79 138 //! Indeces of rvc in common rvc 80 Array<ivec> rvcsinrvc;139 Array<ivec> irvcs_rvc; 81 140 //! Indeces of common rvc in rvcs 82 Array<ivec> rvcinrvcs;141 Array<ivec> irvc_rvcs; 83 142 public: 84 143 /*!\brief Constructor from list of mFacs, 85 144 */ 86 mprod ( Array<mpdf*> mFacs ) : compositepdf ( mFacs ), mpdf ( getrv ( true ),RV() ), epdfs ( n ), rvcsinrvc( n ) {145 mprod ( Array<mpdf*> mFacs ) : compositepdf ( mFacs ), mpdf ( getrv ( true ),RV() ), epdfs ( n ), irvcs_rvc ( n ), irvc_rvcs ( n ) { 87 146 setrvc ( rv,rvc ); 88 147 setindices ( rv ); 89 148 for ( int i = 0;i < n;i++ ) { 90 // find ith rvc in common rv 91 rvcsinrvc ( i ) = mpdfs ( i )->_rvc().dataind ( rvc ); 92 //and vice-versa 93 rvcinrvcs ( i ) = rvc.dataind ( mpdfs ( i )->_rvc() ); 149 // establish link between rvc and rvcs 150 rvc.dataind ( mpdfs ( i )->_rvc(), irvc_rvcs ( i ), irvcs_rvc ( i ) ); 94 151 } 95 152 … … 99 156 }; 100 157 101 double evalcond ( const vec &val, const vec &cond ) const{158 double evalcond ( const vec &val, const vec &cond ) { 102 159 int i; 103 160 double res = 0.0; 104 161 vec condi; 105 for ( i = n - 1;i > 0;i++) {106 if ( ( rvcsinrvc ( i ).length() > 0 ) || ( rvcsinrv ( i ).length() > 0 ) ) {107 condi = zeros ( rvcsinrvc ( i ).length() +rvcsinrv ( i ).length() );162 for ( i = n - 1;i >= 0;i-- ) { 163 if ( ( irvcs_rvc ( i ).length() > 0 ) || ( irvcs_rv ( i ).length() > 0 ) ) { 164 condi = zeros ( irvcs_rvc ( i ).length() +irvcs_rv ( i ).length() ); 108 165 //copy part of the rvc into condi 109 set_subvector ( condi, rvcinrvcs ( i ), get_vec ( cond,rvcsinrvc( i ) ) );166 set_subvector ( condi, irvcs_rvc ( i ), get_vec ( cond,irvc_rvcs ( i ) ) ); 110 167 //copy part of the rv into condi 111 set_subvector ( condi, rvinrvcs ( i ), get_vec ( val,rvcsinrv( i ) ) );168 set_subvector ( condi, irvcs_rv ( i ), get_vec ( val,irv_rvcs ( i ) ) ); 112 169 mpdfs ( i )->condition ( condi ); 113 170 } … … 115 172 res += epdfs ( i )->evalpdflog ( val ( rvsinrv ( i ) ) ); 116 173 } 117 return res;174 return exp ( res ); 118 175 } 119 176 vec samplecond ( const vec &cond, double &ll ) { … … 123 180 ll = 0; 124 181 for ( int i = ( n - 1 );i >= 0;i-- ) { 125 if ( ( rvcsinrvc ( i ).length() > 0 ) || ( rvcsinrv ( i ).length() > 0 ) ) {126 condi = zeros ( rvcsinrv ( i ).length() + rvcsinrvc ( i ).length() );182 if ( ( irvcs_rvc ( i ).length() > 0 ) || ( irvcs_rv ( i ).length() > 0 ) ) { 183 condi = zeros ( irvcs_rv ( i ).length() + irvcs_rvc ( i ).length() ); 127 184 // copy data in condition 128 set_subvector ( condi, rvcsinrvc ( i ), cond);185 set_subvector ( condi,irvcs_rvc ( i ), get_vec ( cond, irvc_rvcs ( i ) ) ); 129 186 // copy data in already generated sample 130 set_subvector ( condi, rvinrvcs ( i ), get_vec ( smp,rvcsinrv( i ) ) );187 set_subvector ( condi,irvcs_rv ( i ), get_vec ( smp,irv_rvcs ( i ) ) ); 131 188 132 189 mpdfs ( i )->condition ( condi ); … … 220 277 }; 221 278 }; 279 222 280 #endif //MX_H -
bdm/stat/libBM.cpp
r181 r182 151 151 } 152 152 } 153 it_assert_debug(res.length()==tsize,"this rv is not fully present in crv!"); 153 154 return res; 154 155 156 } 157 158 void RV::dataind (const RV &rv2, ivec &selfi, ivec &rv2i) const { 159 //clean results 160 selfi.set_size(0); 161 rv2i.set_size(0); 162 163 // just in case any rv is empty 164 if ((len==0)||(rv2.length()==0)){return;} 165 166 //find comon rv 167 ivec cids=itpp::find(this->findself(rv2)>=0); 168 169 // index of 170 if ( cids.length()>0 ) { 171 str str1 = tostr(); 172 str str2 = rv2.tostr(); 173 174 ivec part1; 175 ivec part2; 176 int i,j; 177 // find common rv in strs 178 for ( j=0; j < cids.length();j++ ) { 179 i = cids(j); 180 part1 = itpp::find ( ( str1.ids == ids ( i ) ) & ( str1.times == times ( i ) ) ); 181 part2 = itpp::find ( ( str2.ids == ids ( i ) ) & ( str2.times == times ( i ) ) ); 182 selfi = concat ( selfi, part1 ); 183 rv2i = concat ( rv2i, part2 ); 184 } 185 } 186 it_assert_debug(selfi.length() == rv2i.length(),"this should not happen!"); 155 187 } 156 188 … … 206 238 // find ith rv in common rv 207 239 rvsinrv ( i ) = mpdfs ( i )->_rv().dataind ( rv ); 208 rvcsinrv ( i ) = mpdfs ( i )->_rvc().dataind ( rv ); 209 rvinrvcs ( i ) = rv.dataind(mpdfs ( i )->_rvc()); 210 //rvcsinrv and rvinrvcs must be 1-to-1 211 it_assert_debug(rvcsinrv ( i ).length()==rvinrvcs(i).length(),"" ); 240 // establish link between rv and rvc 241 rv.dataind(mpdfs(i)->_rvc(), irv_rvcs(i), irvcs_rv(i)); 212 242 } 213 243 } -
bdm/stat/libBM.h
r181 r182 92 92 //! generate \c str from rv, by expanding sizes 93 93 str tostr() const; 94 //! generate indeces into \param crv data vector that form data vector of self. 94 //! when this rv is a part of bigger rv, this function returns indeces of self in the data vector of the bigger crv. 95 //! Then, data can be copied via: data_of_this = cdata(ind); 95 96 ivec dataind(const RV &crv) const; 97 //! generate mutual indeces when copying data betwenn self and crv. 98 //! Data are copied via: data_of_this(selfi) = data_of_rv2(rv2i) 99 void dataind(const RV &rv2, ivec &selfi, ivec &rv2i) const; 96 100 97 101 //!access function … … 178 182 } 179 183 //! Return conditional density on the given RV, the remaining rvs will be in conditioning 180 mpdf* condition(const RV &rv){it_warning("Not implemented"); return NULL;}184 virtual mpdf* condition(const RV &rv) const {it_warning("Not implemented"); return NULL;} 181 185 //! Return marginal density on the given RV, the remainig rvs are intergrated out 182 epdf* marginal(const RV &rv) {it_warning("Not implemented"); return NULL;}186 epdf* marginal(const RV &rv) const {it_warning("Not implemented"); return NULL;} 183 187 184 188 //! return expected value … … 248 252 //!Default constructor 249 253 mepdf (epdf &em ) :mpdf ( em._rv(),RV() ) {ep=&em;}; 254 void condition(const vec &cond){} 250 255 }; 251 256 … … 260 265 Array<ivec> rvsinrv; 261 266 //! Indeces of rvc in common rv 262 Array<ivec> rvcsinrv;267 Array<ivec> irvcs_rv; 263 268 //! Indeces of common rv in rvc 264 Array<ivec> rvinrvcs;269 Array<ivec> irv_rvcs; 265 270 public: 266 compositepdf(Array<mpdf*> A0): n(A0.length()), mpdfs(A0), rvsinrv(n), rvcsinrv(n),rvinrvcs(n){};271 compositepdf(Array<mpdf*> A0): n(A0.length()), mpdfs(A0), rvsinrv(n), irvcs_rv(n),irv_rvcs(n){}; 267 272 //! find common rv, flag \param checkoverlap modifies whether overlaps are acceptable 268 273 RV getrv(bool checkoverlap=false); -
bdm/stat/libEF.cpp
r178 r182 95 95 96 96 // set mean value 97 M= iLsub*L ( xdim,end,0,xdim-1 );97 M= L ( xdim,end,0,xdim-1 ).T()*iLsub; 98 98 R= ldR.to_mat() ; 99 99 } … … 207 207 N_babies ( j ) ++; 208 208 } 209 210 209 // We have assigned new babies for each Particle 211 210 // Now, we fill the resulting index such that: -
bdm/stat/libEF.h
r181 r182 130 130 double lognc () const; 131 131 vec mean() const {return mu;} 132 mlnorm<sq_T>* condition ( const RV &rvn ) ;133 enorm<sq_T>* marginal ( const RV &rv ) ;132 mlnorm<sq_T>* condition ( const RV &rvn ) const ; 133 enorm<sq_T>* marginal ( const RV &rv ) const; 134 134 //Access methods 135 135 //! returns a pointer to the internal mean value. Use with Care! … … 384 384 //! Set value of \c rvc . Result of this operation is stored in \c epdf use function \c _ep to access it. 385 385 void condition (const vec &cond ); 386 387 /* template<class sq_M> 388 friend std::ostream &operator<< ( std::ostream &os, const mlnorm<sq_M> &ml );*/ 386 389 }; 387 390 … … 594 597 595 598 template<class sq_T> 596 enorm<sq_T>* enorm<sq_T>::marginal ( const RV &rvn ) {599 enorm<sq_T>* enorm<sq_T>::marginal ( const RV &rvn ) const { 597 600 ivec irvn = rvn.dataind ( rv ); 598 601 … … 604 607 605 608 template<class sq_T> 606 mlnorm<sq_T>* enorm<sq_T>::condition ( const RV &rvn ) {609 mlnorm<sq_T>* enorm<sq_T>::condition ( const RV &rvn ) const { 607 610 608 611 RV rvc = rv.subt ( rvn ); … … 620 623 int end=R.rows()-1; 621 624 mat S11 = S.get ( 0,n, 0, n ); 622 mat S12 = S.get ( rvn.count(), end, 0, n);625 mat S12 = S.get (0, n , rvn.count(), end ); 623 626 mat S22 = S.get ( rvn.count(), end, rvn.count(), end ); 624 627 … … 636 639 /////////// 637 640 641 // template<class sq_T> 642 // std::ostream &operator<< ( std::ostream &os, const mlnorm<sq_T> &ml ){ 643 // os << "A:"<< ml.A<<endl; 644 // os << "mu:"<< ml.mu_const<<endl; 645 // os << "R:" << ml.est._R().to_mat() <<endl; 646 // return os; 647 // } 648 // ; 638 649 639 650 #endif //EF_H -
linux/gdb_bdm
r88 r182 76 76 77 77 define dv 78 output $arg0.data[0]@($arg0.datasize) 79 end 80 define dvx 81 output $arg0.data[0]@($arg0.datasize) 78 if $arg0.datasize >0 79 output $arg0.data[0]@($arg0.datasize) 80 else 81 printf "{}" 82 end 82 83 end 83 84 … … 86 87 dv $arg0.D 87 88 end 89 90 define drv 91 dv $arg0.ids 92 dv $arg0.sizes 93 dv $arg0.times 94 end -
tests/CMakeLists.txt
r179 r182 23 23 # Add executable called "helloDemo" that is built from the source files 24 24 # "demo.cxx" and "demo_b.cxx". The extensions are automatically found. 25 26 # BASIC TESTS 27 TEST(rv_test) 28 TEST(loggers_test) 29 25 30 TEST(chmat_test) 26 31 TEST(ldmat_test) 27 32 TEST(fsqmat_test) 28 TEST(arx_test)29 TEST(loggers_test)30 TEST(rv_test)31 TEST(merger_test)32 TEST(mixef_test)33 33 TEST(enorm_test) 34 34 TEST(egiw_test) 35 35 TEST(test0) 36 TEST(testResample) 37 38 # ESTIM TESTS 39 TEST(arx_test) 40 TEST(merger_test) 41 TEST(merger_iter_test) 42 TEST(mixef_test) 43 36 44 TEST(testKF) 37 45 TEST(testPF) 38 46 TEST(testSmp) 39 47 TEST(testEpdf) 40 TEST(testResample)41 48 TEST(testKF_QR) 42 49 TEST(testKF_QRexh) -
tests/enorm_test.cpp
r179 r182 71 71 cout << "composite mean: " <<Emu <<endl; 72 72 cout << "composite variance: " <<Er <<endl; 73 74 cout << endl << " test of pdflog at zero "<<endl; 75 cout << "original: " << exp(E.evalpdflog(vec("0 0"))) <<endl; 76 cout << "composite: " << mEp.evalcond(vec("0 0"),vec(0)) << endl; 73 77 } -
tests/merger_test.cpp
r180 r182 48 48 vec mm2 = M.evalpdflog_m(x_grid); 49 49 50 /* M.set_parameters(1.0,10,3);51 vec m1 = M.lognorm_merge(lW);52 M.merge(&g0);53 vec mm1 = M.evalpdflog_m(x_grid);54 55 M.set_parameters(3.0,10,3);56 vec m3 = M.lognorm_merge(lW);57 M.merge(&g0);58 vec mm3 = M.evalpdflog_m(x_grid);59 60 M.set_parameters(300.0,10,3);61 vec m300 = M.lognorm_merge(lW);62 M.merge(&g0);63 vec mm300 = M.evalpdflog_m(x_grid);*/64 65 50 it_file it("merger_test.it"); 66 51 it << Name("lf1") << l_f1; 67 52 it << Name("lf2") << l_f2; 68 /* it << Name("m1") << m1;69 it << Name("mm1") << mm1;*/70 53 it << Name("m2") << m2; 71 54 it << Name("mm2") << mm2; 72 /* it << Name("m3") << m3;73 it << Name("mm3") << mm3;74 it << Name("m300") << m300;75 it << Name("mm300") << mm300;*/76 55 } -
tests/rv_test.cpp
r162 r182 42 42 cout << ac.dataind(abc) <<endl; 43 43 44 cout<< "copy indeces between ba and ab" << endl; 45 RV ba = b; 46 ba.add(a); 47 48 ivec ai; 49 ivec bi; 50 ba.dataind(ac,ai,bi); 51 cout << "ba(" << ai <<")=ac(" << bi <<")"<<endl; 52 44 53 //Exit program: 45 54