| Products & Services | Solutions | Academia | Support | User Community | Company |
| Download Product Updates | | | Get Pricing | | | Trial Software |
| Documentation → System Identification Toolbox |
| Contents | Index |
| Learn more about System Identification Toolbox |
| On this page… |
|---|
Commands for Estimating the Model Order |
Model order is one or more integers that define the complexity of the model. In general, model order is related to the number of poles, the number of zeros, and the response delay (time in terms of the number of samples before the output responds to the input). The specific meaning of model order depends on the model structure.
To compute parametric black-box models, you must provide the model order as an input. If you do not know the order of your system, you can estimate it.
After completing the steps in this section, you get the following results:
For the first input/output combination: na=2, nb=2, and the delay nk=5.
For the second input/output combination: na=1, nb=1, and the delay nk=10.
Later, you explore different model structures by specifying model-order values that are slight variations around these initial estimate.
In this portion of the tutorial, you use struc, arxstruc, and selstruc to estimate and compare simple polynomial (ARX) models for a range of model orders and delays, and select the best orders based on the quality of the model.
The following list describes the results of using each command:
struc creates a matrix of model-order combinations for a specified range of na, nb, and nk values.
arxstruc takes the output from struc, systematically estimates an ARX model for each model order, and compares the model output to the measured output. arxstruc returns the loss function for each model, which is the normalized sum of squared prediction errors.
selstruc takes the output from arxstruc and opens the ARX Model Structure Selection window, which resembles the following figure, to help you choose the model order.

You use the preceding plot to select the best-fit model. The horizontal axis is the total number of parameters:
![]()
For the ARX model, na is the number of poles, nb is the number of b parameters (equal to the number of zeros plus 1), and nk is the delay.
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 this tutorial, there are two inputs to the system and one output and you estimate model orders for each input/output combination independently. You can either estimate the delays from the two inputs simultaneously or one input at a time.
It makes sense to try the following order combinations for the first input/output combination:
na=2:5
nb=1:5
nk=5
This is because the nonparametric models you estimated in Estimating Step- and Frequency-Response Models show that the response for the first input/output combination might have a second-order response. Similarly, in Estimating Delays in the Multiple-Input System, the delay for this input/output combination was estimated to be 5.
To estimate model order for the first input/output combination:
Use struc to create a matrix of possible model orders.
NN1 = struc(2:5,1:5,5);
Use selstruc to compute the loss functions for the ARX models with the orders in NN1.
selstruc(arxstruc(ze(:,:,1),zv(:,:,1),NN1))
This command opens the interactive ARX Model Structure Selection window.

Note The Rissanen MDL and Akaike AIC criteria produces equivalent results and are both indicated by a blue rectangle on the plot. |
The red rectangle represents the best overall fit, which occurs for na=2, nb=3, and nk=5. The height difference between the red and blue rectangles is insignificant. Therefore, you can choose the parameter combination that corresponds to the lowest model order and the simplest model.
Click the blue rectangle, and then click Select to choose that combination of orders:
na=2
nb=2
nk=5
To continue, press any key while in the MATLAB Command Window.
It makes sense to try the following order combinations for the second input/output combination:
na=1:3
nb=1:3
nk=10
This is because the nonparametric models you estimated in Estimating Step- and Frequency-Response Models show that the response for the second input/output combination might have a first-order response. Similarly, in Estimating Delays in the Multiple-Input System, the delay for this input/output combination was estimated to be 10.
To estimate model order for the second input/output combination:
Use struc to create a matrix of possible model orders.
NN2 = struc(1:3,1:3,10);
Use selstruc to compute the loss functions for the ARX models with the orders in NN2.
selstruc(arxstruc(ze(:,:,2),zv(:,:,2),NN2))
This command opens the interactive ARX Model Structure Selection window.

Note The Akaike AIC and the overall best fit criteria produces equivalent results. Both are indicated by the same red rectangle on the plot. |
The height difference between all of the rectangles is insignificant and all of these model orders result in similar model performance. Therefore, you can choose the parameter combination that corresponds to the lowest model order and the simplest model.
Click the yellow rectangle on the far left, and then click Select to choose the lowest order: na=1, nb=1, and nk=10.
To continue, press any key while in the MATLAB Command Window.
![]() | Estimating Delays in the Multiple-Input System | Estimating Continuous-Time Transfer Functions (Process Models) | ![]() |

Includes the most popular MATLAB recorded presentations with Q&A sessions led by MATLAB experts.
| © 1984-2009- The MathWorks, Inc. - Site Help - Patents - Trademarks - Privacy Policy - Preventing Piracy - RSS |