TL;DR
System identification is the work of building a mathematical model of a system from measurements. You apply an input, record the output, and fit the model's unknown numbers so that it reproduces what you recorded. The most common route is least squares, the same method used to fit a straight line through scattered points.
The model is only as good as the data. The input has to move enough to reveal how the system responds, and the fitted model has to predict data it has not seen.
Where you'll see it: in tuning a controller for a motor or a chemical plant when nobody has the physics equations, in flight-control software that estimates an aircraft's response from test flights, and in the learned dynamics models that robots use to plan their motion.
Intuition
Learning a machine from its behaviour
Suppose you are handed a closed box with a dial on the front and a needle on the back. You turn the dial and watch the needle. After enough turns you can predict where the needle will go for any setting of the dial, without opening the box. You have identified the system from its behaviour alone.
Engineers face this problem constantly. A motor has friction, inertia and electrical resistance, and the exact values are rarely on a datasheet. A furnace has heat leaks that depend on the building. Writing down the physics from first principles is slow and often inaccurate. Measuring the response and fitting a model is faster, and the fitted model is tied to the system as it actually behaves.
The method has three steps, and they repeat in a loop:
flowchart LR A[Apply a varying input] --> B[Record the output] B --> C[Fit the model's coefficients] C --> D[Check it on fresh data] D -->|good enough| E[Use the model] D -->|poor| A
The systems considered here are the kind described by a linear dynamical system: the next output is a fixed weighted combination of earlier values and inputs. The simplest useful model describes the next output as a weighted sum of recent outputs and recent inputs. The weights are the unknown numbers. Once they are found, the model can predict and, for control design, can be inverted to ask what input will produce a wanted output.
The math
A first-order input-output model
Let be the output at time step , the input, and an unexplained error or noise term. Consider the model
Here and are the unknown numbers we want to find. The output depends on its own previous value, scaled by , and on the previous input, scaled by . A model that has this form, with an output that depends on its own past and on an outside input, is called an ARX model. Its name says what it is: autoregressive, with an exogenous input. The "autoregressive" part is the same idea as in an autoregressive model of a sequence, and adding an outside input to a model of this kind is what separates ARX from the plain ARMA model. The "exogenous" part is the input we control.
The equation is linear in and , and that is what makes identification easy. If we set aside for a moment, we want to be close to for every recorded step.
Writing it as a regression
Collect the known past values into a vector for each time step, , and the unknown numbers into . The model becomes
This is exactly the setup of linear regression, with the regressors built from past data rather than supplied separately. We choose to minimise the sum of squared errors over all recorded steps:
Stack the regressors into a matrix with one row per time step, and stack the outputs into a vector . The minimiser satisfies the normal equations
and when is invertible, . The hat on marks it as an estimate computed from data.
Why squared errors? If the error follows a Gaussian distribution with the same variance at every step, then the maximum likelihood estimate of is the one that minimises . Taking the logarithm of the Gaussian likelihood turns the product over steps into a sum, and the only part that depends on is the sum of squared errors. Least squares is therefore the right answer under a standard noise assumption, not just a convenient one.
Persistent excitation
The input has to vary, and this is the most common way identification fails. Look at the second column of : it contains the past inputs . If the input is zero at every step, that column is all zeros. Then , the matrix has a zero row and a zero column, and it cannot be inverted. The data contain no information about at all.
A signal that keeps changing, such as one that switches between two levels at random times, keeps the matrix invertible and reveals how the system responds at many operating points. Engineers call this requirement persistent excitation.
Worked examples
Take the true system , , with and inputs , , , . There is no noise, so the data are exact.
- Compute the outputs: .
- .
- .
- .
- Build the rows for : , , and , with targets .
- Compute the entries of . The sum of is . The sum of is . The sum of is . So .
- Compute . The sum of is . The sum of is .
- Solve. The determinant is , so and .
Interpretation: with exact data, least squares recovers the true numbers exactly. Real data will not be this clean, but the procedure is identical.
Now suppose the measured outputs are off by small errors. The recorded values are , , and , with known exactly. The inputs are unchanged.
- The regressors are now , , and , with targets , , and .
- The sum of is . The sum of is . The sum of is .
- The sum of is . The sum of is .
- The determinant is . So and .
- Compare with the truth, and .
Interpretation: the estimate of is close, but has dropped to about . The noise sits in the regressor as well as in the target, which pulls the estimate of toward zero. One small dataset cannot prove a bias, but shrinkage toward zero is the known tendency, a weakness of plain least squares when the regressors are themselves noisy, and it is the reason more careful methods exist.
Consider a heated tank sampled every s. Suppose the true model has and . These values are chosen for the calculation, not measured from a real tank.
- The steady-state gain is . A sustained input of 1 settles the output at 0.8.
- The time constant, the time for the response to cover about 63 percent of its change, is s.
- To identify it in practice, drive the heater with a signal that switches randomly between two levels, so the input keeps moving. Record the input and output for several minutes.
- Fit the ARX model on the first 70 percent of the record. Then predict the last 30 percent one step at a time, using the measured past, and compute the mean squared error. Small error on the unseen part is the evidence that the model is usable.
- If the fitted and reproduce the steady gain and time constant above, the model matches the system's behaviour at this operating point.
Interpretation: the identified numbers become design inputs. A time constant near 2 seconds tells the controller how quickly it can act, and a gain of 0.8 tells it how strongly the heater changes the temperature.
Tradeoffs and failure modes
| Situation | What goes wrong | Better choice |
|---|---|---|
| The input is constant, or nearly so | Some coefficients cannot be separated from the data | Use a persistently exciting input that keeps changing |
| Measurement noise enters the regressors | Estimates are biased, typically toward zero | Use a method that models the noise, or [[instrumental-variables |
| Too many coefficients for the data | The model fits the recording perfectly and predicts poorly, the classic Overfitting | Use fewer coefficients and check on held-out data |
| The system is strongly nonlinear | A linear model fits only near the operating point | Identify several local models, or use a [[nonlinear-dynamical-system |
The main tradeoff is between model simplicity and accuracy. A low-order model is easy to fit and easy to control with, but it may miss fast dynamics. A high-order model can match the data more closely while predicting worse. Validation on fresh data is the only reliable way to choose between them.
History
Least squares was introduced by Gauss and Legendre in the early 1800s, and Gauss used it to predict the orbit of the asteroid Ceres from a few observations. The idea of fitting a dynamic model to recorded inputs and outputs grew in control engineering through the 1950s and 1960s. In the early 1970s, Karl Åström and Peter Eykhoff surveyed the field in a widely read review. Lennart Ljung's later work on prediction error methods put the theory on a firm statistical footing, and it is now a standard part of control practice. Estimation with a Kalman filter, which tracks an unknown state as data arrive, grew out of the same period.
Recap
A system can be identified from recorded behaviour by choosing a model with unknown coefficients, writing its prediction as a regression on past inputs and outputs, and fitting the coefficients by least squares. The fit is the maximum likelihood estimate under Gaussian noise. The input must keep changing for the coefficients to be identifiable, and the model must be checked on data it did not see. Where the regression assumes too little about the noise, the estimates drift. The same idea extends to state-space models, which are the subject of the Kalman filter, and to model predictive control, which uses an identified model to plan inputs ahead of time.
Check yourself
QuestionRecall: in the model , what is the role of , and why is it called exogenous?Show answer
is the input from the previous step. It is called exogenous because it comes from outside the system, set by the experimenter or the controller, rather than being generated by the system's own past outputs.
QuestionComputation: with , , and , what is ? Then, if , what is ?Show answer
. Then .
QuestionWhy: if the input is zero at every step, why can the coefficient not be estimated from the data?Show answer
Every regressor in the second column of is . The matrix then has a zero row and column, so it cannot be inverted. The data contain no evidence of how the input affects the output, so every value of fits equally well.
QuestionApplied: you identify a process and get a model that fits the training recording almost perfectly, but predicts badly on a new recording. What did you probably do wrong, and what would you change?Show answer
The model probably has too many coefficients and has fitted the noise in the training data, which is overfitting. Use a lower-order model, and choose the order by checking prediction error on data that were not used to fit it.