| 231 | /*! |
| 232 | * \brief ARX with partial forgetting |
| 233 | |
| 234 | Implements 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 | |
| 236 | Note, 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 | |
| 240 | The 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] |
| 248 | where 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 | |
| 250 | See ARX class for more information about ARX. |
| 251 | */ |
| 252 | class ARXpartialforg : public ARX { |
| 253 | public: |
| 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 | }; |
| 270 | UIREGISTER ( ARXpartialforg ); |
| 271 | |