Least Squares with Dynamics
Problem statement
Consider a state-space model:
where at time \(k \in \mathbb{Z}^{+}\), we have:
- State vectors, \(\mathbf{x} \in \mathbb{R}^n\) and \(\mathbf{y}_j \in \mathbb{R}^k\) (here we included \(\mathbf{y}_j\) as the \(j\)'th landmark state since it can be a SLAM/VSLAM estimation problem. Generally, it can be just \(\mathbf{x}\) and the formulation wouldn't change), control input, \(\mathbf{u}\), and the \(j\)'th measurement, \(\mathbf{z}_j \in \mathbb{R}^m\).
- Discrete nonlinear motion and measurement models, \(\mathbf{f}( \ \cdot \ )\) and \(\mathbf{h}( \ \cdot \ )\)
- Zero-mean Gaussian process and measurement noises, \(\mathbf{w}_k \sim \mathcal{N}(\mathbf{0}, \mathbf{Q}_k)\) and \(\mathbf{v}_k \sim \mathcal{N}(\mathbf{0}, \mathbf{R}_{k, j})\).
For the measurement model:
since we assumed that the measurement noise is zero-mean Gaussian, i.e., \(\mathbf{v}_k \sim \mathcal{N}(\mathbf{0}, \mathbf{R}_{k, j})\), the conditional probability of the observation data is:
which is a Gaussian distribution. The probability densitiy function for multi-dimensional Gaussian distribution \(\mathbf{x} \sim \mathcal{N}(\boldsymbol{\mu}, \boldsymbol{\Sigma})\) is given as:
We can take the negative logarithm from both sides since the logarithm function is monotonically increasing and maximizing the original function is equivalent to minimizing the negative logarithm:
The first term can be ommitted since it doesn't have dependency on \(\mathbf{x}\). The MLE for the problem is then:
which is the Mahalanobis distance. If we assume that the inputs and the observations are independent of each other, the joint probability distribution can be factorized if we put all the measurements together:
The error between the model and the measurement can be defined as:
Then, minimizing the Mahalanobis distance between the estimated value and the measurements from sensors is equivalent to finding the MLE. The negative logarithm turns the product into a summation:
Example: Batch State Estimation
Consider a simple discrete-time system:
Suppose the initial state \(x_0\) is known. Denote the batch state variable as \(\mathbf{x}= \left[\begin{array}{cccc} x_0 & x_1 & x_2 & x_3 \end{array} \right]^T\), the batch observation as \(\mathbf{z}= \left[\begin{array}{ccc} z_1 & z_2 & z_3\end{array} \right]^T\), and the input as \(\mathbf{u} = \left[\begin{array}{ccc} u_1 & u_2 & u_3 \end{array} \right]^T\). The maximum likelihood estimate is then:
The motion model and the measurement equation are:
The error residuals are:
Finally, the objective function is: