Kalman filter estimation
Email: autuanliu@163.com
- Docs
- 安装
pip install kalman-estimation
1 Theory
1.1 线性一维系统
1.1.1 系统表示
$$x_k=ax_{k-1}+bu_k+w_k$$
$$z_k=cx_k+v_k$$
$$p(w)\sim\mathcal{N}(0, Q)$$
$$p(v)\sim\mathcal{N}(0, R)$$
1.1.2 计算过程
- step 1: Predict
$$\hat{{x}k}=a\hat{{x}{k-1}}+bu_k$$
$$p_k=ap_{k-1}a + Q$$
- step 2: Update
$$g_k=p_k c/(cp_k c+r)$$
$$\hat{x}_k\leftarrow \hat{x}_k+g_k(z_k-c\hat{x}_k)$$
$$p_k\leftarrow (1-g_k c)p_k$$ 以上的过程(step1 && step2)是在观测序列上递归计算的。以上为离散版本(一维)的kalman滤波。
1.2 线性多维系统
1.2.1 系统表示
$$x_k=Ax_{k-1}+Bu_k+w_k$$
$$z_k=Cx_k+v_k$$
1.2.2 计算过程
- step 1: Predict
$$\hat{{x}k}=A\hat{{x}{k-1}}+Bu_k$$
$$P_k=AP_{k-1}A^T+Q$$
- step 2: Update
$$G_k=P_k C^T(C{P_k} C^T+R)^{-1}$$
$$\hat{x}_k\leftarrow \hat{x}_k+G_k(z_k-C\hat{x}_k)$$
$$P_k\leftarrow (I-G_k C)P_k$$
这里的 $x$ 可以是向量 $\vec{x}$,用来表示多个信号。
1.3 非线性多维系统
1.3.1 系统表示
$$x_k=f(x_{k-1},u_k)+w_k$$
$$z_k=h(x_k)+v_k$$
1.3.2 计算过程
- step 1: Predict
$$\hat{{x}k}=f(\hat{{x}{k-1}},u_k)$$
$$P_k=F_{k-1}P_{k-1}F_{k-1}^T+Q_{k-1}$$
- step 2: Update
$$G_k=P_k H_k^T(H_k{P_k} H_k^T+R)^{-1}$$
$$\hat{x}_k\leftarrow \hat{x}_k+G_k(z_k-h(\hat{x}_k))$$
$$P_k\leftarrow (I-G_k H_k)P_k$$
这里 $F_{k-1}$, $H_k$ 分别表示非线性函数 $f$, $h$ 的雅克比矩阵。
Reference
- An implementation of kalman-filters for multivariate time-series in PyTorch
- Analysis of financial time series using Kalman filter.
- Self-Driving Car Nanodegree Program Starter Code for the Extended Kalman Filter Project
- Python Kalman filtering and optimal estimation library. Implements Kalman filter, particle filter, Extended Kalman filter, Unscented Kalman filter, g-h (alpha-beta), least squares, H Infinity, smoothers, and more. Has companion book 'Kalman and Bayesian Filters in Python'.
- FilterPy — FilterPy 1.4.4 documentation
- Kalman Filter book using Jupyter Notebook. Focuses on building intuition and experience, not formal proofs. Includes Kalman filters,extended Kalman filters, unscented Kalman filters, particle filters, and more. All exercises include solutions.
- Header-only C++11 Kalman Filtering Library (EKF, UKF) based on Eigen3
- The Extended Kalman Filter: An Interactive Tutorial
- Lightweight C/C++ Extended Kalman Filter with Python for prototyping
- CoursePack.book
- Kalman Filter: An Algorithm for making sense from the insights of various sensors fused together.
- kalman_intro_chinese.pdf
- autoregressive model - Different state-space representations for Auto-Regression and Kalman filter - Signal Processing Stack Exchange
- 14_state_space.pdf
- kalman.pdf
Info
$ cloc .
96 text files.
88 unique files.
79 files ignored.
github.com/AlDanial/cloc v 1.80 T=1.00 s (42.0 files/s, 3591.0 lines/s)
-------------------------------------------------------------------------------
Language files blank comment code
-------------------------------------------------------------------------------
Python 18 413 666 849
MATLAB 12 78 250 548
Markdown 7 163 1 424
JSON 3 0 0 145
YAML 1 10 4 37
Bourne Shell 1 0 0 3
-------------------------------------------------------------------------------
SUM: 42 664 921 2006
-------------------------------------------------------------------------------