00001 #ifndef _BAYES_FILTER_INFORMATION_ROOT 00002 #define _BAYES_FILTER_INFORMATION_ROOT 00003 00004 /* 00005 * Bayes++ the Bayesian Filtering Library 00006 * Copyright (c) 2002 Michael Stevens 00007 * See accompanying Bayes++.htm for terms and conditions of use. 00008 * 00009 * $Id: infRtFlt.hpp 562 2006-04-05 20:46:23 +0200 (Wed, 05 Apr 2006) mistevens $ 00010 */ 00011 00012 /* 00013 * Information Root Filter Scheme. 00014 * A extended 'Square-root' Information filter as an Abstract class 00015 * 00016 * Algorithm: Square-root information propogation using QR factorisation 00017 * Ref: P. Dyer and S. McReynolds, "Extension of Square-Root Filtering to Include Process Noise", 00018 * [1] Journal of Optimization Theory and Applications, Vol.3 No.6 1969 00019 * Filter maintains r,R where 00020 * inv(R)*inv(R)' = X 00021 * r = R*x 00022 * R is upper triangular but not strictly a Cholesky factor as diagonal may be negative 00023 * Observe algorithm has been extended to include linearised models 00024 * Discontinous observe models require that state is normailised with respect to the observation. 00025 * 00026 * The filter is operated by performing a 00027 * predict, observe 00028 * cycle defined by the base class 00029 */ 00030 #include "bayesFlt.hpp" 00031 00032 /* Filter namespace */ 00033 namespace Bayesian_filter 00034 { 00035 00036 class Information_root_scheme : public Extended_kalman_filter 00037 { 00038 public: 00039 FM::Vec r; // Information Root state 00040 FM::UTriMatrix R; // Information Root 00041 00042 Information_root_scheme (std::size_t x_size, std::size_t z_initialsize = 0); 00043 00044 void init (); 00045 void update (); 00046 // Covariance form state interface 00047 00048 Float predict (Linrz_predict_model& f, const FM::ColMatrix& invFx, bool linear_r); 00049 /* Generialised form, using precomputed inverse of f.Fx */ 00050 Float predict (Linrz_predict_model& f); 00051 /* Use linrz form for r, computes inverse model using inverse_Fx */ 00052 Float predict (Linear_predict_model& f); 00053 /* Use linear form for r, computes inverse model using inverse_Fx */ 00054 Float predict (Linear_invertable_predict_model& f) 00055 /* Use linear form for r, and use inv.Fx from invertable model */ 00056 { 00057 return predict(f, f.inv.Fx, true); 00058 } 00059 00060 Float observe_innovation (Linrz_uncorrelated_observe_model& h, const FM::Vec& s); 00061 Float observe_innovation (Linrz_correlated_observe_model& h, const FM::Vec& s); 00062 // Extended_kalman_filter observe 00063 00064 static void inverse_Fx (FM::DenseColMatrix& invFx, const FM::Matrix& Fx); 00065 /* Numerical Inversion of Fx using LU factorisation */ 00066 }; 00067 00068 00069 /* 00070 * Information Root Filter Scheme with exposed information state 00071 * Augments Information_root_filter with y,Y in the interface 00072 */ 00073 00074 class Information_root_info_scheme : public Information_root_scheme, virtual public Information_state_filter 00075 { 00076 public: 00077 Information_root_info_scheme (std::size_t x_size, std::size_t z_initialsize = 0); 00078 00079 void init_yY (); 00080 void update_yY (); 00081 // Information form state interface 00082 }; 00083 00084 00085 }//namespace 00086 #endif
1.4.6