Post · 2 min read· pp. 197–198

One-dimensional Kalman Gain Derivation

There are several ways to derive the one-dimensional Kalman Gain equation. I present the simplest one.

Given the measurement znz_{n} and the prior estimate x^n,n−1\hat{x}_{n,n-1} we are interested in finding an optimum combined estimate x^n,n\hat{x}_{n,n} based on the measurement and the prior estimate.

The optimum combined estimate is a weighted mean of the prior estimate and the measurement:

x^n,n=w1zn+w2x^n,n−1\hat{x}_{n,n} = w_{1}z_{n} + w_{2}\hat{x}_{n,n-1}

Where w1w_{1} and w2w_{2} are the weights of the measurement and the prior estimate.

w1+w2=1w_{1} + w_{2} = 1

x^n,n=w1zn+(1−w1)x^n,n−1\hat{x}_{n,n} = w_{1}z_{n} + (1 - w_{1})\hat{x}_{n,n-1}

The relation between variances is given by:

pn,n=w12rn+(1−w1)2pn,n−1p_{n,n} = w_{1}^{2}r_{n} + (1 - w_{1})^{2}p_{n,n-1}

Where:

pn,np_{n,n} is the variance of the optimum combined estimate x^n,n\hat{x}_{n,n}

pn,n−1p_{n,n-1} is the variance of the prior estimate x^n,n−1\hat{x}_{n,n-1}

rnr_{n} is the variance of the measurement znz_{n}

Note: for any normally distributed random variable xx with variance σ2\sigma^{2}, wxwx is distributed normally with variance w2σ2w^{2}\sigma^{2}

Since we are looking for an optimum estimate, we want to minimize pn,np_{n,n}.

To find w1w_{1} that minimizes pn,np_{n,n}, we differentiate pn,np_{n,n} with respect to w1w_{1} and set the result to zero.

dpn,ndw1=2w1rn−2(1−w1)pn,n−1\frac{dp_{n,n}}{dw_{1}} = 2w_{1}r_{n} - 2(1 - w_{1})p_{n,n-1}

Hence

w1rn=pn,n−1−w1pn,n−1w_{1}r_{n} = p_{n,n-1} - w_{1}p_{n,n-1}

w1pn,n−1+w1rn=pn,n−1w_{1}p_{n,n-1} + w_{1}r_{n} = p_{n,n-1}

w1=pn,n−1pn,n−1+rnw_{1} = \frac{p_{n,n-1}}{p_{n,n-1} + r_{n}}

We have derived the Kalman Gain!

Since the Kalman Gain yields the minimum variance estimate, the Kalman Filter is also called an optimal filter.