Open Access

The Rao-Blackwellized Particle Filter: A Filter Bank Implementation

  • Gustaf Hendeby1Email author,
  • Rickard Karlsson2 and
  • Fredrik Gustafsson (EURASIPMember)3
EURASIP Journal on Advances in Signal Processing20102010:724087

https://doi.org/10.1155/2010/724087

Received: 7 June 2010

Accepted: 25 November 2010

Published: 6 December 2010

Abstract

For computational efficiency, it is important to utilize model structure in particle filtering. One of the most important cases occurs when there exists a linear Gaussian substructure, which can be efficiently handled by Kalman filters. This is the standard formulation of the Rao-Blackwellized particle filter (RBPF). This contribution suggests an alternative formulation of this well-known result that facilitates reuse of standard filtering components and which is also suitable for object-oriented programming. Our RBPF formulation can be seen as a Kalman filter bank with stochastic branching and pruning.

1. Introduction

The particle filter (PF) [1, 2] provides a fundamental solution to many recursive Bayesian filtering problems, incorporating both nonlinear and non-Gaussian systems. This extends the classic optimal filtering theory developed for linear and Gaussian systems, where the optimal solution is given by the Kalman filter (KF) [3, 4]. Furthermore, the Rao-Blackwellized particle filter (RBPF), sometimes denoted the marginalized particle filter (MPF) or mixture Kalman filters, [511] improves the performance when a linear Gaussian substructure is present, for example, in various map-based positioning applications and target tracking applications as shown in [11]. A summary of different implementations and related methods is given in [12].

The RBPF divides the state vector into two parts, one part , which is estimated using the PF, and another part , where KFs are used. Basically, denoting the measurements and states up to time with and , respectively, the joint probability density function (PDF) is given by Bayes' rule as
(1)
If the model is conditionally linear Gaussian, that is, if the term is linear Gaussian, it can be optimally estimated using a KF. To obtain the second factor, it is necessary to apply nonlinear filtering techniques (here the PF will be used) in all cases where there are at least one nonlinear state relation or one non-Gaussian noise component. The interpretation is that a KF is associated to each particle in the PF. This gives a mixed state-space representation, as illustrated in Figure 1, with represented by particles and represented with a Kalman filter for each particle.
Figure 1

Illustration of the different state distribution representations. Note that 5 000 particles are used for the particle representation, whereas only 50 were needed for an acceptable representation.Actual PDFParticle representationMixed representation in the RBPF

