Show
Ignore:
Timestamp:
09/18/09 00:17:14 (15 years ago)
Author:
smidl
Message:

Tutorial update + new .m files

Files:
1 modified

Legend:

Unmodified
Added
Removed
  • library/doc/tutorial/01userguide.dox

    r617 r630  
    22\page user_guide Howto Use BDM - System, Data, Simulation 
    33 
    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). 
     4This 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). 
    55 
    66All experiments are demonstarted on scenario simulator which can be either standalone application of mex file (simulator.mex**). 
    77 
    88 
    9 \section config Configuration of an experiment 
     9\section ug_config Configuration of an experiment 
    1010 
    1111Configuration 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. 
     
    1414 
    1515The 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), 
    1717 - matlab structure. 
    1818For 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 experiment 
     19These 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 
    2222 
    2323The first experiment that can be performed is: 
     
    4343\endcode 
    4444 
    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 installation.  
     45If 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.  
    4646All that the simulator did was actually copying \c DS.Data to \c M.ch0. Explanation of the experiment and the logic used there follows. 
    4747 
    48 \section sim Systems and DataSources 
     48\section ug_sim Systems and DataSources 
    4949 
    5050In standard system theory, the system is typically illustrated graphically as: 
     
    7373 
    7474 
    75 \section memds DataSource of pre-recorded data -- MemDS 
     75\section ug_memds DataSource of pre-recorded data -- MemDS 
    7676 
    7777The 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. 
     
    104104Where the first line specifies a universal identification structure: random variable (bdm::RV). 
    105105 
    106 \section rvs What is RV and how to use it 
     106\section ug_rvs What is RV and how to use it 
    107107 
    108108RV 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).  
     
    125125Since 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. 
    126126 
    127 \section datasource Class inheritance and DataSources 
     127\section ug_datasource Class inheritance and DataSources 
    128128 
    129129As 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. 
     
    175175If 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. 
    176176 
    177 \section arx Simulating autoregressive model 
     177\section ug_arx_sim Simulating autoregressive model 
    178178 
    179179Consider the following autoregressive model:  
     
    232232The code above can be immediatelly run, usin the same execution sequence of \c estimator as above.  
    233233 
    234 \subsection ini Initializing simulation 
     234\subsection ug_ini Initializing simulation 
    235235 
    236236When zeros are not appropriate initial conditions, the correct conditions can be set using additional commands (see bdm::MpdfDS.from_setting() ): 
     
    244244 
    245245 
     246\section ug_store Storing results of simulation 
     247 
     248If the simulated data are to be analyzed off-line it may be advantageous to store them and use for later use.  
     249This operation is straightforward if the class of logger used in the \c simulator is compatible with some datasource class. 
     250 
     251For 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 
     253In matlab, the output of mexlog is a structure of vectors or matrices. The results can be saved in a matlab file using: 
     254\code 
     255Data=[M.y; M.u]; 
     256drv = RVjoin({y,u}); 
     257save mpdfds_results Data drv 
     258\endcode 
     259Such data can be later provided e.g. by MemDS 
     260\code 
     261mxDS.class   = 'MemDS'; 
     262mxDS.Data    = 'Data'; 
     263mxDS.drv     = drv; 
     264\endcode 
     265 
    246266*/