Accelerating the pace of engineering and science

# idarx

Multiple-output ARX polynomials, impulse response, or step response model

 Note:   idarx will be removed in a future release. Use idpoly instead.To convert an existing idarx model, sys_idarx, to an idpoly model, use idpoly(sys_idarx).

## Syntax

m = idarx(A,B,Ts)
m = idarx(A,B,Ts,'Property1',Value1,...,,'PropertyN',ValueN)

## Description

m = idarx(A,B,Ts)

m = idarx(A,B,Ts,'Property1',Value1,...,,'PropertyN',ValueN)

idarx creates an object containing parameters that describe the general multiple-input, multiple-output model structure of ARX type.

$\begin{array}{l}y\left(t\right)+{A}_{1}y\left(t-1\right)+{A}_{2}y\left(t-2\right)+...+{A}_{na}y\left(t-na\right)=\\ {B}_{0}u\left(t\right)+{B}_{1}u\left(t-1\right)+...+{B}_{nb}u\left(t-nb\right)+e\left(t\right)\end{array}$

Here Ak and Bk are matrices of dimensions ny-by-ny and ny-by-nu, respectively. (ny is the number of outputs, that is, the dimension of the vector y(t), and nu is the number of inputs.)

The arguments A and B are 3-D arrays that contain the A matrices and the B matrices of the model in the following way.

A is an ny-by-ny-by-(na+1) array such that:

```A(:,:,k+1) = Ak
A(:,:,1) = eye(ny)
```

Similarly B is an ny-by-nu-by-(nb+1) array with:

```B(:,:,k+1) = Bk
```

Note that A always starts with the identity matrix, and that delays in the model are defined by setting the corresponding leading entries in B to zero. For a multivariate time series, take B = [].

The optional property NoiseVariance sets the covariance matrix of the driving noise source e(t) in the model above. The default value is the identity matrix.

The argument Ts is the sampling interval. Note that continuous-time models (Ts = 0) are not supported.

The use of idarx is twofold. You can use it to create models that are simulated (using sim) or analyzed (using bode, pzmap, etc.). You can also use it to define initial value models that are further adjusted to data (using arx). The free parameters in the structure are consistent with the structure of A and B; that is, leading zeros in the rows of B are regarded as fixed delays, and trailing zeros in A and B are regarded as a definition of lower-order polynomials. These zeros are fixed, while all other parameters are free.

For a model with one output, ARX models can be described both as idarx and idpoly models. The internal representation is different, however.

## idarx Properties

• A, B: The A and B polynomials as 3-D arrays, described above.

• dA, dB: The standard deviations of A and B. Same format as A and B. Cannot be set.

• na, nb, nk: The orders and delays of the model. na is an ny-by-ny matrix whose i-j entry is the order of the polynomial corresponding to the i-j entry of A. Similarly nb is an ny-by-nu matrix with the orders of B. nk is also an ny-by-nu matrix, whose i-j entry is the delay from input j to output i, that is, the number of leading zeros in the i-j entry of B.

• InitialState: This describes how the initial state (initial values in filtering, etc.) should be handled. For time-domain applications, this is typically handled by starting the filtering when all data are available. For frequency-domain data, you must estimate initial states. The possible values of InitialState are 'zero', 'estimate', and 'auto' (which makes a data-dependent choice between zero and estimate).

You can set and retrieve all properties either with the set and get commands or by subscripts. Autofill applies to all properties and values, and they are case insensitive.

For a complete list of property values, use get(m). To see possible value assignments, use set(m). See also idprops idarx.

## idarx Definition of States

The states of an idarx model are defined as those corresponding to the model obtained by converting them to the state-space format using the idss command. For example, if you have an idarx model defined by m1 = idarx(A,B,1), then the initial states of this model correspond to those of m2 = idss(m1). The concept of states is useful for functions such as sim, predict, compare and findstates.

## Examples

Simulate a second-order ARX model with one input and two outputs, and then estimate a model using the simulated data.

```A = zeros(2,2,3);
B = zeros(2,1,3)
A(:,:,1) =eye(2);
A(:,:,2) = [-1.5 0.1;-0.2 1.5];
A(:,:,3) = [0.7 -0.3;0.1 0.7];
B(:,:,2) = [1;-1];
B(:,:,3) = [0.5;1.2];
m0 = idarx(A,B,1);
u = iddata([],idinput(300));
e = iddata([],randn(300,2));
y = sim(m0,[u e]);
m = arx([y u],[[2 2;2 2],[2;2],[1;1]]);
```