Show
Ignore:
Timestamp:
05/31/10 15:55:10 (14 years ago)
Author:
dedecius
Message:

Class implementing partial forgetting in ARX in a way similar to ARXfrg. The ARXpartforg::bayes() method (sh|c)ould be divided into smaller functions in the future(?)

Files:
1 modified

Legend:

Unmodified
Added
Removed
  • library/bdm/estim/arx.h

    r1013 r1025  
    229229 
    230230 
     231/*! 
     232* \brief ARX with partial forgetting 
     233 
     234Implements partial forgetting when <tt>bayes(const vec &yt, const vec &cond=empty_vec)</tt> is called, where \c cond is a vector <em>(regressor', forg.factor')</em>. 
     235 
     236Note, that the weights have the same order as hypotheses, following this scheme: 
     237\li 0 means that the parameter doesn't change, 
     238\li 1 means that the parameter varies. 
     239 
     240The combinations of parameters are described binary: 
     241\f[ 
     242  0, 0, 0\ldots \\ 
     243  1, 0, 0\ldots \\ 
     244  0, 1, 0\ldots \\ 
     245  1, 1, 0\ldots \\ 
     246  \ldots 
     247\f] 
     248where each n-th column has altering 1's and 0's in n-tuples, n = 0,...,number of params. Hence, the first forg. factor relates to the situation when no parameter changes, the second one when the first parameter changes etc. 
     249 
     250See ARX class for more information about ARX. 
     251*/ 
     252class ARXpartialforg : public ARX { 
     253public: 
     254        ARXpartialforg() : ARX(1.0) {}; 
     255        //! copy constructor 
     256        ARXpartialforg ( const ARXpartialforg &A0 ) : ARX ( A0 ) {}; 
     257        virtual ARXpartialforg* _copy() const { 
     258                ARXpartialforg *A = new ARXpartialforg ( *this ); 
     259                return A; 
     260        } 
     261 
     262    void bayes ( const vec &val, const vec &cond );  
     263        void validate() { 
     264                ARX::validate(); 
     265                int philen = pow(2, est._V().cols() - 1); 
     266                rvc.add ( RV ( "{phi }", vec_1(philen) ) ); // pocet 2^parametru 
     267                dimc += philen; 
     268        } 
     269}; 
     270UIREGISTER ( ARXpartialforg ); 
     271 
    231272 
    232273////////////////////