Loading [MathJax]/jax/output/HTML-CSS/jax.js

MathJax

Friday, August 12, 2016

Kalman filter

Define the system
xk+1=Fkxk+Gkwk+Γkuk(1)zk=Hkxk+vk(2) {uk} is known, x0(ˉx0,P0) and {wk},{vk} are random sequences with
[wkvk]([00],[QkSkSkRk])  with [wkvk] independent of other vectors indexed by lk and x0

One step predictor estimate

First we seek a recursive equation for ˆxk|k1=E[xk|Zk1]=E[xk|˜Zk1] Define ˜xk=xkˆxk|k1, note that {˜xk} is not an innovations sequence.  Because of the independence of the innovations we have
E[xk+1|˜Zk]=E[xk+1|˜zk]+E[xk+1|˜Zk1]ˉxk+1
Where ˉxk=E[xk].  Recall
E[xk+1|˜zk]=ˉxk+1+cov(xk+1,˜zk)cov1(˜zk,˜zk)˜zk Define the error covariance matrix Σk|k1=E[˜xk˜xk] Then
cov(xk+1,˜zk)=cov(Fkxk+Gkwk+Γkuk,Hk˜xk+vk)=E[(Fkxk+GkwkFkˉxk)(˜xkHk+vk)]=E[Fkxk˜xkHk]+GkSk=Fk[E(ˆxk|k1˜xk)+E(˜xk˜xk)]Hk+GkSk=FkΣk|k1Hk+GkSk Observe that ˆzk|k1=Hˆxk|k1  and subtracting from (2) gives ˜zk=Hk˜xk+vk.  Also note that E[ˆxk˜xk]=0.  Next
cov(˜zk,˜zk)=cov(Hk˜xk+vk,Hk˜xk+vk)=HkΣk|k1Hk+Rk=Ωk We also have
E[xk+1|˜Zk1]=E[Fkxk+Gkwk+Γkuk|˜Zk1]=FkE[xk|˜Zk=1]+Γkuk=Fkˆxk|k1+Γkuk Collecting all terms above, the recursion becomes
ˆxk+1|k=Fkˆxk|k1+Γkuk+Kk(zkHkˆxk|k1)(9) with Kk=(FkΣk|k1Hk+GkSk)Ω1k

The recursion of the error covariance is developed next.   From (1),(9), using the identity ˜xk+1=xk+1ˆxk+1|k and expanding zk using (2).
˜xk+1=(FkKkHk)˜xk+GkwkKkvk Since ˜xk and [wkvk] are independent and zero mean, we get
E[˜xk+1˜xk+1]=(FkKkHk)E(˜xk˜xk)(FkKkHk)×[GkKk][QkSkSkRk][GkKk] or
Σk+1|k=(FkKkHk)Σk|k1(FkKkHk)+GkQkGk+KkRkKkGkSkKkKkSkGk
Filtered estimates

Defined in terms of ˆxk+1|k and zk+1
ˆxk+1|k+1=E[xk+1|˜Zk+1]=E[xk+1|˜zk+1]+E[xk+1|˜Zk]ˉxk+1=ˉxk+1+cov(xk+1,˜zk+1)cov1(˜zk+1,˜zk+1)˜zk+1+ˆxk+1|kˉxk+1
Now cov(xk+1,˜zk+1)=E[(˜xk+1+ˆxk+1|kˉxk+1)(˜xk+1Hk+1+vk+1)]=E[˜xk+1˜xk+1]Hk+1=Σk+1|kHk+1
From early results, we have cov(˜zk+1,˜zk+1)=Hk+1Σk+1|kHk+1+Rk+1=Ωk+1  The measurement-update (filtered estimate) is
ˆxk+1|k+1=ˆxk+1|k+Σk+1|kHk+1Ω1k+1(zk+1Hk+1ˆxk+1|k)(6)
Define the uncorrelated input noise ˜wk=wkˆwk=wkSkR1kvk such that
[˜wkvk]([00],[QkSkR1kSk00Rk])
then we have
xk+1=Fkxk+Gk˜wk+GkSkR1kvk+Γkuk=(FkGkSkR1kHk)xk+Gk˜wk+Γkuk+GkSkR1kzk using the fact vk=zkHkxk .Noting that E[˜wkvk]=0,  the time update equation becomes
ˆxk+1|k=(FkGkSkR1kHk)ˆxk|k+Γkuk+GkSkR1kzk(5)
Error covariance for filtered estimates
The error covariance is
Σk|k=E[(xkˆxk|k)(xkˆxk|k)]
From (6) we have
(xk+1ˆxk+1|k+1)+Σk+1|kHk+1Ω1k+1˜zk+1=xk+1ˆxk+1|k
By the orthogonality principle, xk+1ˆxk+1|k+1 is orthogonal to ˜zk+1.  Therefore,
Σk+1|k+1+Σk+1|kHk+1Ω1k+1Hk+1Σk+1|k=Σk+1|k or
Σk+1|k+1=Σk+1|kΣk+1|kHk+1Ω1k+1Hk+1Σk+1|k
Lastly, we obtain the time-update error covariance, subtracting (5) from (1)
xk+1ˆxk+1|k=(FkGkSkR1kHk)(xkˆxk|k)+Gw˜wk and using the orthogonality of ˜wk and xkˆxk|k, we obtain
Σk+1|k=(FkGkSkR1kHk)Σk|k(FkGkSkR1kHk)+Gk(QkSkR1kSk)Gk
Summary

Measurement update
ˆxk+1|k+1=ˆxk+1|kHk+1Ω1k+1(zk+1Hk+1ˆxk+1|k)Σk+1|k+1=Σk+1|kΣk+1|kHk+1Ω1k+1Hk+1Σk+1|kΩk+1=Hk+1Σk+1|kHk+1+Rk+1
Time update
ˆxk+1|k=(FkGkSkR1kHk)ˆxk|k+Γkuk+GkSkR1kzkΣk+1|k=(FkGkSkR1kHk)Σk|k(FkGkSkR1kHk)+Gk(QkSkR1kSk)Gk
Time update with Sk=0
ˆxk+1|k=Fkˆxk|k+ΓkukΣk+1|k=FkΣk|kFk+GkQkGk
Combined update with Sk=0 for filtered state:
ˆxk+1|k+1=Fkˆxk|k+Lk+1(zk+1Hk+1Fkˆxk|kHk+1Γkuk)Lk+1=Σk+1|kHk+1Ω1k+1Ωk+1=Hk+1Σk+1|kHk+1+Rk+1

No comments: