This is machine translation

Translated by Microsoft
Mouseover text to see original. Click the button below to return to the English verison of the page.

Note: This page has been translated by MathWorks. Please click here
To view all translated materals including this page, select Japan from the country navigator on the bottom of this page.


Compute loss functions for single-output ARX models


V = arxstruc(ze,zv,NN)
V = arxstruc(ze,zv,NN,maxsize)



Estimation data set can be iddata or idfrd object.


Validation data set can be iddata or idfrd object.


Matrix defines the number of different ARX-model structures. Each row of NN is of the form:

nn = [na nb nk]

Specifies the maximum number of elements in a segment when input-output data is split into segments.

If larger matrices are needed, the software will use loops for calculations. Use this option to manage the trade-off between memory management and program execution speed. The original data matrix must be smaller than the matrix specified by maxsize.

maxsize must be a positive integer.


    Note:   Use arxstruc for single-output systems only. arxstruc supports both single-input and multiple-input systems.

V = arxstruc(ze,zv,NN) returns V, which contains the loss functions in its first row. The remaining rows of V contain the transpose of NN, so that the orders and delays are given just below the corresponding loss functions. The last column of V contains the number of data points in ze.

V = arxstruc(ze,zv,NN,maxsize) uses the additional specification of the maximum data size.

with the same interpretation as described for arx. See struc for easy generation of typical NN matrices.

The output argument V is best analyzed using selstruc. The selection of a suitable model structure based on the information in v is normally done using selstruc.


collapse all

Create an ARX model for generating data.

A = [1 -1.5 0.7];
B = [0 1 0.5];
m0 = idpoly(A,B);

Generate random input and additive noise signals.

u = iddata([],idinput(400,'rbs'));
e = iddata([],0.1*randn(400,1));

Simulate the model output using the defined input and error signals.

y = sim(m0,[u e]);
z = [y,u];

Generate model-order combinations for estimation. Specify a delay of 1 for all models, and a model order range between 1 and 5 for na and nb.

NN = struc(1:5,1:5,1);

Estimate ARX models and compute the loss function for each model order combination. The input data is split into estimation and validation data sets.

V = arxstruc(z(1:200),z(201:400),NN);

Select the model order with the best fit to the validation data.

order = selstruc(V,0);

Estimate an ARX model of selected order.

M = arx(z,order);

Create estimation and validation data sets.

load co2data;
Ts = 0.5; % Sample time is 0.5 min
ze = iddata(Output_exp1,Input_exp1,Ts);
zv = iddata(Output_exp2,Input_exp2,Ts);

Generate model-order combinations for:

  • na = 2:4

  • nb = 2:5 for the first input, and 1 or 4 for the second input.

  • nk = 1:4 for the first input, and 0 for the second input.

NN = struc(2:4,2:5,[1 4],1:4,0);

Estimate an ARX model for each model order combination.

V = arxstruc(ze,zv,NN);

Select the model order with the best fit to the validation data.

order = selstruc(V,0);

Estimate an ARX model of selected order.

M = arx(ze,order);

More About

collapse all


Each of ze and zv is an iddata object containing output-input data. Frequency-domain data and idfrd objects are also supported. Models for each of the model structures defined by NN are estimated using the data set ze. The loss functions (normalized sum of squared prediction errors) are then computed for these models when applied to the validation data set zv. The data sets ze and zv need not be of equal size. They could, however, be the same sets, in which case the computation is faster.

See Also

| | | |

Introduced before R2006a

Was this topic helpful?