In this article, we shall see how the ** Bayesian Kalman Filter** can be used to predict positions of some moving particles / objects in 2D.

This article is inspired by a programming assignment from the

The following equations / algorithms are going to be used to compute the *Bayesian state updates* for the **Kalman** Filter.

For the first set of experiments, a few 2D Brownian Motion like movements are simulated for a particle.

- The noisy position measurements of the particle are captured at different time instants (by adding random Gaussian noise).
- Next,
is used to predict the particle’s position at different time instants, assuming different position, velocity and measurement uncertainty parameter values.**Kalman**Filter - Both the
*actual trajectory*and*KF-predicted trajectory*of the particle are shown in the following figures / animations. - The positional uncertainty (as
*2D-Gaussian distribution*) assumed by the Kalman Filter is also shown as gray / black*contour*(for different values of uncertainties).

The next set of figures / animations show how the position of a moving bug is tracked using **Kalman** Filter.

- First the noisy measurements of the positions of the bug are obtained at different time instants.
- Next the correction steps and then the prediction steps are applied, after assuming some uncertainties in position, velocity and the measurements with some Gaussian distributions.

- The position of the bug as shown in the figure above is moving in the
*x*and*y*direction*randomly*in a grid defined by the*rectangle [-100,100]x[-100,100]*. - The next figure shows how different iterations for the Kalman
predicts and corrects the**Filter***noisy position observations*. The*uncertain*motion modelincreases the*p(x_t|x_{t-1})**spread*of the contour. We observe a noisy position estimateThe contour of the**z_t**.*corrected*positionhas less spread than both the**p(x_t)***observation*and the motion**p(z_t|x_t)**adjusted state.*p(x_t|x_{t-1})*

Next the ** GPS dataset **from the

- Again some noisy measurement is simulated by adding random noise to the original data.
- Then the
**Kalman**Filter is again used to predict the vehicle’s position at different time instants, assuming different position, velocity and measurement uncertainties. - The position and measurement uncertainties (σ_p, σ_m) are in terms of latitude / longitude values, where uncertainty in the motion model is σ_v.
- Both the
*actual trajectory*and*KF-predicted trajectory*of the vehicle are shown in the following figures / animations. - As expected, the more the uncertainties in the position / motion model, the more the actual trajectory differs from the KF-predicted one.

© 2020 Data Science Central ® Powered by

Badges | Report an Issue | Privacy Policy | Terms of Service

**Upcoming DSC Webinar**

- Data Science Leadership Exchange: Best Practices for Driving Outcomes

Despite an increasing awareness of the role data science plays in successful business outcomes, data science leaders still struggle to organize, implement and communicate effective data science initiatives.

Join this latest DSC webinar and gain advice on optimizing your data management strategies. Some of the industry’s best and brightest from Bayer, S&P Global and Transamerica will be presenting their insights and experiences. Register today.

**Most Popular Content on DSC**

To not miss this type of content in the future, subscribe to our newsletter.

- Book: Statistics -- New Foundations, Toolbox, and Machine Learning Recipes
- Book: Classification and Regression In a Weekend - With Python
- Book: Applied Stochastic Processes
- Long-range Correlations in Time Series: Modeling, Testing, Case Study
- How to Automatically Determine the Number of Clusters in your Data
- New Machine Learning Cheat Sheet | Old one
- Confidence Intervals Without Pain - With Resampling
- Advanced Machine Learning with Basic Excel
- New Perspectives on Statistical Distributions and Deep Learning
- Fascinating New Results in the Theory of Randomness
- Fast Combinatorial Feature Selection

**Other popular resources**

- Comprehensive Repository of Data Science and ML Resources
- Statistical Concepts Explained in Simple English
- Machine Learning Concepts Explained in One Picture
- 100 Data Science Interview Questions and Answers
- Cheat Sheets | Curated Articles | Search | Jobs | Courses
- Post a Blog | Forum Questions | Books | Salaries | News

**Archives:** 2008-2014 |
2015-2016 |
2017-2019 |
Book 1 |
Book 2 |
More

**Upcoming DSC Webinar**

- Data Science Leadership Exchange: Best Practices for Driving Outcomes

Despite an increasing awareness of the role data science plays in successful business outcomes, data science leaders still struggle to organize, implement and communicate effective data science initiatives.

Join this latest DSC webinar and gain advice on optimizing your data management strategies. Some of the industry’s best and brightest from Bayer, S&P Global and Transamerica will be presenting their insights and experiences. Register today.

**Most popular articles**

- Free Book and Resources for DSC Members
- New Perspectives on Statistical Distributions and Deep Learning
- Time series, Growth Modeling and Data Science Wizardy
- Statistical Concepts Explained in Simple English
- Machine Learning Concepts Explained in One Picture
- Comprehensive Repository of Data Science and ML Resources
- Advanced Machine Learning with Basic Excel
- Difference between ML, Data Science, AI, Deep Learning, and Statistics
- Selected Business Analytics, Data Science and ML articles
- How to Automatically Determine the Number of Clusters in your Data
- Fascinating New Results in the Theory of Randomness
- Hire a Data Scientist | Search DSC | Find a Job
- Post a Blog | Forum Questions

## You need to be a member of Data Science Central to add comments!

Join Data Science Central