Changeset 611 for library/bdm/base/datasources.h
- Timestamp:
- 09/13/09 23:14:26 (15 years ago)
- Files:
-
- 1 modified
Legend:
- Unmodified
- Added
- Removed
-
library/bdm/base/datasources.h
r609 r611 23 23 * \brief Memory storage of off-line data column-wise 24 24 25 The data are stored in an internal matrix \c Data . Each column of Data corresponds to one discrete time observation \f$t\f$. Access to this matrix is via indices \c rowid and \c delays.25 The data are stored in an internal matrix \c Data . Each column of Data corresponds to one discrete time observation \f$t\f$. Access to this matrix is via indices \c rowid. 26 26 27 27 The data can be loaded from a file. … … 56 56 /*! Create object from the following structure 57 57 \code 58 { class = 'MemDS';58 { class = "MemDS"; 59 59 Data = (...); // Data matrix or data vector 60 60 --- optional --- 61 drv = {class= 'RV'; ...} // Identification how rows of the matrix Data will be known to others61 drv = {class="RV"; ...} // Identification how rows of the matrix Data will be known to others 62 62 time = 0; // Index of the first column to user_info, 63 63 rowid = [1,2,3...]; // ids of rows to be used … … 68 68 \code 69 69 rowid= [0, 1, 2, ...number_of_rows_of_Data]; 70 drv = {names=(" 0", "1", "2", ..."number_of_rows_of_Data");70 drv = {names=("ch0", "ch1", "ch2", ..."number_of_rows_of_Data"); 71 71 sizes=( 1 1 1 ...); 72 72 times=( 0 0 0 ...); … … 93 93 UIREGISTER(MemDS); 94 94 95 /*! \brief Simulate data from a static pdf 95 /*! \brief Simulate data from a static pdf (epdf) 96 96 97 Trivial example of a data source, could be used for tests of some estimation algorithms. For example, simulating data from a mixture model and feeding them to mixture model estimators. 97 98 */ … … 119 120 /*! 120 121 \code 121 class = " PdfDS";122 epdf = {class="epdf_offspring", ...}// list of points122 class = "EpdfDS"; 123 epdf = {class="epdf_offspring", ...}// uncondtitional density to sample from 123 124 \endcode 124 125 … … 126 127 void from_setting ( const Setting &set ) { 127 128 iepdf=UI::build<epdf> ( set,"epdf",UI::compulsory ); 128 dt = zeros ( iepdf->dimension() ); 129 bdm_assert(iepdf->isnamed(), "Input epdf must be named, check if RV is given correctly"); 130 dt = iepdf->sample(); 131 dtsize=dt.length(); 132 set_drv(iepdf->_rv(),RV()); 133 utsize =0; 129 134 } 130 135 };