00001 #ifndef _BAYES_FILTER_UD
00002 #define _BAYES_FILTER_UD
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020
00021
00022
00023
00024
00025
00026
00027 #include "bayesFlt.hpp"
00028
00029
00030 namespace Bayesian_filter
00031 {
00032
00033 class UD_sequential_observe_model : public Linrz_uncorrelated_observe_model
00034 {
00035 public:
00036 UD_sequential_observe_model (std::size_t x_size, std::size_t z_size) :
00037 Linrz_uncorrelated_observe_model(x_size, z_size), Hx_o(x_size)
00038 {}
00039 virtual const FM::Vec& ho (const FM::Vec& x, const std::size_t o) = 0;
00040
00041
00042
00043
00044
00045
00046
00047 FM::Vec Hx_o;
00048 };
00049
00050
00051 class UD_scheme : public Linrz_kalman_filter
00052 {
00053 private:
00054 std::size_t q_max;
00055 public:
00056 FM::Matrix UD;
00057
00058 FM::Vec s;
00059 FM::Vec Sd;
00060
00061 UD_scheme (std::size_t x_size, std::size_t q_maxsize, std::size_t z_initialsize = 0);
00062 UD_scheme& operator= (const UD_scheme&);
00063
00064
00065 void init ();
00066 void update ();
00067 Float predict (Linrz_predict_model& f);
00068
00069 Float observe (Linrz_correlated_observe_model& h, const FM::Vec& z);
00070
00071 Float observe (Linrz_uncorrelated_observe_model& h, const FM::Vec& z);
00072
00073
00074 Float observe (Linear_correlated_observe_model& h, const FM::Vec& z);
00075
00076 Float observe (UD_sequential_observe_model& h, const FM::Vec& z);
00077
00078
00079 protected:
00080 Float predictGq (const FM::Matrix& Fx, const FM::Matrix& G, const FM::Vec& q);
00081 FM::Vec d, dv, v;
00082 Float observeUD (FM::Vec& gain, Float& alpha, const FM::Vec& h, const Float r);
00083 FM::Vec a, b;
00084
00085 void observe_size (std::size_t z_size);
00086 std::size_t last_z_size;
00087 FM::Vec h1;
00088 FM::Vec w;
00089 FM::Vec znorm;
00090 FM::Vec zpdecol;
00091 FM::Matrix Gz;
00092 FM::Matrix GIHx;
00093 };
00094
00095
00096 }
00097 #endif