Changeset 630 for library/doc/tutorial/01userguide.dox
- Timestamp:
- 09/18/09 00:17:14 (15 years ago)
- Files:
-
- 1 modified
Legend:
- Unmodified
- Added
- Removed
-
library/doc/tutorial/01userguide.dox
r617 r630 2 2 \page user_guide Howto Use BDM - System, Data, Simulation 3 3 4 This section serves as introdustion to the scenario of data simulation. Since it is the simpliest of all scenarios defined in \ref user_guide0 it also serves as introduction to configuration of an experiment (see \ref ui ) and basic decision making objects (bdm::RV and bdm::DS).4 This section serves as introdustion to the scenario of data simulation. Since it is the simpliest of all scenarios defined in \ref user_guide0 it also serves as introduction to configuration of an experiment (see \ref ui_page) and basic decision making objects (bdm::RV and bdm::DS). 5 5 6 6 All experiments are demonstarted on scenario simulator which can be either standalone application of mex file (simulator.mex**). 7 7 8 8 9 \section config Configuration of an experiment9 \section ug_config Configuration of an experiment 10 10 11 11 Configuration file (or config structure) is organized as a tree of information. High levels represent complex structures, leafs of the tree are basic data elements such as strings, numbers or vectors. … … 14 14 15 15 The configuration has two possible options: 16 - configuration file using syntax of libconfig (see \ref ui ),16 - configuration file using syntax of libconfig (see \ref ui_page), 17 17 - matlab structure. 18 18 For the purpose of tutorial, we will use the matlab notation. 19 These two options can be mutually converted from one to another using prepared mex files: config2mxstruct.mex and mxstruct2config.mex. Naturally, these scripts require matlab to run. If it is not available, manual conversion is relatively trivial, the major difference is in using different types of brackets (\ref ui )20 21 \subsection first First experiment19 These two options can be mutually converted from one to another using prepared mex files: config2mxstruct.mex and mxstruct2config.mex. Naturally, these scripts require matlab to run. If it is not available, manual conversion is relatively trivial, the major difference is in using different types of brackets (\ref ui_page) 20 21 \subsection ug_first First experiment 22 22 23 23 The first experiment that can be performed is: … … 43 43 \endcode 44 44 45 If you see this result, you have configured BDM correctly and you have sucessfully run you first experiment. In other cases, please check your installation, \ref install ation.45 If you see this result, you have configured BDM correctly and you have sucessfully run you first experiment. In other cases, please check your installation, \ref install. 46 46 All that the simulator did was actually copying \c DS.Data to \c M.ch0. Explanation of the experiment and the logic used there follows. 47 47 48 \section sim Systems and DataSources48 \section ug_sim Systems and DataSources 49 49 50 50 In standard system theory, the system is typically illustrated graphically as: … … 73 73 74 74 75 \section memds DataSource of pre-recorded data -- MemDS75 \section ug_memds DataSource of pre-recorded data -- MemDS 76 76 77 77 The first experiment run in \ref first was actually an instance of DataSource of pre-recorded data that were stored in memory, i.e. the bdm::MemDS class. … … 104 104 Where the first line specifies a universal identification structure: random variable (bdm::RV). 105 105 106 \section rvs What is RV and how to use it106 \section ug_rvs What is RV and how to use it 107 107 108 108 RV stands for \c random \c variable which is a description of random variable or its realization. This object playes role of identifier of elements of vectors of data (in datasources), expected inputs to functions (in pdfs), or required results (operations conditioning). … … 125 125 Since all experiments are performed in matlab, the default mexlog class will be used. However, the way how the results are to be stored can be configured using configuration structure filled by fields from \c from_setting of the chosen logger, and passing it as third argument to \c simulator. 126 126 127 \section datasource Class inheritance and DataSources127 \section ug_datasource Class inheritance and DataSources 128 128 129 129 As mentioned above, the scenario \c simulator is written to accept any datasource (i.e. any offspring of bdm::DS). For full list of offsprings, click see Classes > Class Hierarchy. … … 175 175 If the task was only to generate random realizations, this would indeed be a very clumsy way of doing it. However, the power of the proposed approach will be revelead in more demanding examples, one of which follows next. 176 176 177 \section arxSimulating autoregressive model177 \section ug_arx_sim Simulating autoregressive model 178 178 179 179 Consider the following autoregressive model: … … 232 232 The code above can be immediatelly run, usin the same execution sequence of \c estimator as above. 233 233 234 \subsection ini Initializing simulation234 \subsection ug_ini Initializing simulation 235 235 236 236 When zeros are not appropriate initial conditions, the correct conditions can be set using additional commands (see bdm::MpdfDS.from_setting() ): … … 244 244 245 245 246 \section ug_store Storing results of simulation 247 248 If the simulated data are to be analyzed off-line it may be advantageous to store them and use for later use. 249 This operation is straightforward if the class of logger used in the \c simulator is compatible with some datasource class. 250 251 For example, the output of \c MemDS can be stored as an .it file (filename is specified in configuration structure) which can be later read by bdm::ITppFileDS. 252 253 In matlab, the output of mexlog is a structure of vectors or matrices. The results can be saved in a matlab file using: 254 \code 255 Data=[M.y; M.u]; 256 drv = RVjoin({y,u}); 257 save mpdfds_results Data drv 258 \endcode 259 Such data can be later provided e.g. by MemDS 260 \code 261 mxDS.class = 'MemDS'; 262 mxDS.Data = 'Data'; 263 mxDS.drv = drv; 264 \endcode 265 246 266 */