Changeset 642

Show
Ignore:
Timestamp:
09/27/09 00:58:45 (15 years ago)
Author:
smidl
Message:

tutorial for MPF

Files:
1 modified

Legend:

Unmodified
Added
Removed
  • library/doc/tutorial/02userguide2.dox

    r632 r642  
    102102First, in order to distinguish the estimators from each other, the estimators were given names. Hence, the results will be logged with prefix given by the name, such as M.A1ll for field \c ll. 
    103103 
    104 Second, if the parameters of a ARX model are not specified, they are automatically named \c theta and \c r. Howver, in this case, \c A1 and \c A2 differ in size, hence their random variables differ and can not use the same name. Therefore, we have explicitly used another names (RVs) of the parameters. 
     104Second, if the parameters of a ARX model are not specified, they are automatically named \c theta and \c r. However, in this case, \c A1 and \c A2 differ in size, hence their random variables differ and can not use the same name. Therefore, we have explicitly used another names (RVs) of the parameters. 
    105105 
    106106\section ug2_bm_composition Composition of estimators 
     
    112112each of these parts is estimated using different approach. The first part is assumed to be analytically tractable, while the second is approximated using empirical approximation. 
    113113 
    114 The whole algorithm runs by parallel evaluation of many \c BMs for estimation of \f$ x_{1,t}\f$, each of them conditioned on value of a sample of \f$x_{2,t}\f$. 
     114The whole algorithm runs by parallel evaluation of many \c BMs for estimation of \f$ x_{1,t}\f$, each of them conditioned on value of a sample of \f$ x_{2,t}\f$. 
    115115 
    116116For example, the forgetting factor, \f$ \phi \f$ of an ARX model can be considered to be unknown. Then, the whole parameter space is \f$ [\theta_t, r_t, \phi_t]\f$ decomposed as follows: 
     
    119119This is achieved by a trivial extension using inheritance method bdm::BM::condition(). 
    120120 
     121Extension of standard ARX estimator to conditional estimator is implemented as class bdm::ARXfrg. The only difference from standard ARX is that this object will change its forgetting factor via method ARXfrg::condition(). Existence of this function is assumed by the MPF estimator. 
     122Informally, the name 'ARXfrg' means: "if anybody calls your condition(0.9), it tells you new value of forgetting factor". 
    121123 
     124The MPF estimator is implemented by class bdm::MPF. In the toolbox, it can be constructed as follows: 
     125\code 
     126%%%%%% ARX estimator conditioned on frg 
     127 
     128A1.class = 'ARXfrg'; 
     129A1.rv = y; 
     130A1.rgr = RVtimes([y,u],[-3,-1]) ;  
     131A1.options ='logbounds,logll'; 
     132A1.frg = 0.9; 
     133A1.name = 'A1'; 
     134 
     135%%%%%% Random walk on frg - Dirichlet  
     136phi_pdf.class = 'mDirich';         % random walk on coefficient phi 
     137phi_pdf.rv    = RV('phi',2);       % 2D random walk - frg is the first element 
     138phi_pdf.k     = 0.01;              % width of the random walk 
     139phi_pdf.betac = [0.01 0.01];       % stabilizing elememnt of random walk 
     140 
     141%%%%%% Combining estimators in Marginalized particle filter 
     142E.class = 'MPF'; 
     143E.BM = A1;                         % ARX is the analytical part 
     144E.parameter_pdf = phi_pdf;         % Random walk is the parameter evolution model 
     145E.n = 20;                          % number of particles 
     146E.prior.class = 'eDirich';         % prior on non-linear part 
     147E.prior.beta  = [1 1]; %  
     148E.options ='logbounds,logll'; 
     149E.name = 'MPF'; 
     150 
     151M=estimator(DS,{E}); 
     152 
     153\endcode 
     154  
     155Here, the configuration structure \c A1 is a description of an ARX model, as used in previous examples, the only difference is in its name 'ARXfrg'.  
     156 
     157The configuration structure \c phi_pdf defines random walk on the forgetting factor. It was chosen as Dirichlet, hence it will produce 2-dimensional vector of \f$[\phi, 1-\phi]\f$. The class \c ARXfrg was designed to read only the first element of its condition. 
     158The random walk of type mDirich is: 
     159\f[ f(\phi_t|\phi_{t-1}) = Di (\phi_{t-1}/k + \beta_c) \f] 
     160where \f$ k \f$ influences the spread of the walk and \f$ \beta_c \f$ has the role of stabilizing, to avoid traps of corner cases such as [0,1] and [1,0]. 
     161Its influence on the results is quite important. 
     162 
     163This example is implemented as bdmtoolbox/tutorial/userguide/frg_example.m 
     164Its typical run should look like the following: 
     165\image html frg_example_small.png  
     166\image latex frg_example.png "Typical run of tutorial/userguide/frg_example.m" width=\linewidth 
     167 
     168Note: error bars in this case are not directly comparable with those of previous examples. The MPF class implements the qbounds function as minimum and maximum of bounds in the condidered set (even if its weight is extreemly small). Hence, the bounds of the MPF are probably larger than it should be. Nevertheless, they provide great help when designing and tuning algorithms. 
    122169 
    123170*/