# Kalman Filter: Do we need to measure each entry of the output-sequence, or can we derive them?

A Kalman-Filter gets applied to a state-space model in order to obtain estimates of the state-vector.

Example: Assume a car moving on a straight line in x-direction (this is a 1-dimensional problem). The State-space model could be described by:

$$\begin{bmatrix} x_k \\ \dot{x}_k \\ \ddot{x}_k \end{bmatrix} = \begin{bmatrix} 1 & T & \frac12\,T^2 \\ 0 & 1 & T \\ 0 & 0 & 1 \end{bmatrix} \begin{bmatrix} x_{k-1} \\ \dot{x}_{k-1} \\ \ddot{x}_{k-1} \end{bmatrix} + w_{k-1}$$

$$\begin{bmatrix} y_k \\ \dot{y}_k \\ \ddot{y}_k \end{bmatrix} = \begin{bmatrix} 1 & 0 & 0 \\ 0 & 1 & 0 \\ 0 & 0 & 1 \end{bmatrix} \begin{bmatrix} x_k \\ \dot{x}_k \\ \ddot{x}_k \end{bmatrix} + v_k$$

The y-vector is our measurement-sequence. And here comes my question: For the Kalman-Filter to work, is it necessary to measure each of the entries of the y-vector?

Coming back to the car: I can measure the number of rotations of the driving-shaft using a wheel-encoder. From this I can infer the distance travelled, which is my x-coordinate assuming a movement on a straight line in x-direction.

I cannot measure the velocity directly. But I can infer the velocity from the number of edges detected within a certain time-gap, using the wheel encoder. And I can derivate velocity in order to obtain acceleration.

So, what I am saying is: In order to obtain each entry of the y-vector, I am using but one sensor: The wheel encoder. Is this valid when applying the Kalman-Filter equations?

• Is the first question about if KF can have missing data? The second question is asking the adequacy of encoder as sensor? May 6, 2019 at 8:53
• I think I am just asking one question here: For the given state-space model, do I need to have sensors directly measuring y, d/dt y and d^2/dt^2 y ? May 7, 2019 at 9:04

If you formulate your Kalman filter with the output matrix as eye(3) - $$\left[\begin{array} \\ 1 & 0 & 0 \\ 0 & 1 & 0 \\ 0 & 0 & 1 \\ \end{array}\right]$$

then you need to provide all those measurements, but you could alternatively define the output matrix as eye(1,3) -

$$\left[\begin{array} \\ 1 & 0 & 0 \\ \end{array}\right]$$

and then that should let you supply just the feedback measurement on encoder position and have the Kalman filter provide the speed and acceleration estimates. This would be the preferred way to do it, instead of trying to manually derive the speed and then passing that speed "measurement" to the Kalman filter.

• Thank you so much for your reply!... are you saying: I can leave my state transfer matrix a 3x3 matrix and reduce my observation matrix to a 1x3 matrix? Is this valid? May 13, 2019 at 11:14
• @user503842 - I think it would only work if your system is still observable with the reduced output matrix. In your case it is still observable, so it should work fine :)
– Chuck
May 13, 2019 at 14:39
• @Chunk: How did you find out that the system is still observable? - the observation matrix is [C, CA]^T and that would be [1 0 0, 1 T 0.5T^2] and its determinant is 0, isn't it? Jun 9, 2019 at 19:15
• whops, I made a mistake. The observation matrix would be C, CA, CA^2]^T and that's 1 0 0, 1 T 0.5T^2, 1 2T 2T^2]^T and its determinant is not zero Jun 9, 2019 at 19:21