Machine Learning
  • Introduction
  • man
  • Linear model
    • Linear Regression
    • Generalized Linear Models
    • Nonlinear regression
  • bayes
    • bayesian network
    • Variational Bayesian inference
    • Gaussian Process Regression
  • Logistic Regression
    • L1 regularization
    • L2 regularization
    • softmax
    • Overflow and Underflow
  • SVM
    • C-SVM
    • C-SVM求解
  • EM
    • GMM
  • Maximum Entropy
    • IIS
  • HMM
    • viterbi algorithm
  • CRF
  • Random Forest
    • bagging
    • random forest
  • boosting
    • catboost
    • gradient boosting
    • Newton Boosting
    • online boosting
    • gcForest
    • Mixture models
    • XGBoost
    • lightGBM
    • SecureBoost
  • LDA
  • rank
    • RankNet
    • LambdaRank
    • SimRank
  • Factorization Machine
    • Field-aware Factorization Machine
    • xdeepFM
  • Clustering
    • BIRCH
    • Deep Embedding Clustering
  • Kalman filtering
  • word2vec
  • 关联规则挖掘
  • MATH-Mathematical Analysis
    • measure
  • MATH-probability
    • Variational Inference
    • Dirichlet分布
    • Gibbs Sampling
    • Maximum entropy probability distribution
    • Conjugate prior
    • Gaussian Process
    • Markov process
    • Poisson process
    • measure
    • Gumbel
  • MATH-Linear Algebra
    • SVD
    • SVD-推荐
    • PCA
    • Linear Discriminant Analysis
    • Nonnegative Matrix Factorization
  • MATH-Convex optimization
    • 梯度下降
    • 随机梯度下降
    • 牛顿法
    • L-BFGS
    • 最速下降法
    • 坐标下降法
    • OWL-QN
    • 对偶问题
    • 障碍函数法
    • 原对偶内点法
    • ISTA
    • ADMM
    • SAG
  • MATH-碎碎念
    • cost function
    • Learning Theory
    • sampling
    • Entropy
    • variational inference
    • basis function
    • Diffie–Hellman key exchange
    • wavelet transform
    • 图
    • Portfolio
    • 凯利公式
  • ML碎碎念
    • 特征
    • test
    • TF-IDF
    • population stability index
    • Shapley Values
  • 课件
    • xgboost算法演进
  • Time Series
  • PID
  • graph
    • SimRank
    • community detection
    • FRAUDAR
    • Anti-Trust Rank
    • Struc2Vec
    • graph theory
    • GNN
  • Anomaly Detection
    • Isolation Forest
    • Time Series
  • Dimensionality Reduction
    • Deep Embedded Clustering
  • Federated Learning
  • automl
  • Look-alike
  • KNN
  • causal inference
Powered by GitBook
On this page
  • 5条黄金公式的推导:####(参考卡尔曼滤波 -- 从推导到应用(一),自己再推导了一遍)
  • 参考佳文

Was this helpful?

Kalman filtering

PreviousDeep Embedding ClusteringNextword2vec

Last updated 5 years ago

Was this helpful?

卡尔曼滤波是以最小均方误差为估计的最佳准则,来寻求一套递推估计的算法,其基本思想是:采用信号与噪声的状态空间模型,利用前一时刻地估计值和现时刻的观测值来更新对状态变量的估计,求出现时刻的估计值。

what? 最小均方误差不就是最小二乘吗?

模型的预测+测量的反馈(权重由kalman gain决定) 形成新的高斯分布,所以可以作为下次迭代的起始点。

# http://www.cs.unc.edu/~welch/kalman/kalmanIntro.html
import numpy as np
import matplotlib
matplotlib.use('Agg')
import matplotlib.pyplot as plt

#这里是假设A=1,H=1的情况

iterTimes = 50
sz = (iterTimes,)
x = -0.37727  # truth value (typo in example at top of p. 13 calls this z)
z = np.random.normal(x,0.1,size=sz)  # observations (normal about x, sigma=0.1)

Q = 1e-5  # process variance

