Sequential Quadratic Programming for Maximum Likelihood Estimation of parameters in Linear Time Variant systems.
This repository contains code assiociated with the article "An Efficient Method for the Joint Estimation of System Parameters and Noise Covariances for Linear Time-Variant Systems"
Python packages
- numpy
- scipy
- matplotlib
- casadi
- cvxopt
We assume that the data is generated through the following dynamical system (linear, and with Gaussian Noise)
where
Note that also the time-varying behavior comes from the inputs
Finally, the matrix
Also, the paremeters are assumed to be in some set defined with inequality constraints:
(Note that the inequality is opposite sign of how it is in the paper).
We consider optimization problems for estimation of
Regarding the cost function
The first of them is reffered as "MLE" because it corresponds to the Maximum-Likelihood problem, while the second is called "PredErr" because it corresponds to the Prediction Error Methods.
One option is simply to call the solver IPOPT to solve the optimization problem (3) in this lifted form
We propose a taylored SQP method.
It is composed by several steps:
-
Propagate the state and covariances according to the Kalman filter equations to get
$e_k$ and$S_k$ . -
Computing the derivatives
$\frac{\partial e_k}{\partial \alpha}$ $\frac{\partial e_k}{\partial \beta}$ $\frac{\partial S_k}{\partial \alpha}$ $\frac{\partial S_k}{\partial \beta}$ .This is done through "hand-made" forward AD.
-
Computing gradient and Hessian approximation.
The gradient is always computed exactly. For the Hessian, we make some approximation. Regarding the "PredErr" method, we use Gauss-Newton Hessian approximation. Regarding "MLE" method, we make a similar one, which falls into the framework of Generalized Gauss-Netwon Hessian approximation after omitting the second-derivative of the term
$\log \det S$ (indeed, this term is concave in$S$ , while the other term is convex in$\left( e, S \right)$ ). -
Globalization via line-search.
Perform line-search in the direction found by backtracking until the Armijo condition is reached.
See the tutorial example in notebooks/minimal_example.py