Documentation

## What are Nonlinear ARX Models?

Nonlinear ARX models extend the linear ARX models to the nonlinear case. The structure of these models enables you to model complex nonlinear behavior using flexible nonlinear functions, such as wavelet and sigmoid networks. For information about when to fit nonlinear models, see About Identified Nonlinear Models.

### Nonlinear ARX Model Extends the Linear ARX Structure

A linear SISO ARX model has the following structure:

`$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}_{1}u\left(t\right)+{b}_{2}u\left(t-1\right)+...+{b}_{nb}u\left(t-nb+1\right)+e\left(t\right)$`

Where, u,y, and e are the input, output, and noise. This structure implies that the current output y(t) is predicted as a weighted sum of past output values and current and past input values. na is the number of past output terms, and nb is the number of past input terms used to predict the current output. The input delay nk is set to zero to simplify the notation. Rewriting the equation as a product gives:

`${y}_{p}\left(t\right)=\left[-{a}_{1},-{a}_{2},...,-{a}_{na},{b}_{1},{b}_{2},..,{b}_{nb}\right]\ast {\left[y\left(t-1\right),y\left(t-2\right),...,y\left(t-na\right),u\left(t\right),u\left(t-1\right),...,u\left(t-nb-1\right)\right]}^{T}$`

where $y\left(t-1\right),y\left(t-2\right),...,y\left(t-na\right),u\left(t\right),u\left(t-1\right),...,u\left(t-nb-1\right)$ are delayed input and output variables, called regressors. The coefficients vector [–a1, ... ,bnb] represents the weighting applied to these regressors. The linear ARX model thus predicts the current output yp as a weighted sum of its regressors.

The structure of a nonlinear ARX model allows the following additional flexibility:

• Instead of the weighted sum of the regressors that represents a linear mapping, the nonlinear ARX model has a more flexible nonlinear mapping function, F.

`${y}_{p}\left(t\right)=F\left(y\left(t-1\right),y\left(t-2\right),y\left(t-3\right),...,u\left(t\right),u\left(t-1\right),u\left(t-2\right),..\right)$`

Inputs to F are model regressors. When you specify the nonlinear ARX model structure, you can choose one of several available nonlinear functions. For example, F can represent a weighted sum of wavelets that operate on the distance of the regressors from their means. For more information, see Available Nonlinearity Estimators for Nonlinear ARX Models.

• Nonlinear ARX regressors can be both delayed input-output variables and more complex, nonlinear expressions of delayed input and output variables. Examples of such nonlinear regressors are y(t-1)2, u(t-1)*y(t-2), abs(u(t-1)), and max(u(t-1)*y(t-3),-10).

### Structure of Nonlinear ARX Models

A nonlinear ARX model consists of model regressors and a nonlinearity estimator. The nonlinearity estimator comprises both linear and nonlinear functions that act on the model regressors to give the model output. This block diagram represents the structure of a nonlinear ARX model in a simulation scenario.

The software computes the nonlinear ARX model output y in two stages:

1. It computes regressor values from the current and past input values and past output data.

In the simplest case, regressors are delayed inputs and outputs, such as u(t-1) and y(t-3). These kind of regressors are called standard regressors. You specify the standard regressors using the model orders and delay. For more information, see Nonlinear ARX Model Orders and Delay. You can also specify custom regressors, which are nonlinear functions of delayed inputs and outputs. For example, u(t-1)*y(t-3). To create a set of polynomial type regressors, use `polyreg`.

By default, all regressors are inputs to both the linear and the nonlinear function blocks of the nonlinearity estimator. You can choose a subset of regressors as inputs to the nonlinear function block.

2. It maps the regressors to the model output using the nonlinearity estimator block. The nonlinearity estimator block can include linear and nonlinear blocks in parallel. For example:

`$F\left(x\right)={L}^{T}\left(x-r\right)+d+g\left(Q\left(x-r\right)\right)$`

Here, x is a vector of the regressors, and r is the mean of the regressors x. ${L}^{T}\left(x\right)+d$ is the output of the linear function block and is affine when d ≠ 0. d is a scalar offset. $g\left(Q\left(x-r\right)\right)$ represents the output of the nonlinear function block. Q is a projection matrix that makes the calculations well conditioned. The exact form of F(x) depends on your choice of the nonlinearity estimator. You can select from available nonlinearity estimators, such as tree-partition networks, wavelet networks, and multilayer neural networks. You can also exclude either the linear or the nonlinear function block from the nonlinearity estimator.

When estimating a nonlinear ARX model, the software computes the model parameter values, such as L, r, d, Q, and other parameters specifying g.

Resulting nonlinear ARX models are `idnlarx` objects that store all model data, including model regressors and parameters of the nonlinearity estimator. For more information about these objects, see Nonlinear Model Structures.

Typically, you use nonlinear ARX models as black-box structures. The nonlinear function of the nonlinear ARX model is a flexible nonlinearity estimator with parameters that need not have physical significance. You can estimate nonlinear ARX in the System Identification app or at the command line using the `nlarx` command. You can use uniformly sampled time-domain input-output data or time-series data (no inputs) for estimating nonlinear ARX models. Your data can have one or more input and output channels. You cannot use frequency-domain data for estimation.

### Nonlinear ARX Model Orders and Delay

You use the orders and delays of a nonlinear ARX model to define the standard regressors of the model. The orders and delay are defined as follows:

• na — Number of past output terms used to predict the current output.

• nb — Number of past input terms used to predict the current output.

• nk — Delay from input to the output in terms of the number of samples.

The meaning of na, nb, and nk is similar to that for linear ARX model parameters. Orders are specified as scalars for SISO data, and as ny-by-nu matrices for MIMO data, where ny and nu are the number of outputs and inputs. If you are not sure what values to use for the orders and delays, you can estimate them as described in Preliminary Step – Estimating Model Orders and Input Delays. Such an estimate is based on linear ARX models and only provides initial guidance. The best orders for a linear ARX model might not be the best orders for a nonlinear ARX model.

System Identification Toolbox™ software computes standard regressors using the model orders and delays. For example, suppose that you specify `na = 2`, ```nb = 3```, and `nk = 5` for a SISO model with input u and output y. The toolbox computes standard regressors y(t-2), y(t-1),u(t-5), u(t-6), and u(t-7).

You can also specify custom regressors in addition to standard regressors. For more information, see Estimate Nonlinear ARX Models in the App and Estimate Nonlinear ARX Models at the Command Line.