- Timestamp:
- 06/08/10 17:12:52 (14 years ago)
- Location:
- library/bdm
- Files:
-
- 3 modified
Legend:
- Unmodified
- Added
- Removed
-
library/bdm/base/bdmbase.h
r1058 r1060 1235 1235 } 1236 1236 1237 /*! 1237 /*! Create object from the following structure 1238 1238 \code 1239 drv = bdm::RV::from_setting // decription of observed data1240 urv = bdm::RV::from_setting // decription of input data1241 log_level = "logdt,logut" //when set, both the simulated data and the inputs are stored to the logger1242 // By default both are on. It makes sense to switch them offfor MemDS where the data are already stored.1239 drv = RV({"names",...},[..sizes..]); % decription of observed data using bdm::RV::from_setting 1240 urv = RV({"names",...},[..sizes..]); % decription of input data using bdm::RV::from_setting 1241 log_level = 'logdt,logut'; % when set, both the simulated data and the inputs are stored to the logger 1242 % By default both are on. It makes sense to switch them off e.g. for MemDS where the data are already stored. 1243 1243 \endcode 1244 1244 */ -
library/bdm/base/datasources.h
r1059 r1060 66 66 \code 67 67 class = 'MemDS'; 68 Data = [...]; // Data matrix or data vector 69 --- optional --- 70 time = 0; // Index of the first column in the matrix Data 71 --- fields from bdm::DS::from_setting --- 68 Data = [...]; % Data matrix with records stored in columns 69 --- optional fields --- 70 time = 0; % Index of the first column in the matrix Data 71 --- inherited fields --- 72 bdm::DS::from_setting 72 73 \endcode 73 74 74 75 If the optional fields are not given, they will be filled as follows: 75 76 \code 76 drv.names =("");77 drv.sizes =( no_rows_Data );77 drv.names = { "" }; % empty name 78 drv.sizes = { no_rows_Data }; % full size of the record 78 79 time = 0; 79 80 \endcode 80 If \c rowid is given, \c drv will be named after indices in rowids.81 81 82 82 */ … … 95 95 string filename; 96 96 public: 97 /*! reads what DS::from_setting 98 \code 99 filename = 'data_file.ext'; // name of the file where the data sare stored 100 --- fields from bdm::DS --- 97 /*! Create object from the following structure 98 \code 99 filename = 'data_file.ext'; % name of the file where the data sare stored 100 --- inherited fields --- 101 bdm::DS::from_setting 101 102 \endcode 102 103 */ … … 125 126 }; 126 127 127 /*! 128 /*! Create object from the following structure 128 129 \code 129 130 class = 'ITppFileDS'; 130 131 filename = 'file_with_data.it'; 131 varname = 'Data1'; // Name of a variable in which are th data stored 132 varname = 'Data1'; // Name of a variable in which the data are stored 133 --- inherited fields --- 134 bdm::DS::from_setting 132 135 \endcode 133 136 */ … … 143 146 144 147 The constructor creates \c Data matrix from the records in a CSV file \c fname. The orientation can be of two types: 145 1.\c BY_COL which is default - the data are stored in columns; one column per time \f$t\f$, one row per data item.146 2.\c BY_ROW if the data are stored the classical CSV style. Then each column stores the values for data item, for ex. \f$[y_{t} y_{t-1} ...]\f$, one row for each discrete time instant.148 -# \c BY_COL which is default - the data are stored in columns; one column per time \f$t\f$, one row per data item. 149 -# \c BY_ROW if the data are stored the classical CSV style. Then each column stores the values for data item, for ex. \f$[y_{t} y_{t-1} ...]\f$, one row for each discrete time instant. 147 150 148 151 */ 149 152 class CsvFileDS: public FileDS { 150 153 public: 154 /*! Create object from the following structure 155 \code 156 class = 'CsvFileDS'; 157 filename = 'file.csv'; 158 orientation = 'BY_ROW' or 'BY_COL'; % data records are stored in rows of columns (default). 159 --- inherited fields --- 160 bdm::DS::from_setting 161 \endcode 162 */ 151 163 void from_setting ( const Setting & set ); 152 164 }; … … 187 199 virtual void write ( const vec &ut, const ivec &indices ) NOT_IMPLEMENTED_VOID; 188 200 189 /*! 190 \code 191 class = "EpdfDS";192 epdf = {class="epdf_offspring", ...}// uncondtitional density to sample from193 \endcode 194 201 /*! Create object from the following structure 202 \code 203 class = 'EpdfDS'; 204 epdf = configuration of bdm::epdf % unconditional density to sample from, bdm::epdf::from_setting 205 \endcode 206 Does not inherit from bdm::DS::from_setting, names of data are taken from epdf.rv. 195 207 */ 196 208 void from_setting ( const Setting &set ) { … … 253 265 254 266 255 /*! 256 \code 257 class = "PdfDS";258 pdf = bdm::pdf::from_setting; // pdf to simulate, any offspring of pdf267 /*! Create object from the following structure 268 \code 269 class = 'PdfDS'; 270 pdf = configuration of bdm::pdf; % any offspring of pdf, bdm::pdf::from_setting 259 271 --- optional --- 260 init_rv = bdm::RV::from_setting; // define what rv to initialize - typically delayed values! 261 init_values = [...]; // vector of initial values corresponding to init_rv 262 \endcode 263 272 init_rv = RV({'names',...},[sizes,...],[times,...]); % define what rv to initialize - typically delayed values, time=-1, etc.! 273 init_values = [...]; % vector of initial values corresponding to init_rv 274 \endcode 275 Class does not inherits from bdm::DS::from_setting, names of data are taken from pdf.rv and pdf.rvc. 276 264 277 If init_rv is not given, init_values are set to zero. 265 278 */ -
library/bdm/mex/mex_datasource.h
r1058 r1060 28 28 mxArrayDS () : DS() {}; 29 29 30 /*! \brief Create data source from mxArray30 /*! Create object from the following structure 31 31 32 32 \code 33 33 class = 'mxArrayDS'; 34 varname = 'data_matrix'; // name of a workspace variable 35 drv = {class='RV',...} // names of data in columns 34 varname = 'data_matrix'; % name of a Matlab workspace variable 35 -- inherited fields --- 36 bdm::DS::from_setting 37 drv = RV({'names',...},[sizes,...]); % names of data redords in columns 36 38 \endcode 37 39