| Contents | Index |
| On this page… |
|---|
Strategy for Estimating Accurate Models Estimating Possible Model Orders Identifying State-Space Models |
The linear models you estimated in Estimating Linear Models Using Quick Start showed that a linear model sufficiently represents the dynamics of the system.
In this portion of the tutorial, you get accurate parametric models by performing the following tasks:
Identifying initial model orders and delays from your data using a simple, polynomial model structure (ARX).
Exploring more complex model structures with orders and delays close to the initial values you found.
The resulting models are discrete-time models.
Tip You can convert a linear discrete-time model to a continuous-time model using the d2c command. For more information, see the corresponding reference page. |
To identify black-box models, you must specify the model order. However, how can you tell what model orders to specify for your black-box models? To answer this question, you can estimate simple polynomial (ARX) models for a range of orders and delays and compare the performance of these models. You choose the orders and delays that correspond to the best model fit as an initial guess for more accurate modeling.
For a single-input/single-output system (SISO), the ARX model structure is:
![]()
y(t) represents the output at time t, u(t) represents the input at time t, na is the number of poles, nb is the number of zeros plus 1, nk is the input delay—the number of samples before the input affects the system output (called delay or dead time of the model), and e(t) is the white-noise disturbance.
You specify the model orders na, nb,
and nk to estimate ARX
models. The System Identification Toolbox product estimates the
parameters
and
from the data.
In the System Identification Tool GUI, select Estimate > Linear parametric models to open the Linear Parametric Models dialog box.
The ARX model is already selected in the Structure list.
Edit the Orders field to try all combinations of poles, zeros, and delays, where each value is from 1 to 10:
[1:10 1:10 1:10]

Click Estimate to open the ARX Model Structure Selection window, which displays the model performance for each combination of model parameters.

You use this plot to select the best-fit model. The horizontal axis is the total number of parameters:
![]()
The vertical axis, called Unexplained output variance (in %), is the portion of the output not explained by the model—the ARX model prediction error for the number of parameters shown on the horizontal axis. The prediction error is the sum of the squares of the differences between the validation data output and the model one-step-ahead predicted output.
Three rectangles are highlighted on the plot in green, blue, and red. Each color indicates a type of best-fit criterion, as follows:
Red — Best fit minimizes the sum of the squares of the difference between the validation data output and the model output. This rectangle indicates the overall best fit.
Green — Best fit minimizes Rissanen MDL criterion.
Blue — Best fit minimizes Akaike AIC criterion.
In this tutorial, the Unexplained output variance (in %) value remains approximately constant for the combined number of parameters from 4 to 20. Such constancy indicates that model performance does not improve at higher orders. Thus, low-order models might fit the data equally well.
Note When you use the same data set for estimation and validation, use the MDL and AIC criteria to select model orders. These criteria compensate for overfitting that results from using too many parameters. For more information about these criteria, see the selstruc reference page. |
In the ARX Model Structure Selection window, click the red bar (corresponding to 15 on the horizontal axis), and click Insert. This selection inserts na=6, nb=9, and nk=2 into the Linear Parametric Models dialog box and performs the estimation.
This action adds the model arx692 to the System Identification Tool GUI and updates the plots to include the response of the model.
In the ARX Model Structure Selection window, click the third bar corresponding to 4 parameters on the horizontal axis (the lowest order that still gives a good fit), and click Insert.
This selection inserts na=2, nb=2, and nk=3 (a delay of three samples) into the Linear Parametric Models dialog box and performs the estimation.
The model arx223 is added to the System Identification Tool GUI and the plots are updated to include its response and output.
Click Close to close the ARX Model Structure Selection window.
By estimating ARX models for different order combinations, as described in Estimating Possible Model Orders, you identified the number of poles, zeros, and delays that provide a good starting point for systematically exploring different models.
The overall best fit for this system corresponds to a model with six poles, nine zeros, and a delay of two samples. It also showed that a low-order model with na=2 (two poles), nb=2 (one zero), and nk=3 (input-output delay) also provides a good fit. Thus, you should explore model orders close to these values.
In this portion of the tutorial, you estimate a state-space model.
The general state-space model structure (innovation form) is:
![]()
y(t) represents the output at time t, u(t) represents the input at time t, x(t) is the state vector at time t, and e(t) is the white-noise disturbance.
You must specify a single integer as the model order (dimension of the state vector) to estimate a state-space model. By default, the delay equals 1. The System Identification Toolbox product estimates the state-space matrices A, B, C, D, and K from the data.
The state-space model structure is a good choice for quick estimation because it requires that you specify only two parameters to get started: n is the number of poles (the size of the A matrix) and nk is the delay.
In the System Identification Tool GUI, select Estimate > Linear parametric models to open the Linear Parametric Models dialog box.
From the Structure list, select State Space: n [nk].
In the Orders field, type 6 to create a sixth-order state-space model.
This choice is based on the fact that the best-fit ARX model has six poles.
Click Estimate to add a state-space model called n4s6 to the System Identification Tool GUI.
To learn more about identifying state-space models, see the corresponding topic in the System Identification Toolbox User's Guide.
By estimating ARX models for different order combinations, as described in Estimating Possible Model Orders, you identified the number of poles, zeros, and delays that provide a good starting point for systematically exploring different models.
The overall best fit for this system corresponds to a model with six poles, nine zeros, and a delay of two samples. It also showed that a low-order model with na=2 (two poles), nb=2 (one zero), and nk=3 also provides a good fit. Thus, you should explore model orders close to these values.
In this portion of the tutorial, you estimate an ARMAX input-output polynomial model.
For a single-input/single-output system (SISO), the ARMAX polynomial model structure is:

