65 | | |
66 | | |
67 | | <h1><a class="anchor" id="kalman">Examples of (extended) Kalman filtering </a></h1><p>Kalman filtering and Extended Kalman filtering are special cases of Bayesian filtering. The Kalman filter is optimal for linear state space model with Gaussian disturbances, the extended Kalman filter is derived as linearization of non-linear state space models with Gaussian noises. Hence it is only sub-optimal filter.</p> |
68 | | <p>More advanced filtering algorithms for non-linear non-Gaussian models can be derived, see ...</p> |
69 | | <h2><a class="anchor" id="klm"> |
| 62 | <h1><a class="anchor" name="kalman">Examples of (extended) Kalman filtering </a></h1>Kalman filtering and Extended Kalman filtering are special cases of Bayesian filtering. The Kalman filter is optimal for linear state space model with Gaussian disturbances, the extended Kalman filter is derived as linearization of non-linear state space models with Gaussian noises. Hence it is only sub-optimal filter.<p> |
| 63 | More advanced filtering algorithms for non-linear non-Gaussian models can be derived, see ...<h2><a class="anchor" name="klm"> |
71 | | <p>Kalman filtering is optimal estimation procedure for linear state space model: </p> |
72 | | <p class="formulaDsp"> |
73 | | <img class="formulaDsp" alt="\begin{eqnarray} x_t &= &A x_{t-1} + B u_{t} + v_t,\\ y_t &= &C x_{t} + D u_{t} + w_t, \end{eqnarray}" src="form_119.png"/> |
74 | | </p> |
75 | | <p> where <img class="formulaInl" alt="$ x_t $" src="form_120.png"/> is the state, <img class="formulaInl" alt="$ y_t $" src="form_6.png"/> is the system output, <img class="formulaInl" alt="$ A, B, C, D$" src="form_121.png"/> are state matrices of appropriate dimensions, <img class="formulaInl" alt="$v_t, w_t$" src="form_122.png"/> are zero mean Gaussian noises with covariance matrices <img class="formulaInl" alt="$Q, R$" src="form_123.png"/>, respectively.</p> |
76 | | <p>Both prior and posterior densities on the state are Gaussian, i.e. of the class enorm.</p> |
77 | | <p>There is a range of classes that implements this functionality, namely:</p> |
78 | | <ul> |
79 | | <li><a class="el" href="classbdm_1_1KalmanFull.html" title="Basic Kalman filter with full matrices.">bdm::KalmanFull</a> which implements the estimation algorithm on full matrices,</li> |
80 | | <li><a class="el" href="classbdm_1_1KalmanCh.html" title="Kalman filter in square root form.">bdm::KalmanCh</a> which implements the estimation algorithm using choleski decompositions and QR algorithm.</li> |
81 | | </ul> |
82 | | <h2><a class="anchor" id="ekf"> |
| 65 | Kalman filtering is optimal estimation procedure for linear state space model: <p class="formulaDsp"> |
| 66 | <img class="formulaDsp" alt="\begin{eqnarray} x_t &= &A x_{t-1} + B u_{t} + v_t,\\ y_t &= &C x_{t} + D u_{t} + w_t, \end{eqnarray}" src="form_119.png"> |
| 67 | <p> |
| 68 | where <img class="formulaInl" alt="$ x_t $" src="form_120.png"> is the state, <img class="formulaInl" alt="$ y_t $" src="form_6.png"> is the system output, <img class="formulaInl" alt="$ A, B, C, D$" src="form_121.png"> are state matrices of appropriate dimensions, <img class="formulaInl" alt="$v_t, w_t$" src="form_122.png"> are zero mean Gaussian noises with covariance matrices <img class="formulaInl" alt="$Q, R$" src="form_123.png">, respectively.<p> |
| 69 | Both prior and posterior densities on the state are Gaussian, i.e. of the class enorm.<p> |
| 70 | There is a range of classes that implements this functionality, namely:<ul> |
| 71 | <li><a class="el" href="classbdm_1_1KalmanFull.html" title="Basic Kalman filter with full matrices.">bdm::KalmanFull</a> which implements the estimation algorithm on full matrices,</li><li><a class="el" href="classbdm_1_1KalmanCh.html" title="Kalman filter in square root form.">bdm::KalmanCh</a> which implements the estimation algorithm using choleski decompositions and QR algorithm.</li></ul> |
| 72 | <h2><a class="anchor" name="ekf"> |
84 | | <p>Extended Kalman filtering arise by linearization of non-linear state space model: </p> |
85 | | <p class="formulaDsp"> |
86 | | <img class="formulaDsp" alt="\begin{eqnarray} x_t &= &g( x_{t-1}, u_{t}) + v_t,\\ y_t &= &h( x_{t} , u_{t}) + w_t, \end{eqnarray}" src="form_124.png"/> |
87 | | </p> |
88 | | <p> where <img class="formulaInl" alt="$ g(), h() $" src="form_125.png"/> are general non-linear functions which have finite derivatives. Remaining variables have the same meaning as in the Kalman Filter.</p> |
89 | | <p>In order to use this class, the non-linear functions and their derivatives must be defined as an instance of class <code>diffbifn</code>.</p> |
90 | | <p>Two classes are defined:</p> |
91 | | <ul> |
92 | | <li><a class="el" href="classbdm_1_1EKFfull.html" title="Extended Kalman Filter in full matrices.">bdm::EKFfull</a> on full size matrices,</li> |
93 | | <li><a class="el" href="classbdm_1_1EKFCh.html" title="Extended Kalman Filter in Square root.">bdm::EKFCh</a> on Choleski decompositions and using QR algorithm.</li> |
94 | | </ul> |
95 | | <h2><a class="anchor" id="exa"> |
| 74 | Extended Kalman filtering arise by linearization of non-linear state space model: <p class="formulaDsp"> |
| 75 | <img class="formulaDsp" alt="\begin{eqnarray} x_t &= &g( x_{t-1}, u_{t}) + v_t,\\ y_t &= &h( x_{t} , u_{t}) + w_t, \end{eqnarray}" src="form_124.png"> |
| 76 | <p> |
| 77 | where <img class="formulaInl" alt="$ g(), h() $" src="form_125.png"> are general non-linear functions which have finite derivatives. Remaining variables have the same meaning as in the Kalman Filter.<p> |
| 78 | In order to use this class, the non-linear functions and their derivatives must be defined as an instance of class <code>diffbifn</code>.<p> |
| 79 | Two classes are defined:<ul> |
| 80 | <li><a class="el" href="classbdm_1_1EKFfull.html" title="Extended Kalman Filter in full matrices.">bdm::EKFfull</a> on full size matrices,</li><li><a class="el" href="classbdm_1_1EKFCh.html" title="Extended Kalman Filter in Square root.">bdm::EKFCh</a> on Choleski decompositions and using QR algorithm.</li></ul> |
| 81 | <h2><a class="anchor" name="exa"> |