Changeset 661 for library/doc/tutorial

Show
Ignore:
Timestamp:
10/15/09 00:10:19 (15 years ago)
Author:
smidl
Message:

doc

Location:
library/doc/tutorial
Files:
4 modified

Legend:

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

    r659 r661  
    22\page userguide BDM Use - 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 005userguide0 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 or mex file (simulator.mex**). 
     
    7575\section ug_memds DataSource of pre-recorded data -- MemDS 
    7676 
    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. 
     77The first experiment run in \ref ug_first was actually an instance of DataSource of pre-recorded data that were stored in memory, i.e. the bdm::MemDS class. 
    7878 
    7979Operation of such object is trivial, the data are stored as a matrix and the general operations defined above are specialized as follows: 
     
    140140 
    141141 
    142 \section loggers Loggers for flexible handling of results 
     142\section ug_loggers Loggers for flexible handling of results 
    143143Loggers are universal objects for storing and manipulating the results of an experiment. Similar to DataSource, every logger has to provide basic functionality: 
    144144 -# initialize its storage (bdm::logger.init()), 
     
    165165 - bdm::stateDS 
    166166 
    167 The MemDS has already been introduced in the example in \ref memds. 
     167The MemDS has already been introduced in the example in \ref ug_memds. 
    168168However, any of the classes listed above can be used to replace it in the example. 
    169169This will be demonstrated on the \c EpdfDS class. 
     
    230230u = RV({'u'}); 
    231231 
    232 fy.class = 'mlnorm<ldmat>'; 
     232fy.class = 'mlnorm\<ldmat\>'; 
    233233fy.rv    = y; 
    234234fy.rvc   = RV({'y','u'}, [1 1], [-3, -1]); 
     
    238238 
    239239 
    240 fu.class = 'enorm<ldmat>'; 
     240fu.class = 'enorm\<ldmat\>'; 
    241241fu.rv    = u; 
    242242fu.mu    = 0; 
     
    249249 
    250250Explanation of this example will require few remarks: 
    251  - class of the \c fy object is 'mlnorm<ldmat>' which is Normal pdf with mean value given by linear function, and covariance matrix stored in LD decomposition, see bdm::mlnorm for details. 
    252  - naming convention 'mlnorm<ldmat>' relates to the concept of templates in C++. For those unfamiliar with this concept, it is basicaly a way how to share code for different flavours of the same object. Note that mlnorm exist in three versions: mlnorm<ldmat>, mlnorm<chmat>, mlnorm<fsqmat>. Those classes act identically the only difference is that the internal data are stored either in LD decomposition, choleski decomposition or full matrices, respectively.  
     251 - class of the \c fy object is 'mlnorm\<ldmat\>' which is Normal pdf with mean value given by linear function, and covariance matrix stored in LD decomposition, see bdm::mlnorm for details. 
     252 - naming convention 'mlnorm\<ldmat\>' relates to the concept of templates in C++. For those unfamiliar with this concept, it is basicaly a way how to share code for different flavours of the same object. Note that mlnorm exist in three versions: mlnorm\<ldmat\>, mlnorm<chmat>, mlnorm<fsqmat>. Those classes act identically the only difference is that the internal data are stored either in LD decomposition, choleski decomposition or full matrices, respectively.  
    253253 - the same concept is used for enorm, where enorm<chmat> and enorm<fsqmat> are also possible. In this particular use, these objects are equivalent. In specific situation, e.g. Kalman filter implemented on Choleski decomposition (bdm::KalmanCh), only enorm<chmat> is approprate. 
    254254 - class 'mprod' represents the chain rule of probability. Attribute \c mpdfs of its configuration structure is a list of conditional densities. Conditional density \f$ f(a|b)\f$ is represented by class \c mpdf and its offsprings. Class \c RV is used to describe both variables before conditioning (field \c rv ) and after conditioning sign (field \c rvc). 
  • library/doc/tutorial/arx_ui.dox

    r659 r661  
    22\page arx_ui Running experiment \c estimator with ARX data fields  
    33 
    4 The experiment \ref estimator.cpp can be run either on command line, or as a mex file in Matlab. 
     4The experiment \c estimator.cpp can be run either on command line, or as a mex file in Matlab. 
    55 
    66\section cmd Command Line 
     
    1111The structure is interpreted by application \c estimator, which looks for fields: 
    1212<dl> 
    13 <dt>system</dt><dd> description of a Data Source generating Data. The structure must by UI with \c type="DS_offspring". In our example, it is of type "ArxDS" which is parsed by bdm::UIArxDS UIbuilder generating a Data Source simulating ARX process.</dd> 
    14 <dt>estimator</dt> <dd> description of a Baysian model used to estimate parameters of the data model. In this case, it is of type "ARXest" which is parsed by bdm::UIARX UIbuilder generating Bayesian estimator of autoregressive processess.</dd> 
    15 <dt>logger</dt><dd> description of a way how to store results. UI is of \c type="logger_offspring". In this case, it is of class "dirfilelog" which is parsed by bdm::UIdirfilelog which generates object storing data in directory specified by dirname="" field in fileformat understood by program kst.</dd> 
     13<dt>system</dt><dd> description of a Data Source generating Data. The structure must by UI with \c class="DS_offspring". In our example, it is of class "ArxDS" which is parsed by bdm::UIArxDS UIbuilder generating a Data Source simulating ARX process.</dd> 
     14<dt>estimator</dt> <dd> description of a Baysian model used to estimate parameters of the data model. In this case, it is of class "ARXest" which is parsed by bdm::UIARX UIbuilder generating Bayesian estimator of autoregressive processess.</dd> 
     15<dt>logger</dt><dd> description of a way how to store results. UI is of \c class="logger_offspring". In this case, it is of class "dirfilelog" which is parsed by bdm::UIdirfilelog which generates object storing data in directory specified by dirname="" field in fileformat understood by program kst.</dd> 
    1616</dl> 
    1717When the application estimator is run with the above code, it produces a directory of data files, which can be displayed by program kst. Expected results are: 
     
    2020 
    2121\section mex Matlab mex file 
    22 The matlab mex file can be run with exactly the same configuration as above. However, when we wish to see the results in Matlab, we may wish to change the logger object to \c type="mexlog" which will store the results in a matlab structure. 
     22The matlab mex file can be run with exactly the same configuration as above. However, when we wish to see the results in Matlab, we may wish to change the logger object to \c class="mexlog" which will store the results in a matlab structure. 
    2323 
    2424The exact configuration file may look as follows: 
  • library/doc/tutorial/kalman.dox

    r272 r661  
    3838\section exa Examples of Use 
    3939 
    40 The classes can be used directly in C++ or via User Info. The latter example is illustrated in file \subpage estimator. A very short example of the former follows: 
     40The classes can be used directly in C++ or via User Info. The latter example is illustrated in file \subpage user_guide2. A very short example of the former follows: 
    4141 
    4242\include kalman_simple.cpp 
  • library/doc/tutorial/ui.dox

    r659 r661  
    9393default values can follow immediately. Imagine, for example, that the first attribute \c ndat is optional. Thereore, the default value is filled in the case that there is not any other in the configuration file (and so #bdm::UI::get method returs \c false). The second atribute, \c prior, is intended to be compulsory. This fact is specified by the last parameter of the templated #bdm::UI::build method. In this case, the method throws an exception if there is not proper data in the configuration file.  
    9494 
    95 The only difference between #bdm::UI::build and #bdm::UI::get method is in the types of variables they are prepared to. The #bdm::UI::build<T> method is used to initialize instances of classes derived from #bdm::root. It allocates them dynamically and return just an pointer to the new instance. This way it is possible even to load instances of inherited classes without aneven knowing about it. Oppositely, all scalar values of types int, double, string, vec, ivec or mat are loaded by the #bdm::UI::get method with a static memory management. It is also capable to load arrays of templated type #itpp::Array<T>.  
     95The only difference between #bdm::UI::build and #bdm::UI::get method is in the types of variables they are prepared to. The #bdm::UI::build<T> method is used to initialize instances of classes derived from #bdm::root. It allocates them dynamically and return just an pointer to the new instance. This way it is possible even to load instances of inherited classes without aneven knowing about it. Oppositely, all scalar values of types int, double, string, vec, ivec or mat are loaded by the #bdm::UI::get method with a static memory management. It is also capable to load arrays of templated type \c itpp::Array<T>.  
    9696 
    9797Saving is much more easier. For all the variable types, use the #bdm::UI::save method.