File Exchange

image thumbnail

Kalman Filter and Linear Dynamic System

version (6.1 KB) by Mo Chen
Kalman Filter and Linear Dynamic System for time series modeling


Updated 30 Nov 2018

View Version History

View License

This package contains Kalman filter, Kalman smoother and EM algorithm for fitting parameters of Linear Dynamic System.
This package is now a part of the PRML toolbox (

Cite As

Mo Chen (2021). Kalman Filter and Linear Dynamic System (, MATLAB Central File Exchange. Retrieved .

Comments and Ratings (6)

payam sh

Xinke Shen

@Mo Chen, thanks for your kind reply!

Mo Chen

@Xinke Shen, you are absolutely right. This package implements the textbook Kalman filter algorithm. The numerical unstable problem is the nature of the algorithm. Your way of improving is OK.
In principal, to overcome the numerical problem algorithmicly, you could use the so called squared root filter instead of standard Kalman filter. However, this package is intend to facility studying Kalman filter. So ..

Xinke Shen

The code is well written. But it seems to be numerical unstable. I usually got an error sayting that "sigma is not PD" in KalmanSmoother. So I added a 1e-6 to the diagonal line of "R", then the problem rarely comes out. I wonder if it is reasonable to do so? Thanks!

Guo Bo

Alexander Poremba

There appears to be a typing error due to the previous Bishop 2006 edition. If you check the addendum which can be found online (or simply the 2007 edition), you'll notice that equation 13.106 should read:
E[zn zn-1] = V_n * transpose(J_n-1) + mu_n * transpose(mu_n).

MATLAB Release Compatibility
Created with R2018b
Compatible with any release
Platform Compatibility
Windows macOS Linux

Inspired by: Pattern Recognition and Machine Learning Toolbox

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!