Main Content


ARX model estimation using instrumental variable method with arbitrary instruments


sys = ivx(data,[na nb nk],x)
sys = ivx(data,[na nb nk],x,max_size)


sys = ivx(data,[na nb nk],x) estimates an ARX polynomial model, sys, using the instrumental variable method with arbitrary instruments. The model is estimated for the time series data data. [na nb nk] specifies the ARX structure orders of the A and B polynomials and the input to output delay, expressed in the number of samples.

An ARX model is represented as:


sys = ivx(data,[na nb nk],x,max_size) specifies the maximum size of matrices formed during estimation.

Input Arguments


Estimation data. The data can be:

  • Time- or frequency-domain input-output data

  • Time-series data

  • Frequency-response data

data must be an iddata, idfrd, or frd (Control System Toolbox) object.

When using frequency-domain data, the number of outputs must be 1.

[na nb nk]

ARX model orders.

For more details on the ARX model structure, see arx.


Instrument variable matrix.

x is a matrix containing the arbitrary instruments for use in the instrumental variable method.

x must be of the same size as the output data, data.y. For multi-experiment data, specify x as a cell array with one entry for each experiment.

The instruments used are analogous to the regression vector, with y replaced by x.


Maximum matrix size.

max_size specifies the maximum size of any matrix formed by the algorithm for estimation.

Specify max_size as a reasonably large positive integer.

Default: 250000

Output Arguments


ARX model that fits the estimation data, returned as a discrete-time idpoly object. This model is created using the specified model orders, delays, and estimation options. ivx does not return any estimated covariance information for sys.

Information about the estimation results and options used is stored in the Report property of the model. Report has the following fields:

Report FieldDescription

Summary of the model status, which indicates whether the model was created by construction or obtained by estimation.


Estimation command used.


Handling of initial conditions during model estimation, returned as one of the following values:

  • 'zero' — The initial conditions were set to zero.

  • 'estimate' — The initial conditions were treated as independent estimation parameters.

  • 'backcast' — The initial conditions were estimated using the best least squares fit.

This field is especially useful to view how the initial conditions were handled when the InitialCondition option in the estimation option set is 'auto'.


Quantitative assessment of the estimation, returned as a structure. See Loss Function and Model Quality Metrics for more information on these quality metrics. The structure has the following fields:


Normalized root mean squared error (NRMSE) measure of how well the response of the model fits the estimation data, expressed as the percentage fitpercent = 100(1-NRMSE).


Value of the loss function when the estimation completes.


Mean squared error (MSE) measure of how well the response of the model fits the estimation data.


Final prediction error for the model.


Raw Akaike Information Criteria (AIC) measure of model quality.


Small-sample-size corrected AIC.


Normalized AIC.


Bayesian Information Criteria (BIC).


Estimated values of model parameters.


Option set used for estimation. If no custom options were configured, this is a set of default options. See arxOptions for more information.


State of the random number stream at the start of estimation. Empty, [], if randomization was not used during estimation. For more information, see rng.


Attributes of the data used for estimation, returned as a structure with the following fields.


Name of the data set.


Data type.


Number of data samples.


Sample time.


Input intersample behavior, returned as one of the following values:

  • 'zoh' — Zero-order hold maintains a piecewise-constant input signal between samples.

  • 'foh' — First-order hold maintains a piecewise-linear input signal between samples.

  • 'bl' — Band-limited behavior specifies that the continuous-time input signal has zero power above the Nyquist frequency.


Offset removed from time-domain input data during estimation. For nonlinear models, it is [].


Offset removed from time-domain output data during estimation. For nonlinear models, it is [].

For more information on using Report, see Estimation Report.


  • Use iv4 first for IV estimation to identify ARX polynomial models where the instruments x are chosen automatically. Use ivx for nonstandard situations. For example, when there is feedback present in the data, or, when other instruments need to be tried. You can also use iv to automatically generate instruments from certain custom defined filters.


[1] Ljung, L. System Identification: Theory for the User, page 222, Upper Saddle River, NJ, Prentice-Hall PTR, 1999.

Version History

Introduced before R2006a

See Also

| | | | |