How does the Kalman filter calculate derivatives?

In summary, the Kalman filter estimates higher derivatives, such as velocity, by calculating the difference between predicted and measured values. This deviation is then used to correct both the value and its integral, taking advantage of the fact that the sum of many random variables with Gaussian distribution and zero mean is also Gaussian distribution with zero mean.
  • #1
haael
539
35
Suppose we have a Kalman filter. We have a position sensor, for example GPS. We use the filter to estimate position. However in all examples I see higher derivatives in the state vector: speed, acceleration and sometimes jerk. There is no sensor that calculates these values directly, so they must be somehow calculated from the GPS readings.

There is a prediction matrix but it only tells us how to integrate, not diffrerentiate. The sample matrix for my class of filters looks like that:

\begin{array}{ccc} 1 & dt & dt^2/2 \\ 0 & 1 & dt \\ 0 & 0 & 1 \end{array}

I know it can update a parameter given all higher derivatives, i.e. position from speed. But how can it compute speed from position?

The only place where the differentiation may happen is the correction step. The prediction matrix is used in the computation of Kalman gain so maybe that's how it's done?
Am I correct?
 
Mathematics news on Phys.org
  • #2
If you have a time series of position coordinates, there are several numerical approaches to computing velocities.

THe simplest is just estimating the velocity as the change in the position vector over the change in the time interval between adjacent data points in the time series.
 
  • #3
Your answer seems obviously correct, but my question is: how does the Kalman filter do it? I don't see the above mentioned procedure (calculating differences) in any of the examples I've seen. Contrary, it seems that the KF somehow does in internally. Authors extend the state vector with the derivative, say velocity, and there you go: the velocity is estimated by the filter. I'm asking: how does it happen? Which step of the Kalman filter estimates velocity based on position measurements?
 
  • #4
I finally got it. If anybody's interested:

At some point, the algorithm calculates difference between the predicted value and measured value, the deviation. It then serves as correction of both the value and its integral.

It takes advantage of the fact that sum of many random variables with Gaussian distribution and zero mean is also Gaussian distribution with zero mean.

Let's suppose that the system is in "stable" state, that means the predicted values are always correct. Measured values have some Gaussian noise. Then the deviation of the value will also have Gaussian noise but its mean value will be zero. The same happens with the integral.

\begin{equation*}
\Delta x(t) = x_{predict}(t) - x_{measure}(t) \\
\sum_{i=0}^{t} \Delta x(i) = \sum_{i=0}^{t} x_{predict}(i) - \sum_{i=0}^{t} x_{measure}(i) \\
E(\Delta x(t)) = 0 \\
E(\sum_{i=0}^{t} \Delta x(i)) = 0
\end{equation*}

Now suppose at the moment T = t + 1 some disturbance happens to the system and the predicted and measured values are no longer in agreement.

\begin{equation*}
T = t + 1 \\
\Delta x(T) = x_{predict}(T) - x_{measure}(T) \\
\sum_{i=0}^{T} \Delta x(i) = \sum_{i=0}^{T} x_{predict}(i) - \sum_{i=0}^{T} x_{measure}(i)
\end{equation*}

We have:

\begin{equation*}
\sum_{i=0}^{T} \Delta x(i) = \sum_{i=0}^{t} \Delta x(i) + \Delta x(T) \\
E(\sum_{i=0}^{T} \Delta x(i)) = E(\sum_{i=0}^{t} \Delta x(i) + \Delta x(T)) \\
E(\sum_{i=0}^{T} \Delta x(i)) = E(\sum_{i=0}^{t} \Delta x(i)) + E(\Delta x(T)) \\
E(\sum_{i=0}^{T} \Delta x(i)) = E(\Delta x(T))
\end{equation*}

The instant moment after the disturbance, mean values of the deviations of the value and of its integral are equal. That means, the deviation of the value is equally good for correcting the value and its integral. After a while this might not be strictly correct, but is still good enough, especially if the system is converging to the "stable" state again.
 

1. What is the purpose of using a Kalman filter to calculate derivatives?

The Kalman filter is a mathematical algorithm commonly used in control systems and signal processing to estimate the state of a dynamic system based on a series of noisy measurements. It is particularly useful in situations where there is uncertainty or noise in the measurements, and it is able to provide accurate estimates of the system's state, including derivatives, despite this noise.

2. How does the Kalman filter handle noise in the measurements?

The Kalman filter uses a prediction-correction cycle to estimate the state of the system. In the prediction step, it uses a mathematical model of the system to predict the current state based on the previous state and any control inputs. In the correction step, it compares this predicted state to the actual measurements and adjusts the prediction based on the difference between the two. This process allows the filter to account for and reduce the effects of noise in the measurements.

3. What type of mathematical model does the Kalman filter use?

The Kalman filter uses a linear dynamical system model, which assumes that the system's state can be described by a linear combination of its previous state and any control inputs. This model is used in both the prediction and correction steps of the filter, and it allows the filter to make accurate estimates of derivatives by taking advantage of the linear relationships between the system's variables.

4. How does the Kalman filter estimate derivatives from noisy measurements?

The Kalman filter uses a process called state estimation, which involves propagating the system's state through time and continuously updating the estimate based on new measurements. By using the linear dynamical system model and the prediction-correction cycle, the filter is able to filter out noise in the measurements and provide accurate estimates of the system's derivatives.

5. Are there any limitations to using the Kalman filter for calculating derivatives?

While the Kalman filter is a powerful tool for estimating the state of a dynamic system, it does have some limitations. It relies on the assumption that the system can be accurately modeled with a linear dynamical system, which may not always be the case. It also requires knowledge of the system's initial state and any control inputs, which may not always be available. Additionally, the filter's performance can be affected by incorrect or unreliable measurements, so it is important to carefully consider the quality and accuracy of the input data when using the Kalman filter.

Similar threads

Replies
6
Views
2K
  • Engineering and Comp Sci Homework Help
Replies
1
Views
748
Replies
1
Views
2K
Replies
2
Views
2K
  • Engineering and Comp Sci Homework Help
Replies
1
Views
811
  • General Engineering
Replies
1
Views
2K
  • MATLAB, Maple, Mathematica, LaTeX
Replies
2
Views
2K
  • Mechanical Engineering
Replies
5
Views
1K
  • General Engineering
Replies
4
Views
2K
Back
Top