In this paper the RBPF is derived using a stochastic filter bank, where previous formulations follow as special cases. Related ideas are presented in [13, 14] where discrete states instead of nonlinear continuous ones are utilized in a look-ahead Rao-Blackwellized particle filter. Our contribution is motivated by the way it simplifies implementation of the algorithm in a way particularly suited for a object-oriented implementation, where standard class components can be reused. This is also exemplified in a developed software package called F++; (see: http://www.control.isy.liu.se/resources/f++) [15]. Another analysis of the RBPF from a more practical object-orientation point of view can be found in [16].

2. Filter Banks/Multiple Models

In the sequel the RBPF algorithm is interpreted as a filter bank with stochastic pruning. Before going into details about the RBPF method and this particular formulation a brief introduction to filter banks or multiple models is necessary.

Many filtering problems involve rapid changes in the system dynamics and are therefore hard to model. In, for instance, target tracking applications, this can be due to an unknown target maneuver sequence. To achieve an accurate estimate with a sufficiently simple dynamic model and filter method, several models can be used, each adopted to describe a specific feature. To approximate the underlying PDF with this type of filter bank, the Gaussian sum filter [17, 18] is one alternative. The complete filter bank can be fixed in the number of models/modes used, but it can also be constructed so that they increase, usually in an exponential manner, by spawning new possible hypotheses. Hence, one important issue for a multiple model or filter application is to reduce the number of hypotheses used. This can be done using pruning, that is, removing less likely candidates or by merging some of the hypotheses.

To formalize the above discussion, consider a nonlinear switched model
(2)

where is the state vector, the measurement, the process noise, the measurement noise, and the system mode. The mode sequence up to time is denoted . The idea is now to treat each mode of the model independently, design filters as if the mode was known, and combine the independent results based on the likelihood of the obtained measurements.

If KFs or extended Kalman filters (EKFs) are used, the filter bank, denoted , reduces to a set of quadruples representing mode sequence, estimate, covariance matrix, and probability of mode sequence. In order for the filter bank to evolve in time and correctly represent the posterior state distribution it must branch.

So far, the mode can be either continuous or discrete. Suppose now that it is discrete with possible outcomes, which is the usual case in the filter bank context. For each filter in , in total new filters should be created, one filter for each possible mode at the next time step. These new filters obtain their initial state from the filter they are derived from and are then time updated as
(3)

The new filters together with the associated probabilities make up the filter bank .

The next step is to update the filter bank when a new measurement arrives. This is done in two steps. First, each individual filter in is updated using standard measurement update methods, for example, a KF, and then the probability is updated according to how probable that mode is given the measurement,
(4)

yielding the updated filter bank .

Different approximations have been developed to avoid exponential growth in the number of hypotheses. Two major and closely related methods are the generalized pseudo-Bayesian (GPB) filter [19] and the interacting multiple models (IMMs) filter [19].

3. Efficient Recursive Filtering

Back in the 1940s Rao [20] and Blackwell [21] showed that an estimator can be improved by using information about conditional probabilities. Furthermore, they showed how the estimator based on this knowledge should be constructed as a conditioned expected value of an estimator not taking the extrainformation into consideration. The Rao-Blackwell theorem [22, Theorem 6.4] specifies that any convex loss function improves if a conditional probability is utilized. An important special case of the theorem is that it shows that the variance of the estimate will not increase.

3.1. Recursive Bayesian Estimation

For recursive Bayesian estimation the following time update and measurement update equations for the PDFs need to be solved, in general using a PF:
(5a)
(5b)

It is possible to utilize the Rao-Blackwell theorem in recursive filtering given some properties of the involved distributions. There are mainly two reasons to use an RBPF instead of a regular particle filter. One reason is the performance gain obtained from the Rao-Blackwellization itself; however, often more important is that, by reducing the dimension of the state space where particles are used, it is possible to use less particles while maintaining the same performance. In [23] the authors compare the number of particles needed to obtain equivalent performance using different partitions of the state space in particle filter states and Kalman filter states. The RBPF method has also enabled efficient implementation of recursive Bayesian estimation in many applications, ranging between automotive, aircraft, UAV and naval applications [11, 2430].

The RBPF utilizes the division of the state vector into two subcomponents, where it is possible to factorize the posterior distribution, , as
(6)
Preferably, should be available in closed form and allow for efficient estimation of . Furthermore, assumptions are made on the underlying model to simplify things:
(7a)
(7b)

This implies a hidden Markov process.

In the sequel recursive filtering equations will be derived that utilize Rao-Blackwellization for systems with a linear-Gaussian substructure.

3.2. Model with Linear-Gaussian Substructure

The model presented in this section is linear with additive Gaussian noise, conditioned that the state is known:
(8)

with , , and . It will be assumed that these are all mutually independent, and independent in time. If and are not mutually independent, this can be taken care of with a linear transformation of the system, which will preserve the structure. See [31] for details.

Using (6)–(8), it is easy to verify that and and that , and are linear in and Gaussian conditioned on .

3.3. Rao-Blackwellization for Filtering

A standard approach to implement the RBPF for the model structure in (8) is given in, for instance, [10, 11, 23]. The algorithm there follows the five update steps in Algorithm 1, where the two parts of the state vector in (8) are updated separately in a mixed order. Actually, the nonlinear state needs to be time updated before the measurement update of the linear state can be completed, which is mathematically correct, but complicates the understanding of what the filter and predictor forms of the algorithm should be.

Algorithm 1: Rao-Blackwellized PF (normal formulation).

For the system

   

   

     ;

see (8) for system properties.

(1) Initialization: For , and

  set . Let .

(2) PF measurement update: For , evaluate

  the importance weights ,

  and normalize .

(3) Resample particles with replacement:

.

(4) PF time update and KF:

  (a) KF measurement update:

   

     

     

     

  (b) PF time update: For predict new

   particles

  (c) KF time update:

  

  

    

     

  where

      

(5) Increase time and repeat from step 2.

Another problem is that it is quite difficult to see the structure of the problem, making it hard to implement efficiently and using standard components. Step 2 of Algorithm 1 is the measurement update of the PF; it updates parts of the state to incorporate the information in the newest measurements. The step is then followed by a three-step time update in step 4. Already this hides the true algorithm structure and indicates to the user that the filter incorporates the measurement information after step 2, whereas a consistent measurement updated estimate is available first after step 4(a).

However, the main problem lies in step 4(c), which combines a KF time update and a "virtual" measurement update in one operation (see Appendix A for a discussion about the usage of the term virtual). Although the equations resemble Kalman filter relations, it is not on the form where standard filtering components can be readily reused. More specifically, it is not straightforward to split the operation in one time update and one measurement update, since the original appears in both parts. For instance, suppose that a square root implementation of the Kalman filter is required. Then, there are no results available in the literature to cover this case, and a dedicated new derivation would be needed.

3.4. A Filter Bank Formulation of the RBPF

The remainder of this paper presents an alternative approach, avoiding the above-mentioned shortcomings with the RBPF formulation. The key step is to rewrite the model into a conditionally linear form for the complete state vector (not only for the linear part ) as follows:
(9a)
(9b)
Here
(10)

and , are the same as in (8). The notation will be further shortened by dropping , if this can be done without risking the clarity of the presentation.

The RBPF has a lot in common with filter bank methods used for systems with discrete modes. For models that change behavior depending on a mode parameter, an optimal filter can then be obtained by running a filter for each mode , and then combining the different filters to a global estimate. A problem is the exponential growth of modes. This is solved with approximations that reduce the number of modes [19]. An intuitive idea is then to explore part of the state space, , using particles, and consider these instances of the state space as the modes in the filter. It turns out, as shown in Appendix A, that this results in the formulation of the RBPF in Algorithm 2.

Algorithm 2: Filter bank formulation of the RBPF, where represents the equivalent of a mode parameter.

For the system

    

      ;

see (9a) for system properties. Note that the mode

is suppressed in some equations.

(1) Initialization: For , let

  and the weights , where

  and , .

 Let .

(2) Measurement update

     

     

      ,

 with

      ,

      ,

      .

(3) Resample the filter bank according to (A.11) and the

  technique described in Appendix A.4.

(4) Time update

     

     .

(5) Condition on particle state (resample PF):

   For , where

, do:

  

   .

(6) Increase time and repeat from step 2.

Most importantly, note that Algorithm 2 looks very similar to a Kalman filter with two measurement updates and one time update. In fact, with the introduced notation, the formulas are identical to standard Kalman filter equations. This is why code reuse is simplified in this implementation. In contrast to Algorithm 1, it is quite easy to apply a square root implementation of the Kalman filter.

We will next briefly comment on each step of Algorithm 2. In step 1, the filter is initialized by randomly choosing particles to represent nonlinear state space, . New measurements are taken into consideration in the second step of the algorithm. The weights, , for the different hypotheses (or modes) are updated to match how likely they are, given the new measurement, and all the KF filters are updated.

In step 3 the particles are resampled in order to get rid of unlikely modes, and promote likely ones. This step, which is vital for the RBPF to work, comes from the PF. Without resampling, the particle filter will suffer from depletion.

Step 4 has two important purposes. The first is to predict the state in the next time instance. Due to the continuous nature of both the components and of the state space, this results in a continuous distribution in the whole state space, hence also the part. This is in effect an infinite branching. In the second step of the algorithm, the continuous space is reduced to samples of this space again. The pruning is obtained by randomly selecting particles from the distribution of and conditioning on them. This is illustrated in Figure 2.
Figure 2

Illustration of branching with discrete modes and continuous modes (the state). A indicates the system with one possible mode, and B the system with another mode combination a time step later.

Viewed this way, Algorithm 2 describes a Kalman filter bank with stochastic branching and pruning. Gaining this understanding of the RBPF can be very useful. One benefit is that it gives a different view of what happens in the algorithm; another benefit is that it enables for efficient implementations of the RBPF in general filtering frameworks without having to introduce new concepts which would increase the code complexity and at the same time introduce redundant code. The initial idea for this formulation of the RBPF was derived when trying to incorporate the filter into the software package F++.

4. Comparing the RBPF Formulations

Algorithms 1 and 2 represent two different formulations with the same end result. Though the underlying computations should be the same, we believe that Algorithm 2 provides better insight and understanding of the structure of the RBPF algorithm.

  1. (i)

    Step 2 of Algorithm 2 provides the complete filtering density. In Algorithm 1, the measurement update is divided between steps 2 and 4(a), and the filter density is to be combined from these two steps.

     
  2. (ii)

    Step 4 of Algorithm 2 is a pure time update step, and not the mix of time and measurement updates as in step 4(c) in Algorithm 1.

     
  3. (iii)

    Algorithm 2 is built up of standard Kalman filter and particle filter operations (time and measurements updates, and resampling). In Algorithm 1, step 4(c) requires a dedicated implementation.

     

An algorithm based on standard components provides for easier code reuse as exemplified in Listing 1, where the object-oriented RBPF-framework is presented in a matlab like pseudocode.

Listing 1: MATLAB inspired pseudocode of the RBPF method in Algorithm 2. Note. One particle filter is used, implemented using vectorization, hence suppressing particle indices. The RBPFfilter bank consists of N explicit Kalman filters.

% 1. Initialization

for

 KF( ) . Initialize ( );

End

PF . Initialize ( , , )

while ( _final)

% 2. Measurement update

 . MeasurementUpdate ( )

 for

    . MeasurementUpdate ( , )

 end

% 3. Prune/Resample

 . Resample(KF)

% 4. Time update

 for

    . TimeUpdate ()

 end

% 5. Condition on particle state (resample PF)

 . TimeUpdate ( )

 for

    . MeasurementUpdate ( )

 end

% 6. Increase time

end

Each KF object consists of a point estimate and an associated covariance, and methods to update these (measurement and time update functions). In a similar manner, the PF object has particles and weights as internal data, and likelihood calculations, time update, and resampling methods attached. Listing 1 is intended to give a brief summary of the object-oriented approach, the objects themselves and their methods and data structures. For an extensive discussion we refer to [15, 32]. The emphasis in this paper has been on the reorganization of the RBPF algorithm into reusable objects, without mixing the calculations.

Above, object-oriented programming has been discussed briefly. It comprises of several important techniques, such as data abstraction, modularity, encapsulation, inheritance, and polymorphism. For RBPF modeling and filtering, and particularly for the software package F++, all of these are important. However, for the discussion here on algorithm re-usability, mainly encapsulation and modularity are of importance. This could also be achieved in a functional programming language, but usually with less elegance.

5. Simulation Study

To exemplify the structure of the model (9a) and verify the implementation of the new RBPF algorithm formulation, the aircraft target tracking example from [23] is revisited, where the estimation of position and velocity is studied in a simplified 2D constant acceleration model. As measurements, the range and the bearing to the aircraft are considered:
(11)

where the state vector is , that is, position, velocity, and acceleration, with sample period , and where and are range and bearing measurements. The dashed lines indicate the RBPF partition.

The system can be written as
(12)
The noise is Gaussian with zero mean and covariance . The process noises are assumed Gaussian with zero mean and covariances
(13)

The nonlinear effects that are not taken care of in the linear model are put into a model to be handled by a PF.

The resulting linear model (9a) is therefore
(14)

and the nonlinear model follows immediately with the above definitions.

To verify the algorithm numerically the object-oriented F++ software [15] was used for Monte Carlo simulations using the above model structure. In Figure 3 the position RMSE from 100 Monte Carlo simulations for the PF and the RBPF is depicted using particles. The computational complexity for RBPF versus PF for the described system is analyzed in detail in [23], and not part of this paper. As seen, the RBPF RMSE is slightly lower than the PF's, in accordance with the observations made in [23].
Figure 3

Position RMSE for the target tracking example using 100 Monte Carlo simulation with particles. The PF estimates are compared to those from the RBPF.

6. Conclusions

This paper presents the Rao-Blackwellized particle filter (RBPF) in a new way that can be interpreted as a Kalman filter bank with stochastic branching and pruning. The proposed Algorithm 2 contains only standard Kalman filter operations, in conrtast to the state-of-the-art implementation in Algorithm 1 (where step 4(c) is nonstandard). On the practical side, the new algorithm facilitates code reuse and is better suited for object-oriented implementations. On the theoretical side, we have pointed out that an extension to a square root implementation of the KF is straightforward in the new formulation. A related and interesting task for future resarch is to extend the RBPF to smoothing problems, where the new algorithm should also be quite attractive.

Declarations

Acknowledgments

Dr. G. Hendeby would like to acknowledge the support from the European 7th framework project Cognito (ICT-248290). All authors are greatful for support from the Swedish Research Council via a project grant and its Linnaeus Excellence Center CADICS. The authors would also like to thank the reviewers for many and valuable comments that have helped to improve this paper.

Authors’ Affiliations

(1)
Department of Augmented Vision, German Research Center for Artificial Intelligence
(2)
Competence Unit Informatics, Division of Information Systems, Swedish Defence Research Agency (FOI)
(3)
Department of Electrical Engineering, Linköping University

References

  1. Gordon NJ, Salmond DJ, Smith AFM: Novel approach to nonlinear/non-Gaussian Bayesian state estimation. IEE Proceedings F: Radar and Signal Processing 1993, 140(2):107-113. 10.1049/ip-f-2.1993.0015Google Scholar
  2. Doucet A, de Freitas N, Gordon N (Eds): Sequential Monte Carlo Methods in Practice, Statistics for Engineeringand Information Science. Springer, New York, NY, USA; 2001.Google Scholar
  3. Kalman RE: A new approach to linear filtering and prediction problems. Journal Basic Engieering, Series D 1960, 82: 35-45. 10.1115/1.3662552View ArticleGoogle Scholar
  4. Kailat T, Sayed AH, Hassibi B: Linear Estimation. Prentice-Hall, Englewood Cliffs, NJ, USA; 2000.Google Scholar
  5. Doucet A, Godsill S, Andrieu C: On sequential Monte Carlo sampling methods for Bayesian filtering. Statistics and Computing 2000, 10(3):197-208. 10.1023/A:1008935410038View ArticleGoogle Scholar
  6. Casella G, Robert CP: Rao-blackwellisation of sampling schemes. Biometrika 1996, 83(1):81-94. 10.1093/biomet/83.1.81MathSciNetView ArticleMATHGoogle Scholar
  7. Doucet A, Gordon NJ, Krishnamurthy V: Particle filters for state estimation of jump Markov linear systems. IEEE Transactions on Signal Processing 2001, 49(3):613-624. 10.1109/78.905890View ArticleGoogle Scholar
  8. Chen R, Liu JS: Mixture Kalman filters. Journal of the Royal Statistical Society. Series B 2000, 62(3):493-508. 10.1111/1467-9868.00246MathSciNetView ArticleMATHGoogle Scholar
  9. Andrieu C, Doucet A: Particle filtering for partially observed Gaussian state space models. Journal of the Royal Statistical Society. Series B 2002, 64(4):827-836. 10.1111/1467-9868.00363MathSciNetView ArticleMATHGoogle Scholar
  10. Schön T, Gustafsson F, Nordlund PJ: Marginalized particle filters for mixed linear/nonlinear state-space models. IEEE Transactions on Signal Processing 2005, 53(7):2279-2289.MathSciNetView ArticleGoogle Scholar
  11. Schön TB, Karlsson R, Gustafsson F: The marginalized particle filter in practice. Proceedings of IEEE Aerospace Conference, March 2006, Big Sky, Mont, USAGoogle Scholar
  12. Cappé O, Godsill SJ, Moulines E: An overview of existing methods and recent advances in sequential Monte Carlo. Proceedings of the IEEE 2007, 95(5):899-924.View ArticleGoogle Scholar
  13. Morales-Menéndez R, de Freitas N, Poole D: Real time monitoring of complex industrial processes with particle filters. In Advances in Neural Information Processing Systems 15. , Vancouver, Canada; 2002:1457-1464.Google Scholar
  14. de Freitas N, Dearden R, Hutter F, Morales-Menéndez R, Mutch J, Poole D: Diagnosis by a waiter and a Mars explorer. Proceedings of the IEEE 2004, 92(3):455-468. 10.1109/JPROC.2003.823157View ArticleGoogle Scholar
  15. Hendeby G, Karlsson R: Target tracking performance evaluation—a general software environment for filtering. Proceedings of IEEE Aerospace Conference, March 2007, Big Sky, Mont, USAGoogle Scholar
  16. Šmídl V: Software analysis unifying particle filtering and marginalized particle filtering. Proceedings of the 13th IEEE International Conference on Information Fusion, July 2010, Edinburgh, UKGoogle Scholar
  17. Alspach DL, Sorenson HW: Nonlinear Bayesian estimation using Gaussian sum approximations. IEEE Transactions on Automatic Control 1972, 17(4):439-448. 10.1109/TAC.1972.1100034View ArticleMATHGoogle Scholar
  18. Sorenson HW, Alspach DL: Recursive bayesian estimation using gaussian sums. Automatica 1971, 7(4):465-479. 10.1016/0005-1098(71)90097-5MathSciNetView ArticleMATHGoogle Scholar
  19. Blom HAP, Bar-Shalom Y: Interacting multiple model algorithm for systems with Markovian switching coefficients. IEEE Transactions on Automatic Control 1988, 33(8):780-783. 10.1109/9.1299View ArticleMATHGoogle Scholar
  20. Rao CR: Information and the accuracy attainable in the estimation of statistical parameters. Bulletin of the Calcutta Mathematical Society 1945, 37: 81-91.MathSciNetMATHGoogle Scholar
  21. Blackwell D: Conditional expectation and unbiased sequential estimation. The Annals of Mathematical Statistics 1947, 18(1):105-110. 10.1214/aoms/1177730497MathSciNetView ArticleMATHGoogle Scholar
  22. Lehmann EL: Theory of Point Estimation, Probabilityand Mathematical Statistics. John Wiley & Sons, New York, NY, USA; 1983.View ArticleGoogle Scholar
  23. Karlsson R, Schön T, Gustafsson F: Complexity analysis of the marginalized particle filter. IEEE Transactions on Signal Processing 2005, 53(11):4408-4411.MathSciNetView ArticleGoogle Scholar
  24. Gustafsson F, Gunnarsson F, Bergman N, Forssell U, Jansson J, Karlsson R, Nordlund P-J: Particle filters for positioning, navigation, and tracking. IEEE Transactions on Signal Processing 2002, 50(2):425-437. 10.1109/78.978396View ArticleGoogle Scholar
  25. Karlsson R, Gustafsson F: Recursive Bayesian estimation: bearings-only applications. IEE Proceedings F: Radar and Sonar Navigation 152(5):305-313.Google Scholar
  26. Schön T, Karlsson R, Gustafsson F: The marginalized particle filter—analysis, applications and generalizations. Workshop on Sequential Monte Carlo Methods: Filtering and Other Applications, July 2006, Oxford, UKGoogle Scholar
  27. Törnqvist D, Schön TB, Karlsson R, Gustafsson F: Particle filter SLAM with high dimensional vehicle model. Journal of Intelligent and Robotic Systems 2009, 55(4-5):249-266. 10.1007/s10846-008-9301-yView ArticleMATHGoogle Scholar
  28. Karlsson R, Gustafsson F: Particle filter for underwater terrain navigation. IEEE Statistical Signal Processing Workshop, Oct. 2003, St. Louis, Mo, USA 526-529.Google Scholar
  29. Svenzen N: Real time map-aided positioning using a Bayesian approach, M.S. thesis. Department of Electrical Engineering. Linköping University, Linköping, Sweden; 2002.Google Scholar
  30. Karlsson R, Schön TB, Törnqvist D, Conte G, Gustafsson F: Utilizing model structure for efficient simultaneous localization and mapping for a UAV application. Proceedings of IEEE Aerospace Conference, March 2008, Big Sky, Mont, USAGoogle Scholar
  31. Nordlund P-J: Sequential Monte Carlo filters and integrated navigation, M.S. thesis. Department of Electrical Engineering, Linköpings Universitet, Linköping, Sweden; May 2002.Google Scholar
  32. Hendeby G: Performance and implementation aspects of nonlinear filtering, M.S. thesis. Linköping Studies in Science and Technology; March 2008.Google Scholar

Copyright

© Gustaf Hendeby et al. 2010

This article is published under license to BioMed Central Ltd. This is an open access article distributed under the Creative Commons Attribution License, which permits unrestricted use, distribution, and reproduction in any medium, provided the original work is properly cited.