Categories &

Functions List

Function Reference: arx

Function File: [sys, x0] = arx (dat, n, …)
Function File: [sys, x0] = arx (dat, n, opt, …)
Function File: [sys, x0] = arx (dat, opt, …)
Function File: [sys, x0] = arx (dat, ’na’, na, ’nb’, nb)

Estimate ARX model using QR factorization. $$ A(q) \, y(t) = B(q) \, u(t) \, + \, e(t) $$

Inputs

dat
iddata identification dataset containing the measurements, i.e. time-domain signals.
n
The desired order of the resulting model sys.
…
Optional pairs of keys and values. 'key1', value1, 'key2', value2.
opt
Optional struct with keys as field names. Struct opt can be created directly or by function options. opt.key1 = value1, opt.key2 = value2.

Outputs

sys
Discrete-time transfer function model. If the second output argument x0 is returned, sys becomes a state-space model.
x0
Initial state vector. If dat is a multi-experiment dataset, x0 becomes a cell vector containing an initial state vector for each experiment.

Option Keys and Values

’na’
Order of the polynomial A(q) and number of poles.
’nb’
Order of the polynomial B(q)+1 and number of zeros+1. nb <= na.
’nk’
Input-output delay specified as number of sampling instants. Scalar positive integer. This corresponds to a call to function nkshift, followed by padding the B polynomial with nk leading zeros.

Algorithm
Uses the formulae given in [1] on pages 318-319, ’Solving for the LS Estimate by QR Factorization’. Uses SLICOT IB01CD for initial conditions, Copyright (c) 1996-2025, SLICOT, available under the BSD 3-Clause (License and Disclaimer).

References

  1. Ljung, L. (1999) System Identification: Theory for the User: Second Edition. Prentice Hall, New Jersey, USA.

Source Code: arx

 T = 1;
 N = 30;
 G = tf ([1  2 ], [1 -1 1 -0.5], T);
 u = 2*rand(N,1) - 1;
 e = 0.01*randn (N,1);
 y = lsim (G, u) + e;
 dat = iddata (y, u, T);
 G_I = arx (dat, 3);  # filter form (poly in z^(-1), inputs u and e)
 G_I = G_I(1,1);
 close (clf());
 lsim (G, G_I, u);
 title ("Simulation of original G and indentified system G_I")
plotted figure