Kalman Filter
The Kalman Filter is an MMSE estimator that uses the state-space equation of the system and is an optimal data processing algorithm with a recursive structure. Initially, Kalman Filters could only be used in linear systems, but a method that could be applied to nonlinear systems was devised later.
A basic Kalman Filter looks like this:
Estimator
An estimator is an algorithm that estimates an unknown quantity from available information:
- The unknown quantities are usually expressed as state variables and system parameters.
- The available information consists of an exercise model, a measurement model, a noise model, and measurement data.
An estimator is classified into prediction, filtering, smoothing according to the measurement data and the estimation point of state variables:
Prediction : Infers future state variables based on measurement data from the past to the present. It is used to estimate the trajectory of celestial bodies or future stock prices.
Filtering : Infers present state variables based on measurement data from the past to the present. It is used to estimate the real-time state of robots, missiles, or airplanes.
Smoothing : Infers present state variables based on measurement data from the past to the future. It is used to estimate the state of the system by post-processing measurement data accumulated in a test or experiment.
The Kalman filter provides the mathematical method that can be applied to these three estimation methods.
State variables
State variables are variables that can change significantly over time due to external forces or actions.
System parameters
System parameters are variables that do not change or change slowly over time. However, if necessary, system parameters are sometimes considered as state variables. For example, if a parameter is the unknown quantity to be estimated, it is regarded as a state variable.
Dynamics Model
One type of available information, the dynamics model, is a mathematical model that describes how the properties of dynamic systems change over time.
Dynamics models are built to describe specific state variables and parameters of interest, as well as the interrelationships between system inputs and outputs, using Newton’s laws of motion, empirical insights, experiments, etc.
A dynamics model needs to be created to accurately describe real-world motion, but it involves many uncertainties in practice.
These uncertainties are caused by various approximation processes while deriving mathematical dynamics models, unexpected increases in system complexity during operation, disruptions from outside the system, or changes in the operating environment. Additionally, this happens because only important dynamic modes are intentionally modeled while the rest are not. In some cases, it may be due to a lack of understanding of the system, the high cost and time required to obtain a model, or special conditions.
Given the uncertainty inherent in these mathematical dynamics models, the best modeling method is to use probabilities to express this uncertainty.
Therefore, the mathematical dynamics model can be represented as a state-space equation.
However, Kalman filters should not be developed as continuous-time models as shown in formula [1], but as discrete-time models.
Finally, the dynamics model is expressed as:
The performance of a Kalman filter depends on the accuracy of the system model.Therefore, to properly select and build a system model, you need to understand the system, state variables, parameters, etc.
State-Space Equation
The state-space equation is expressed as follows:
$\dot{x}(t)=f(x(t), u(t), w(t),t)$ [1]
where
- $x(t) \in \mathbb{R}^{p}$: A state variable. It is introduced to express the uncertainty inherent in the mathematical dynamic model.
- $w(t) \in \mathbb{R}^{m}$: Process noise. It is called a noise model that represents the probabilistic nature of $w(t)$.
- $u(t) \in \mathbb{R}^{q}$: An input of the system. It is also referred to as the “control input” and is assumed to be accurately known.
- $f(\cdot, t)$: A time-varying non-linear function that includes system parameters.
- $x(t)$ : At a given time, it is assumed to contain all the relevant information to describe the motion of the system.
Discrete-Time Model
The discrete-time model is a special case of the continuous-time model where measurements are sampled at discrete times and system inputs are kept constant within the sampling period. It is expressed as a difference equation as follows:
$x(k+1) = f(x(k), u(k), w(k), k)$ [2]
where
- $k$ : Time index.
- $x(k)$ : $x(kT)$, where $T$ is the sampling time.
This will be discussed later.
Measurement Model
The measurement model is a mathematical expression of the functional relationship between measurement values, which are data acquired as output values from various sensors to observe the motion of the system, and state variables and parameters.
Since the dynamics of the system can be explained by changes in the state variables over time, sensors must measure the state variables. However, since sensor measurements can be contaminated by noise or bias, sensors cannot measure the exact values as intended.
To solve this problem, the Kalman filter devises a mathematical tool to infer unmeasured data using contaminated measurement data. The measurement model assumes that measurements are collected at discrete times and is expressed as follows:
$z(k) = h(x(k),k) + v(k)$ [3]
where
- $z(k) \in \mathbb{R}^{p}$ : Measurements.
- $v(k) \in \mathbb{R}^{p}$ : Measurement noise. It is a variable for expressing the error inherent in the measurement as a probability.
- $h(x(k),k)$ : A non-linear function for expressing the functional relationship between state variables and outputs.
Finally, the measurement model is expressed as: