Changeset 693 for library/bdm/base/datasources.h
- Timestamp:
- 11/02/09 17:27:29 (15 years ago)
- Files:
-
- 1 modified
Legend:
- Unmodified
- Added
- Removed
-
library/bdm/base/datasources.h
r676 r693 145 145 Still having only one density but allowing conditioning on either input or delayed values. 146 146 */ 147 class MpdfDS :public DS {147 class PdfDS :public DS { 148 148 protected: 149 149 //! internal pointer to epdf from which we samplecond 150 shared_ptr< mpdf> impdf;150 shared_ptr<pdf> ipdf; 151 151 //! internal storage of data sample 152 152 vec yt; … … 165 165 ut2rgr.filldown ( ut,rgr ); 166 166 yt2rgr.filldown ( yt,rgr ); 167 yt=i mpdf->samplecond ( rgr );167 yt=ipdf->samplecond ( rgr ); 168 168 ut2rgr.step(ut); //u is now history 169 169 } … … 177 177 /*! 178 178 \code 179 class = " MpdfDS";180 mpdf = {class="mpdf_offspring", ...}; // mpdf to simulate179 class = "PdfDS"; 180 pdf = {class="pdf_offspring", ...}; // pdf to simulate 181 181 --- optional --- 182 182 init_rv = {class="RV",names=...}; // define what rv to initialize - typically delayed values! … … 187 187 */ 188 188 void from_setting ( const Setting &set ) { 189 i mpdf=UI::build<mpdf> ( set,"mpdf",UI::compulsory );189 ipdf=UI::build<pdf> ( set,"pdf",UI::compulsory ); 190 190 191 Yrv = i mpdf->_rv();191 Yrv = ipdf->_rv(); 192 192 // get unique rvs form rvc 193 RV rgrv0=i mpdf->_rvc().remove_time();193 RV rgrv0=ipdf->_rvc().remove_time(); 194 194 // input is what in not in Yrv 195 195 Urv=rgrv0.subt(Yrv); 196 196 set_drv(Yrv, Urv); 197 197 // connect input and output to rvc 198 ut2rgr.set_connection(i mpdf->_rvc(), Urv);199 yt2rgr.set_connection(i mpdf->_rvc(), Yrv);198 ut2rgr.set_connection(ipdf->_rvc(), Urv); 199 yt2rgr.set_connection(ipdf->_rvc(), Yrv); 200 200 201 201 //set history - if given … … 212 212 } 213 213 214 yt = zeros ( i mpdf->dimension() );215 rgr = zeros ( i mpdf->dimensionc() );214 yt = zeros ( ipdf->dimension() ); 215 rgr = zeros ( ipdf->dimensionc() ); 216 216 ut = zeros(Urv._dsize()); 217 217 … … 225 225 ut2rgr.filldown ( ut,rgr ); 226 226 yt2rgr.filldown ( yt,rgr ); 227 yt=i mpdf->samplecond ( rgr );228 } 229 }; 230 UIREGISTER ( MpdfDS );227 yt=ipdf->samplecond ( rgr ); 228 } 229 }; 230 UIREGISTER ( PdfDS ); 231 231 232 232 /*! Pseudovirtual class for reading data from files … … 307 307 private: 308 308 //!conditional pdf of the state evolution \f$ f(x_t|x_{t-1}) \f$ 309 shared_ptr< mpdf> IM;309 shared_ptr<pdf> IM; 310 310 311 311 //!conditional pdf of the observations \f$ f(d_t|x_t) \f$ 312 shared_ptr< mpdf> OM;312 shared_ptr<pdf> OM; 313 313 314 314 protected: … … 331 331 } 332 332 //! convenience constructor 333 stateDS ( const shared_ptr< mpdf> &IM0, const shared_ptr<mpdf> &OM0, int usize ) : IM ( IM0 ), OM ( OM0 ),333 stateDS ( const shared_ptr<pdf> &IM0, const shared_ptr<pdf> &OM0, int usize ) : IM ( IM0 ), OM ( OM0 ), 334 334 dt ( OM0->dimension() ), xt ( IM0->dimension() ), 335 335 ut ( usize ), L_xt ( 0 ) { } … … 360 360 type = "stateDS"; 361 361 //Internal model 362 IM = { type = " mpdf"; //<-- valid offspring! e.g. "mlnorm"362 IM = { type = "pdf"; //<-- valid offspring! e.g. "mlnorm" 363 363 rv = { //description of x_t 364 364 names=["name1",...]; … … 373 373 }; 374 374 //Observation model 375 OM = { type = " mpdf-offspring";375 OM = { type = "pdf-offspring"; 376 376 rv = {}; //description of d_t 377 377 rvu = {type="internal", path="system.IM.rvu"}; //description of u_t