y(t) represents the output at time t, u(t) represents the input at time t, na is the number of poles for the dynamic model, nb is the number of zeros plus 1, nc is the number of poles for the disturbance model, nk is the number of samples before the input affects output of the system (called the delay or dead time of the model), and e(t) is the white-noise disturbance.
Note The ARMAX model is more flexible than the ARX model because the ARMAX structure contains an extra polynomial to model the additive disturbance. |
You must specify the model orders to estimate ARMAX models.
The System Identification Toolbox product estimates the model parameters
,
, and
from the data.
In the System Identification Tool GUI, select Estimate > Linear parametric models to open the Linear Parametric Models dialog box.
From the Structure list, select ARMAX: [na nb nc nk] to estimate an ARMAX model.
In the Orders field, set the orders na, nb, nc, and nk to the following values:
2 2 2 2
The model name in the Name field is amx2222, by default.
Click Estimate to add the ARMAX model to the System Identification Tool GUI.
Repeat steps 3 and 4 using higher Orders 3 3 2 2. These orders result in a model that fits the data almost as well as the higher order ARX model arx692.

To learn more about identifying input-output polynomial models, such as ARMAX, see the corresponding topic in the System Identification Toolbox User's Guide.
You can compare models to choose the model with the best performance.
You must have already estimated the models, as described in Estimating Accurate Linear Models.
If you have not performed this step, click here to complete it.
The following figure shows the System Identification Tool GUI, which includes all of the estimated models in Estimating Accurate Linear Models.

If you closed the Model Output plot, you can regenerate it by selecting the Model output check box in the System Identification Tool GUI. If the model does not appear on the plot, click the model icon in the System Identification Tool GUI to display it on plots.
Examine the model-output plot to see how well the model output matches the measured output in the validation data set. A good model is the simplest model that best describes the dynamics and successfully simulates or predicts the output for different inputs.
Models are listed by name in the Best Fits area of the Model Output plot. The highest-order model you created, arx692, fits the data as well as the simpler model amx3322.

Tip To validate your models using a different data set, you can drag and drop this data set into the Validation Data rectangle in the System Identification Tool GUI. If you transform validation data into the frequency domain, the model-output plot updates to show the model comparison in the frequency domain. |
To get a closer look at how well these models fit the data, magnify a portion of the plot by clicking and dragging a rectangle around the region of interest, as shown in the following figure.

Releasing the mouse magnifies this region and shows that the output of all models matches the validation data well.

![]() | Estimating Linear Models Using Quick Start | Viewing Model Parameters | ![]() |

Learn more about resources for designing, testing, and implementing control systems.
Get free kit| © 1984-2012- The MathWorks, Inc. - Site Help - Patents - Trademarks - Privacy Policy - Preventing Piracy - RSS |