root/library/bdm/estim/ekf_template.h @ 744

Revision 744, 1.6 kB (checked in by smidl, 15 years ago)

Working unitsteps and controlloop + corresponding fixes

  • Property svn:eol-style set to native
Line 
1/*!
2  \file
3  \brief Bayesian Filtering for linear Gaussian models (Kalman Filter) and extensions
4  \author Vaclav Smidl.
5
6  -----------------------------------
7  BDM++ - C++ library for Bayesian Decision Making under Uncertainty
8
9  Using IT++ for numerical operations
10  -----------------------------------
11*/
12
13#ifndef EKF_TEMPLATE_H
14#define EKF_TEMPLATE_H
15
16#include "kalman.h"
17
18namespace bdm {
19
20//!Extended Kalman filter with unknown \c Q and \c R
21class EKFful_unQR : public EKFfull  {
22public:
23        void condition ( const vec &QR0 ) {
24                Q = diag ( QR0 ( 0, dimension() - 1 ) );
25                R = diag ( QR0 ( dimension(), dimension() + dimy - 1 ) );
26        };
27};
28
29//!Extended Kalman filter in Choleski form with unknown diagonal \c Q
30class EKFCh_dQ : public EKFCh {
31public:
32        BM* _copy_() const {return new EKFCh_dQ(*this);}
33        //! new bayes, expects cond = [ut, Qt]
34        void bayes( const vec &yt , const vec &cond) {
35                vec ut=cond.left(dimc-dimension());
36                vec dQt=cond.right(dimension());
37                Q.setD ( dQt, 0 );
38                //from EKF
39                preA.set_submatrix ( dimy + dimension(), dimy, Q._Ch() );
40               
41                EKFCh::bayes(yt,ut);
42        };
43        void validate() {
44                EKFCh::validate();
45                dimc += dimension();
46        }
47};
48
49//!Extended Kalman filter in Choleski form with unknown \c Q
50class EKFCh_chQ : public EKFCh {
51public:
52        void condition ( const vec &chQ0 ) {
53                Q.setCh ( chQ0 );
54                //from EKF
55                preA.set_submatrix ( dimy + dimension(), dimension(), Q._Ch() );
56        };
57};
58
59//!Extended Kalman filter with unknown parameters in \c IM
60class EKFCh_cond : public EKFCh  {
61public:
62        void condition ( const vec &val ) {
63                pfxu->condition ( val );
64        };
65};
66
67}
68#endif //EKF_TEMP_H
Note: See TracBrowser for help on using the browser.