Parameter Estimation

State estimation is an integral part of many parameter-estimation methods. Below, we will illustrate several different methods of performing parameter estimation. We can roughly divide the methods into three families:

  1. Methods that optimize the likelihood or the prediction errors of a state estimator with respect to the model parameters.
  2. Methods that add the parameters to be estimated as state variables in the model and estimate them using standard state estimation.
  3. Methods that draw samples from the posterior distribution of the parameters, using the likelihood computed by a state estimator.

From the first family, we provide functionality for maximum-likelihood and MAP estimation in Maximum-likelihood and MAP estimation, for estimation of the noise covariance matrices in Estimating noise covariances, and for prediction-error minimization in Using an optimizer, Joint estimation of plant parameters and noise covariances and Multi-step prediction-error estimation. An example of the second family, joint state and parameter estimation, is provided in Joint state and parameter estimation, and the third family is covered in Bayesian inference.

Which method should I use?

The following questions, considered in order, indicate which method to use for a particular problem.

  1. Is a linear black-box model sufficient, or are the data given in the frequency domain? In this case, the methods of ControlSystemIdentification.jl, such as subspaceid and newpem, are often the most efficient. An identified model can be converted to a KalmanFilter by KalmanFilter(model, x0), the noise covariance matrices of which may subsequently be refined using autotune_covariances.
  2. Is the model a ModelingToolkit model? LowLevelParticleFiltersMTK.jl constructs state estimators from ModelingToolkit models, and provides functionality for setting a subset of the model parameters from a parameter vector, which is required for the methods on these pages.
  3. What is unknown?
  4. What is the model used for? The criterion should reflect the intended use of the model. For filtering and anomaly detection, the likelihood is the appropriate criterion. For short-horizon prediction, one-step prediction errors are appropriate. For models used for prediction over a longer horizon, such as the prediction model of an MPC controller, or for systems with slow dynamics relative to the sample interval, multi-step prediction errors are appropriate, see Multi-step prediction-error estimation. For open-loop simulation of a stable system, a simulation-error criterion is appropriate, which is obtained as a limiting case of the prediction-error criteria, see the section on filtering, prediction and simulation below.
  5. Are there missing samples, outliers or multiple experiments? See Missing data and outliers and the section on multiple experiments in Joint estimation of plant parameters and noise covariances.
  6. Are the parameters identifiable from the data? See Identifiability. This should be investigated before the estimates are interpreted.

The methods demonstrated in this section have the following properties:

MethodPlant parametersNoise covariancesTime-varying parametersOnline estimationUncertainty estimate
Maximum likelihood and MAP🟢🟢🟥🟥Hessian of the negative log-likelihood
One-step prediction-error minimization🟢🟥🟥🟥Gauss-Newton approximation
Multi-step prediction-error minimization🟢🟥🟥🟥not provided
Joint state and parameter estimation🔶🟥🟢🟢Covariance of the augmented state
Bayesian inference🟢🟢🟥🟥Samples from the posterior

When trying to optimize parameters of the noise distributions, most commonly the covariance matrices, maximum likelihood (or MAP) is the recommended method, since prediction-error criteria do not penalize overconfident or underconfident covariance estimates. When parameters are time varying or an online estimate is required, joint state and parameter estimation is the applicable method. When fitting time-invariant plant parameters, all methods are applicable. In this case joint state and parameter estimation tends to be inefficient and unnecessarily complex, and it is recommended to opt for maximum likelihood or prediction-error minimization. Prediction-error minimization (PEM) with a Gauss-Newton optimizer is often the most efficient method for this type of problem.

Maximum-likelihood estimation tends to yield an estimator with better estimates of the posterior covariance since this is explicitly optimized for, while PEM tends to produce the smallest possible prediction errors.

Filtering, prediction and simulation

A model estimated by minimizing one-step prediction errors of a state estimator is optimized for filtering and short-horizon prediction. The measurements correct the state estimate in every time step, and model errors may thus be compensated for by the state estimator. Two quantities determine where between one-step prediction and open-loop simulation the criterion is located:

  • The dynamics noise covariance $R_1$: as $R_1 \rightarrow 0$, the Kalman gain tends to zero after an initial transient, and the one-step prediction errors tend to the errors of an open-loop simulation from the estimated initial state.
  • The prediction horizon $h$ of a multi-step prediction-error criterion: as $h$ increases, the predictions are made over a longer horizon without correction, and the criterion tends to a simulation-error criterion.

A simulation-error criterion is appropriate only if the system is stable and not subject to significant unmeasured disturbances. For unstable systems, and for systems with unmeasured disturbances, prediction-error criteria remain applicable since the state estimator stabilizes the predictor. See Multi-step prediction-error estimation for a demonstration.

Pages in this section

Videos

Examples of parameter estimation are available here.

By using an optimizer to optimize the likelihood of an UnscentedKalmanFilter:

Estimation of time-varying parameters:

Adaptive control by means of estimation of time-varying parameters: