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

The Univariate Kalman Filter

Consider a linear dynamical system observed in Gaussian noise:

st+1=ast+wtot=cst+vtwtN(0,σ2w)vtN(0,σ2v)b0=N(ˆs0,Σ0)stbt

with state and observation spaces S=O=R, discrete time t=0,1,..., and coefficients a,cR. We assume: (i) that vt and vk for any t and k are independent; (ii) wt and wk for any t and k are independent; (iii) (vt)t0 and (wt)t=≥0 are independent processes; and (iv) s0 is independent of vt and wt for any t.

The optimal filtering recursion is:

bt+1(st+1)=z(ot+1st+1)Xp(st+1st)bt(st)dstSz(ot+1st+1)Sp(st+1st)b(st)dstdst+1

and the optimal filtered state estimate at time t+1 is

ˆst+1|t+1=E[st+1y1:t+1]=Ssbt+1(s)ds

The univariate Kalman filter is defined as

bt=N(ˆst|t,Σt|t)ˆst|t=ˆst|t1+bt(otcˆst|t1)Σt|t=Σt|t1cbtΣt|t1bt=cΣt|t1c2Σt|t1+σ2vˆst|t1=aˆst1|t1Σt|t1=a2Σt1|t1+σ2w

where bt is the posterior at time t and

ˆst|t

is the state estimate at time t.

To show that the above equations are correct, I derive the Kalman from the Bayesian recursion above. I start by noting some properties of the system.

Lemma 1: At any time t0, st and ot are Gaussian random variables.

Proof:

By definition,

s1=as0+w0s2=as1+w1=a(as0+w0)+w1=a2s0+aw0+w1s3=as2+w2=a(a2s0+aw0+w1)+w2=a3s0+a2w0+aw1+w2st=ats0+t1k=0atk1wk

Hence, st is a linear combination of the random variables s0,w0,w1,...,wt1. Since all of these variables are individually Gaussian and independent, they are jointly Gaussian. As Gaussians are closed under linear transformations, it follows that st is Gaussian.

Now consider the measurement ot, by definition:

ot=cst+vt

Since, st is Gaussian and vt is Gaussian, ot is a linear combination of two Gaussians, and is thus also Gaussian.

Using the above lemma, the system can also be written in terms of transition and observation kernels rather than a difference equation:

st+1p(st+1st)=1σw2πexp(12(st+1astσw)2)otz(otst)=1σv2πexp(12(otcstσv)2) Q.E.D

Another important property of the system is the following.

Lemma: st and ot at any time t0 are jointly Gaussian.

Proof:

By Lemma 1 we know that

st=ats0+t1k=0atk1wkot=c(ats0+t1k=0atk1wk)+vt

Since the random variables (s0,w0,w1,...,wt,v0,v1,...,vt) are jointly Gaussian (see Lemma 1), st and ot are both linear combinations of a set of jointly Gaussian random variables. Let x=(s0,w0,w1,...,wt,v0,v1,...,vt) and let n,m denote the coefficients of the linear combinations for st and ot respectively. Since nTx and mTx are Gaussians, any linear combination of nTx and mTx is a Gaussian. Now consider the vector (nTx,mTx). Since any linear combination of it components is a Gaussian, (nTx,mTx) is by definition a multivariate Gaussian. Q.E.D.

Derivation of the univariate Kalman filter

We derive the Kalman filter equations using mathematical induction. We start with t=1. Using Lemmas 1–2 we obtain

[s0o0]N([ˆs0cˆs0],[Σ0cΣ0cΣ0cΣ0+σ2v])[s1o0]N([aˆs0cˆs0],[a2Σ0+σ2wacΣ0acΣ0c2Σ0σ2v])[o1o0]N([acˆs0cˆs0],[c2(a2Σ0+σ2w)+σ2vac2Σ0ac2Σ0c2Σ0σ2v])

We know from probability calculus that the conditional of a multivariate Gaussian is also Gaussian. In particular, applying standard Gaussian transformation rules, we obtain

p(s1o0)=N(ˆs1|0,Σ1|0)p(o1o0)=N(cˆs1|0,c2Σ1|0+σ2v)

where

ˆs1|0=aˆx0+acΣ0c2Σ0+σ2v(o0cˆs0)=aˆx0|0Σ1|0=a2Σ0+σ2w(acΣ0)2c2Σ0+σ2v=a2Σ0|0+σ2w

and the expectation and variance are

E[o1o0]=acˆs0+ac2Σ0c2Σ0+σ2v(o0cˆs0)=cˆs1,0Var(o1o0)=c2(a2Σ0+σ2w)+σ2w(ac2Σ0)2c2P0+σ2v=c2Σ1|0+σ2w

Furthermore

[s1o1]o0N([ˆs1|0cˆs1|0],[Σ1|0cΣ1|0cΣ1|0c2Σ1|0+σ2v])

This means that

p(s1o0,o1)=N(ˆs1|1,Σ1|1)

where

ˆs1|1=ˆs1|0+cΣ1|0c2Σ1|0+σ2v(o1cˆx1|0)Σ1|1=Σ1|0(cΣ1|0)2c2Σ1|0+σ2v

This proves the inductive base case. Now assume by induction that the Kalman filter equations hold for t=k1. Applying the exact same calculations as above, we obtain

p(sko0:k1)=N(ˆsk|k1,Σk|k1)p(sko0:k1)=N(cˆsk|k1,c2Σk|k1+σ2v)

where

ˆsk|k1=aˆsk1|k1

and

Σk|k1=a2Σk1|k1+σ2w.

Further

[skok]o0:k1N([ˆsk|k1cˆsk|k1],[Σk|k1cΣk|k1cΣk|k1c2Σk|k1+σ2v])

which means that

p(xko0:k)=N(ˆsk|k,Σk|k),

where

ˆsk|k=ˆsk|k1+bk(okcˆsk|k1)Σk|k=Σk|k1cbkΣk|k1bk=cΣk|k1c2Σk|k1+σ2v

Which are exactly the Kalman equations. This completes the induction step. Q.E.D.