xhat = np.zeros(sz)
P = np.zeros(sz)
xhatminus = np.zeros(sz)
Pminus=np.zeros(sz)
K=np.zeros(sz)

R = 0.1**2 # estimate of measurement variance, change to see effect

# intial guesses
xhat[0] = 0.0
P[0] = 1.0

for k in range(1,iterTimes):
    # time update
    xhatminus[k] = xhat[k-1]  #X(k|k-1) = AX(k-1|k-1) + BU(k) + W(k),A=1,BU(k) = 0
    Pminus[k] = P[k-1]+Q      #P(k|k-1) = AP(k-1|k-1)A' + Q(k) ,A=1

    # measurement update
    K[k] = Pminus[k]/( Pminus[k]+R ) #Kg(k)=P(k|k-1)H'/[HP(k|k-1)H' + R],H=1
    xhat[k] = xhatminus[k]+K[k]*(z[k]-xhatminus[k]) #X(k|k) = X(k|k-1) + Kg(k)[Z(k) - HX(k|k-1)], H=1
    P[k] = (1-K[k])*Pminus[k] #P(k|k) = (1 - Kg(k)H)P(k|k-1), H=1

plt.figure(num=1,figsize=(8,6))
plt.xlabel("Iteration",size=14)
plt.ylabel("Voltage",size=14)
plt.plot(z,'k+',label='noisy measurements')     #测量值
plt.plot(xhat,'b-',label='a posteri estimate')  #过滤后的值
plt.axhline(x,color='g',label='truth value')    #系统值
plt.legend()
plt.savefig('kf.png',format='png')

plt.figure()
valid_iter = range(1,iterTimes) # Pminus not valid at step 0
plt.plot(valid_iter,Pminus[valid_iter],label='a priori error estimate')
plt.xlabel('Iteration')
plt.ylabel('$(Voltage)^2$')
plt.setp(plt.gca(),'ylim',[0,.01])
plt.savefig('kf1.png',format='png')

时间序列有三类重要的统计诊断,filter滤波,predict预测,smooth平滑。未来时刻用Kalman算法我们称之为预测,对当下的结果用Kalman算法我们称之为滤波,对过去的结果用Kalman算法我们称之为平滑。

KF算法可以从贝叶斯,也可以从最小二乘推导出

参考佳文

PRML Chapter13 从概率的角度讲叙了kalman Filter 。或者参考 。

附截图

5条黄金公式的推导:####(参考,自己再推导了一遍)

最后盗一张算法流程图:

这个也是从bayes角度推导

徐亦达老师的视频课

中文

线性动态系统
卡尔曼滤波器学习笔记(一)
卡尔曼滤波 -- 从推导到应用(一)
概率机器人——贝叶斯滤波
通俗地解释卡尔曼滤波器(一)——从贝叶斯滤波器说起
贝叶斯滤波
细说贝叶斯滤波:Bayes filters
细说Kalman滤波:The Kalman Filter
卡尔曼滤波器(THE KALMAN FILTER)的数学原理
最小二乘估计与卡尔曼滤波公式推导
Kalman Filter(卡尔曼滤波) 与Least Square(最小二乘法) 的比较
卡尔曼滤波方程组的深刻理解有哪些?-最小二乘法
贝叶斯视角下的卡尔曼滤波
Kalman滤波器从原理到实现
卡尔曼滤波 -- 从推导到应用(一)
卡尔曼滤波 -- 从推导到应用(二)
基于Kalman滤波器的进行物体的跟踪
Kalman and Bayesian Filters in Python
An Introduction to the Kalman Filter
如何通俗并尽可能详细解释卡尔曼滤波
Extended Kalman Filter、Particle filter在目标跟踪中的研究
Kalman Filter
How a Kalman filter works, in pictures
说说卡尔曼滤波
http://blog.csdn.net/baimafujinji/article/details/50650366
卡尔曼滤波(KF)与扩展卡尔曼滤波(EKF)的一种理解思路及相应推导
时间序列分析补充----结合ARMA的卡尔曼滤波算法