Legend:
- Unmodified
- Added
- Removed
-
bdm/estim/arx.cpp
r270 r283 44 44 } 45 45 46 ARX* ARX::_copy_ ( ) {46 ARX* ARX::_copy_ ( ) const { 47 47 ARX* Tmp=new ARX ( *this ); 48 48 return Tmp; -
bdm/estim/arx.h
r271 r283 55 55 ARX ( const double frg0=1.0 ) : BMEF ( frg0 ),est (), V ( est._V() ), nu ( est._nu() ) {}; 56 56 ARX ( const ARX &A0 ) : BMEF (),est ( A0.est ), V ( est._V() ), nu ( est._nu() ) {}; 57 ARX* _copy_() ;57 ARX* _copy_() const; 58 58 void set_parameters ( double frg0 ) {frg=frg0;} 59 59 void set_statistics ( int dimx0, const ldmat V0, double nu0=-1.0 ) {est.set_parameters ( dimx0,V0,nu0 );last_lognc=est.lognc();dimx=dimx0;} -
bdm/estim/ekf_templ.h
r279 r283 19 19 20 20 //!Extended Kalman filter with unknown \c Q and \c R 21 class EKFful_unQR : public EKFfull , public BMcond{21 class EKFful_unQR : public EKFfull { 22 22 public: 23 //! Default constructor24 EKFful_unQR ( ) :EKFfull ( ),BMcond ( ) {};25 23 void condition ( const vec &QR0 ) { 26 24 Q=diag(QR0(0,dimx-1)); … … 30 28 31 29 //!Extended Kalman filter in Choleski form with unknown \c Q 32 class EKFCh_unQ : public EKFCh , public BMcond{30 class EKFCh_unQ : public EKFCh { 33 31 public: 34 //! Default constructor35 EKFCh_unQ ( ) :EKFCh ( ),BMcond ( ) {};36 32 void condition ( const vec &Q0 ) { 37 33 Q.setD ( Q0,0 ); … … 42 38 43 39 //!Extended Kalman filter with unknown parameters in \c IM 44 class EKFCh_cond : public EKFCh , public BMcond{40 class EKFCh_cond : public EKFCh { 45 41 public: 46 //! Default constructor47 EKFCh_cond ( ) :EKFCh ( ),BMcond ( ) {};48 42 void condition ( const vec &val ) { 49 43 pfxu->condition ( val ); -
bdm/estim/libKF.cpp
r279 r283 69 69 70 70 dimx = pfxu0->_dimx(); 71 dimy = phxu0-> _dimy();71 dimy = phxu0->dimension(); 72 72 dimu = pfxu0->_dimu(); 73 73 … … 169 169 phxu = phxu0; 170 170 171 dimx = pfxu0-> _dimy();172 dimy = phxu0-> _dimy();171 dimx = pfxu0->dimension(); 172 dimy = phxu0->dimension(); 173 173 dimu = pfxu0->_dimu(); 174 174 // set size of mu - just for constant terms of A and C … … 249 249 } 250 250 251 void KFcondQR::condition ( const vec &QR ) { 252 it_assert_debug ( QR.length() == ( dimx+dimy ),"KFcondRQ: conditioning by incompatible vector" ); 253 254 Q.setD ( QR ( 0, dimx-1 ) ); 255 R.setD ( QR ( dimx, -1 ) ); 256 }; 257 258 void KFcondR::condition ( const vec &R0 ) { 259 it_assert_debug ( R0.length() == ( dimy ),"KFcondR: conditioning by incompatible vector" ); 260 261 R.setD ( R0 ); 262 }; 263 264 265 } 251 } -
bdm/estim/libKF.h
r279 r283 19 19 #include "../math/chmat.h" 20 20 21 namespace bdm {21 namespace bdm { 22 22 23 23 /*! … … 49 49 friend std::ostream &operator<< ( std::ostream &os, const KalmanFull &kf ); 50 50 //! For EKFfull; 51 KalmanFull() {};51 KalmanFull() {}; 52 52 }; 53 53 … … 56 56 * \brief Kalman filter with covariance matrices in square root form. 57 57 58 Parameter evolution model:\f[ x_t = A x_{t-1} + B u_t + Q^{1/2} e_t \f] 58 Parameter evolution model:\f[ x_t = A x_{t-1} + B u_t + Q^{1/2} e_t \f] 59 59 Observation model: \f[ y_t = C x_{t-1} + C u_t + Q^{1/2} w_t. \f] 60 Where $e_t$ and $w_t$ are independent vectors Normal(0,1)-distributed disturbances. 60 Where $e_t$ and $w_t$ are independent vectors Normal(0,1)-distributed disturbances. 61 61 */ 62 62 template<class sq_T> … … 77 77 mat A; 78 78 //! Matrix B 79 mat B; 79 mat B; 80 80 //! Matrix C 81 81 mat C; … … 112 112 //! Set estimate values, used e.g. in initialization. 113 113 void set_est ( const vec &mu0, const sq_T &P0 ) { 114 sq_T pom (dimy);114 sq_T pom ( dimy ); 115 115 est.set_parameters ( mu0,P0 ); 116 P0.mult_sym (C,pom);116 P0.mult_sym ( C,pom ); 117 117 fy.set_parameters ( C*mu0, pom ); 118 118 }; … … 133 133 Trivial example: 134 134 \include kalman_simple.cpp 135 136 */ 137 class KalmanCh : public Kalman<chmat> {135 136 */ 137 class KalmanCh : public Kalman<chmat> { 138 138 protected: 139 139 //! pre array (triangular matrix) 140 mat preA;140 mat preA; 141 141 //! post array (triangular matrix) 142 mat postA; 143 144 public: 145 //! Default constructor 146 KalmanCh ():Kalman<chmat>(),preA(),postA(){}; 142 mat postA; 143 144 public: 145 //! copy constructor 146 BM* _copy_() const { 147 KalmanCh* K=new KalmanCh; 148 K->set_parameters ( A,B,C,D,Q,R ); 149 K->set_statistics ( _mu,_P ); 150 return K; 151 } 147 152 //! Set parameters with check of relevance 148 153 void set_parameters ( const mat &A0,const mat &B0,const mat &C0,const mat &D0,const chmat &Q0,const chmat &R0 ); … … 150 155 est.set_parameters ( mu0,P0 ); 151 156 }; 152 153 157 158 154 159 /*!\brief Here dt = [yt;ut] of appropriate dimensions 155 160 156 161 The following equality hold::\f[ 157 \left[\begin{array}{cc}158 R^{0.5}\\159 P_{t|t-1}^{0.5}C' & P_{t|t-1}^{0.5}CA'\\160 161 R_{y}^{0.5} & KA'\\162 163 \\\end{array}\right]\f]164 165 Thus this object evaluates only predictors! Not filtering densities.162 \left[\begin{array}{cc} 163 R^{0.5}\\ 164 P_{t|t-1}^{0.5}C' & P_{t|t-1}^{0.5}CA'\\ 165 & Q^{0.5}\end{array}\right]<\mathrm{orth.oper.}>=\left[\begin{array}{cc} 166 R_{y}^{0.5} & KA'\\ 167 & P_{t+1|t}^{0.5}\\ 168 \\\end{array}\right]\f] 169 170 Thus this object evaluates only predictors! Not filtering densities. 166 171 */ 167 172 void bayes ( const vec &dt ); … … 179 184 //! Observation Model h(x,u) 180 185 diffbifn* phxu; 181 182 enorm<fsqmat> E; 186 187 enorm<fsqmat> E; 183 188 public: 184 189 //! Default constructor … … 189 194 void bayes ( const vec &dt ); 190 195 //! set estimates 191 void set_est ( vec mu0, mat P0){mu=mu0;P=P0;};196 void set_est ( vec mu0, mat P0 ) {mu=mu0;P=P0;}; 192 197 //!dummy! 193 const epdf& posterior() const{return E;};194 const enorm<fsqmat>* _e() const{return &E;};195 const mat _R() {return P;}198 const epdf& posterior() const{return E;}; 199 const enorm<fsqmat>* _e() const{return &E;}; 200 const mat _R() {return P;} 196 201 }; 197 202 … … 210 215 //! Default constructor 211 216 EKF ( RV rvx, RV rvy, RV rvu ); 217 //! copy constructor 218 EKF<sq_T>* _copy_() const { return new EKF<sq_T>(this); } 212 219 //! Set nonlinear functions for mean values and covariance matrices. 213 220 void set_parameters ( diffbifn* pfxu, diffbifn* phxu, const sq_T Q0, const sq_T R0 ); … … 223 230 224 231 class EKFCh : public KalmanCh { 225 232 protected: 226 233 //! Internal Model f(x,u) 227 234 diffbifn* pfxu; … … 229 236 diffbifn* phxu; 230 237 public: 238 //! copy constructor duplicated - calls different set_parameters 239 BM* _copy_() const { 240 EKFCh* E=new EKFCh; 241 E->set_parameters ( pfxu,phxu,Q,R ); 242 E->set_statistics ( _mu,_P ); 243 return E; 244 } 231 245 //! Set nonlinear functions for mean values and covariance matrices. 232 246 void set_parameters ( diffbifn* pfxu, diffbifn* phxu, const chmat Q0, const chmat R0 ); … … 239 253 */ 240 254 241 class KFcondQR : public Kalman<ldmat> , public BMcond{255 class KFcondQR : public Kalman<ldmat> { 242 256 //protected: 243 257 public: 258 void condition ( const vec &QR ) { 259 it_assert_debug ( QR.length() == ( dimx+dimy ),"KFcondRQ: conditioning by incompatible vector" ); 260 261 Q.setD ( QR ( 0, dimx-1 ) ); 262 R.setD ( QR ( dimx, -1 ) ); 263 }; 264 }; 265 266 /*! 267 \brief Kalman Filter with conditional diagonal matrices R and Q. 268 */ 269 270 class KFcondR : public Kalman<ldmat> { 271 //protected: 272 public: 244 273 //!Default constructor 245 KFcondQR ( ) : Kalman<ldmat> ( ),BMcond ( ) {}; 246 247 void condition ( const vec &RQ ); 248 }; 249 250 /*! 251 \brief Kalman Filter with conditional diagonal matrices R and Q. 252 */ 253 254 class KFcondR : public Kalman<ldmat>, public BMcond { 255 //protected: 256 public: 257 //!Default constructor 258 KFcondR ( ) : Kalman<ldmat> ( ),BMcond ( ) {}; 259 260 void condition ( const vec &R ); 274 KFcondR ( ) : Kalman<ldmat> ( ) {}; 275 276 void condition ( const vec &R0 ) { 277 it_assert_debug ( R0.length() == ( dimy ),"KFcondR: conditioning by incompatible vector" ); 278 279 R.setD ( R0 ); 280 }; 281 261 282 }; 262 283 … … 267 288 dimx ( K0.dimx ), dimy ( K0.dimy ),dimu ( K0.dimu ), 268 289 A ( K0.A ), B ( K0.B ), C ( K0.C ), D ( K0.D ), 269 Q (K0.Q), R(K0.R),270 est ( K0.est ), fy ( K0.fy ), _yp (fy._mu()),_Ry(fy._R()), _mu(est._mu()), _P(est._R()) {290 Q ( K0.Q ), R ( K0.R ), 291 est ( K0.est ), fy ( K0.fy ), _yp ( fy._mu() ),_Ry ( fy._R() ), _mu ( est._mu() ), _P ( est._R() ) { 271 292 272 293 // copy values in pointers … … 279 300 280 301 template<class sq_T> 281 Kalman<sq_T>::Kalman ( ) : BM (), est ( ), fy (), _yp (fy._mu()), _Ry(fy._R()), _mu(est._mu()), _P(est._R()) {302 Kalman<sq_T>::Kalman ( ) : BM (), est ( ), fy (), _yp ( fy._mu() ), _Ry ( fy._R() ), _mu ( est._mu() ), _P ( est._R() ) { 282 303 }; 283 304 … … 287 308 dimy = C0.rows(); 288 309 dimu = B0.cols(); 289 310 290 311 it_assert_debug ( A0.cols() ==dimx, "Kalman: A is not square" ); 291 312 it_assert_debug ( B0.rows() ==dimx, "Kalman: B is not compatible" ); … … 307 328 it_assert_debug ( dt.length() == ( dimy+dimu ),"KalmanFull::bayes wrong size of dt" ); 308 329 309 sq_T iRy (dimy);330 sq_T iRy ( dimy ); 310 331 vec u = dt.get ( dimy,dimy+dimu-1 ); 311 332 vec y = dt.get ( 0,dimy-1 ); … … 328 349 sq_T pom ( ( int ) Pfull.rows() ); 329 350 iRy.mult_sym_t ( C*Pfull,pom ); 330 ( _P ) -= pom; // P = P -PC'iRy*CP;331 ( _yp ) = C* _mu +D*u; //y prediction332 ( _mu ) += _K* ( y- _yp);351 ( _P ) -= pom; // P = P -PC'iRy*CP; 352 ( _yp ) = C* _mu +D*u; //y prediction 353 ( _mu ) += _K* ( y- _yp ); 333 354 334 355 … … 340 361 341 362 }; 342 363 343 364 344 365 … … 369 390 it_assert_debug ( dt.length() == ( dimy+dimu ),"KalmanFull::bayes wrong size of dt" ); 370 391 371 sq_T iRy (dimy,dimy);392 sq_T iRy ( dimy,dimy ); 372 393 vec u = dt.get ( dimy,dimy+dimu-1 ); 373 394 vec y = dt.get ( 0,dimy-1 ); … … 393 414 sq_T pom ( ( int ) Pfull.rows() ); 394 415 iRy.mult_sym_t ( C*Pfull,pom ); 395 ( _P ) -= pom; // P = P -PC'iRy*CP;416 ( _P ) -= pom; // P = P -PC'iRy*CP; 396 417 _yp = phxu->eval ( _mu,u ); //y prediction 397 418 ( _mu ) += _K* ( y-_yp ); -
bdm/estim/libPF.cpp
r278 r283 1 1 #include "libPF.h" 2 2 3 namespace bdm {3 namespace bdm { 4 4 5 5 using std::endl; … … 13 13 for ( i=0;i<n;i++ ) { 14 14 //generate new samples from paramater evolution model; 15 _samples ( i ) = par->samplecond ( _samples ( i ) );16 lls (i )= par->_e()->evallog(_samples(i));15 _samples ( i ) = par->samplecond ( _samples ( i ) ); 16 lls ( i ) = par->_e()->evallog ( _samples ( i ) ); 17 17 lls ( i ) *= obs->evallogcond ( dt,_samples ( i ) ); 18 18 … … 30 30 _w ( i ) /=sum; //? 31 31 32 ind = est.resample( );32 ind = est.resample(resmethod); 33 33 34 34 } 35 35 36 void PF::set_est ( const epdf &epdf0 ) { 37 int i; 36 // void PF::set_est ( const epdf &epdf0 ) { 37 // int i; 38 // 39 // for ( i=0;i<n;i++ ) { 40 // _samples ( i ) = epdf0.sample(); 41 // } 42 // } 38 43 39 for ( i=0;i<n;i++ ) {40 _samples ( i ) = epdf0.sample();41 }42 }43 44 44 45 } -
bdm/estim/libPF.h
r281 r283 40 40 mpdf *obs; 41 41 42 //! which resampling method will be used 43 RESAMPLING_METHOD resmethod; 44 42 45 //! \name Options 43 46 //!@{ 44 47 45 //! Log resampling times46 bool opt_L_res;47 48 //! Log all samples 48 49 bool opt_L_smp; 50 //! Log all samples 51 bool opt_L_wei; 49 52 //!@} 50 53 … … 52 55 //! \name Constructors 53 56 //!@{ 54 PF ( ) :est(), _w ( est._w() ),_samples ( est._samples() ) {};55 PF ( mpdf *par0, mpdf *obs0, epdf *epdf0, int n0 ) :56 est ( ),_w ( est._w() ),_samples ( est._samples())57 { set_parameters ( par0,obs0,n0 ); set_statistics ( ones ( n0 ),epdf0 ); };58 void set_parameters ( mpdf *par0, mpdf *obs0, int n0 )59 { par = par0; obs=obs0; n=n0; est.set_n ( n );};60 void set_statistics ( const vec w0, epdf *epdf0 ) {est.set_ parameters ( w0,epdf0 );};57 PF ( ) :est(), _w ( est._w() ),_samples ( est._samples() ), opt_L_smp ( false ), opt_L_wei ( false ) {LIDs.set_size ( 5 );}; 58 /* PF ( mpdf *par0, mpdf *obs0, epdf *epdf0, int n0 ) : 59 est ( ),_w ( est._w() ),_samples ( est._samples() ),opt_L_smp(false), opt_L_wei(false) 60 { set_parameters ( par0,obs0,n0 ); set_statistics ( ones ( n0 ),epdf0 ); };*/ 61 void set_parameters ( mpdf *par0, mpdf *obs0, int n0, RESAMPLING_METHOD rm=SYSTEMATIC ) 62 { par = par0; obs=obs0; n=n0; resmethod= rm;}; 63 void set_statistics ( const vec w0, epdf *epdf0 ) {est.set_statistics ( w0,epdf0 );}; 61 64 //!@} 62 65 //! Set posterior density by sampling from epdf0 63 void set_est ( const epdf &epdf0 ); 64 void set_options(const string &opt){ 65 opt_L_res= ( s.find ( "logres" ) !=string::npos ); 66 opt_L_smp= ( s.find ( "logsmp" ) !=string::npos ); 66 // void set_est ( const epdf &epdf0 ); 67 void set_options ( const string &opt ) { 68 BM::set_options(opt); 69 opt_L_wei= ( opt.find ( "logweights" ) !=string::npos ); 70 opt_L_smp= ( opt.find ( "logsamples" ) !=string::npos ); 67 71 } 68 72 void bayes ( const vec &dt ); … … 78 82 79 83 template<class BM_T> 80 81 84 class MPF : public PF { 82 BM_T* Bms[10000];85 Array<BM_T*> BMs; 83 86 84 87 //! internal class for MPDF providing composition of eEmp with external components … … 94 97 Coms ( _w.length() ) { 95 98 }; 99 //! read statistics from MPF 100 void read_statistics ( Array<BM_T*> &A ) { 101 dim = E.dimension() +A ( 0 )->posterior().dimension(); 102 for ( int i=0; i<_w.length() ;i++ ) {Coms ( i ) = A ( i )->_e();} 103 } 104 //! needed in resampling 96 105 void set_elements ( int &i, double wi, const epdf* ep ) 97 106 {_w ( i ) =wi; Coms ( i ) =ep;}; 98 107 99 void set_n ( int n ) {E.set_n ( n ); Coms.set_length ( n );} 108 void set_parameters ( int n ) { 109 E.set_parameters ( n, false ); 110 Coms.set_length ( n ); 111 } 100 112 vec mean() const { 101 113 // ugly … … 114 126 return concat ( E.variance(),pom2-pow ( pom,2 ) ); 115 127 } 128 void qbounds ( vec &lb, vec &ub, double perc=0.95 ) const { 129 //bounds on particles 130 vec lbp; 131 vec ubp; 132 E.qbounds ( lbp,ubp ); 133 134 //bounds on Components 135 int dimC=Coms ( 0 )->dimension(); 136 int j; 137 // temporary 138 vec lbc(dimC); 139 vec ubc(dimC); 140 // minima and maxima 141 vec Lbc(dimC); 142 vec Ubc(dimC); 143 Lbc = std::numeric_limits<double>::infinity(); 144 Ubc = -std::numeric_limits<double>::infinity(); 145 146 for ( int i=0;i<_w.length();i++ ) { 147 // check Coms 148 Coms ( i )->qbounds ( lbc,ubc ); 149 for ( j=0;j<dimC; j++ ) { 150 if ( lbc ( j ) <Lbc ( j ) ) {Lbc ( j ) =lbc ( j );} 151 if ( ubc ( j ) >Ubc ( j ) ) {Ubc ( j ) =ubc ( j );} 152 } 153 } 154 lb=concat(lbp,Lbc); 155 ub=concat(ubp,Ubc); 156 } 116 157 117 158 vec sample() const {it_error ( "Not implemented" );return 0;} … … 125 166 //! Log means of BMs 126 167 bool opt_L_mea; 127 168 128 169 public: 129 170 //! Default constructor. 130 MPF ( mpdf *par0, mpdf *obs0, int n, const BM_T &BMcond0 ) : PF (), jest ( est ) { 131 PF::set_parameters ( par0,obs0,n ); 132 jest.set_n ( n ); 133 // 134 //TODO test if rv and BMcond.rv are compatible. 135 // rv.add ( rvlin ); 136 // 137 138 if ( n>10000 ) {it_error ( "increase 10000 here!" );} 139 140 for ( int i=0;i<n;i++ ) { 141 Bms[i] = new BM_T ( BMcond0 ); //copy constructor 142 const epdf& pom=Bms[i]->posterior(); 143 jest.set_elements ( i,1.0/n,&pom ); 144 } 171 MPF () : PF (), jest ( est ) {}; 172 void set_parameters ( mpdf *par0, mpdf *obs0, int n0, RESAMPLING_METHOD rm=SYSTEMATIC ) { 173 PF::set_parameters ( par0, obs0, n0, rm ); 174 jest.set_parameters ( n0 );//duplication of rm 175 BMs.set_length ( n0 ); 176 } 177 void set_statistics ( epdf *epdf0, const BM_T* BMcond0 ) { 178 179 PF::set_statistics ( ones ( n ) /n, epdf0 ); 180 // copy 181 for ( int i=0;i<n;i++ ) { BMs ( i ) = new BM_T ( *BMcond0 ); BMs ( i )->condition ( _samples ( i ) );} 182 183 jest.read_statistics ( BMs ); 184 //options 145 185 }; 146 147 ~MPF() {148 }149 186 150 187 void bayes ( const vec &dt ); 151 188 const epdf& posterior() const {return jest;} 152 189 const epdf* _e() const {return &jest;} //Fixme: is it useful? 153 //! Set postrior of \c rvc to samples from epdf0. Statistics of B ms are not re-computed! Use only for initialization!154 void set_est ( const epdf& epdf0 ) {155 PF::set_est ( epdf0 ); // sample params in condition156 // copy conditions to BMs157 158 for ( int i=0;i<n;i++ ) {Bms[i]->condition ( _samples ( i ) );}159 }160 void set_options (const string &opt){161 PF: set_options(opt);162 opt_L_mea = ( s.find ( "logmeans" ) !=string::npos );163 } 164 190 //! Set postrior of \c rvc to samples from epdf0. Statistics of BMs are not re-computed! Use only for initialization! 191 /* void set_est ( const epdf& epdf0 ) { 192 PF::set_est ( epdf0 ); // sample params in condition 193 // copy conditions to BMs 194 195 for ( int i=0;i<n;i++ ) {BMs(i)->condition ( _samples ( i ) );} 196 }*/ 197 void set_options ( const string &opt ) { 198 PF::set_options ( opt ); 199 opt_L_mea = ( opt.find ( "logmeans" ) !=string::npos ); 200 } 201 165 202 //!Access function 166 BM* _BM ( int i ) {return B ms[i];}203 BM* _BM ( int i ) {return BMs ( i );} 167 204 }; 168 205 … … 180 217 _samples ( i ) = par->samplecond ( _samples ( i ) ); 181 218 llsP ( i ) = par->_e()->evallog ( _samples ( i ) ); 182 B ms[i]->condition ( _samples ( i ) );183 B ms[i]->bayes ( dt );184 lls ( i ) = B ms[i]->_ll(); // lls above is also in proposal her must be lls(i) =, not +=!!219 BMs ( i )->condition ( _samples ( i ) ); 220 BMs ( i )->bayes ( dt ); 221 lls ( i ) = BMs ( i )->_ll(); // lls above is also in proposal her must be lls(i) =, not +=!! 185 222 if ( lls ( i ) >mlls ) mlls=lls ( i ); //find maximum likelihood (for numerical stability) 186 223 } … … 204 241 double eff = 1.0/ ( _w*_w ); 205 242 if ( eff < ( 0.3*n ) ) { 206 ind = est.resample ();243 ind = est.resample ( resmethod ); 207 244 // Resample Bms! 208 245 … … 215 252 // poor-man's solution: replicate constructor here 216 253 // copied from MPF::MPF 217 delete B ms[i];218 B ms[i] = new BM_T ( *Bms[ind ( i ) ]); //copy constructor219 const epdf& pom=B ms[i]->posterior();254 delete BMs ( i ); 255 BMs ( i ) = new BM_T ( *BMs ( ind ( i ) ) ); //copy constructor 256 const epdf& pom=BMs ( i )->posterior(); 220 257 jest.set_elements ( i,1.0/n,&pom ); 221 258 } -
bdm/estim/merger.cpp
r278 r283 33 33 it_assert_debug ( rv.equal ( g0->_rv() ),"Incompatible g0" ); 34 34 //Empirical density - samples 35 eSmp.set_ parameters ( ones ( Ns ), g0 );35 eSmp.set_statistics ( ones ( Ns ), g0 ); 36 36 Array<vec> &Smp = eSmp._samples(); //aux 37 37 vec &w = eSmp._w(); //aux -
bdm/estim/merger.h
r278 r283 71 71 } 72 72 //! Set internal parameters used in approximation 73 void set_parameters ( double beta0, int Ns0, int Nc0 ) {beta=beta0;Ns=Ns0;Nc=Nc0;eSmp.set_ n(Ns0,false);}73 void set_parameters ( double beta0, int Ns0, int Nc0 ) {beta=beta0;Ns=Ns0;Nc=Nc0;eSmp.set_parameters(Ns0,false);} 74 74 //!Initialize the proposal density. This function must be called before merge()! 75 75 void init() { ////////////// NOT FINISHED