Identifying Nonlinear ARX Models

Supported Data for Nonlinear ARX Models

You can estimate discrete-time nonlinear ARX models from data with the following characteristics:

For more information about representing your data for system identification, see Data Processing.

Definition of the Nonlinear ARX Model

Nonlinear ARX models describe nonlinear structures using a parallel combination of nonlinear and linear blocks. The nonlinear and linear functions are expressed in terms of variables called regressors.

The System Identification Toolbox product computes regressors by performing transformations of the measured input u(t) and output y(t) signals based on the model order you specify. For example, regressors can be delayed inputs and outputs, such as u(t-1) and y(t-3). Regressors can also be nonlinear functions of inputs and outputs, such as tan(u(t-1)) or u(t-1)y(t-3). You can either use default regressors, or specify your own custom functions of input and output signals.

The predicted output of a nonlinear model at time t is given by the following general equation:

where x(t) represents the regressors. F is a nonlinear regression function, which is approximated by a nonlinearity estimator, which might be a binary partition tree, a neural network, or a network based on wavelets. The following figure shows how the predicted output of the model is formed from the inputs and outputs.

The function F can include both linear and nonlinear functions of x(t), as shown in the previous diagram. You can specify which regressors to use a inputs to the nonlinear block.

The following equation provides a general description of F:

where is the unit nonlinear function, d is the number of nonlinearity units, and , , and are the parameters of the nonlinearity estimator.

You choose a nonlinear structure that independently combines linear and nonlinear regressors and the structure of the nonlinearity itself, such as treepartition or wavenet. The System Identification Toolbox product uses input/output data to find the linear and nonlinear mappings that give the best predicted outputs of the nonlinear model.

For more information about regressors, see Using Regressors. For a list of nonlinearity estimators supported by nonlinear ARX models, see Nonlinearity Estimators for Nonlinear ARX Models.

Using Regressors

You can use the following types of regressors for nonlinear ARX models:

Specifying Model Order and Delays

You must specify the following model orders for computing standard regressors:

The meaning of na and nb is similar to the linear-ARX model parameters in the sense that na represents the number of output terms and nb represents the number of input terms. nk represents the minimum input delay from an input to an output. For more information about the linear ARX model structure, see What Are Black-Box Polynomial Models?.

Example – Relationship Between Regressors, Model Orders, and Delays

This example describes how the model orders and delays you specify relate to computing the regressors.

Suppose that you specify a nonlinear ARX model with a minimum of a two-sample input delay and the number of input terms is nb=2. The toolbox computes the following standard regressors from the input signal:

If you specify that the number of output terms is na=4, the toolbox computes the following standard regressors from the output signals:

If you have physical insight that your current output depends on specific delayed inputs and outputs, select the appropriate model orders to compute the required regressors.

Using Custom Regressors

In general, custom regressors are nonlinear functions of delayed input and output data samples. You can specify custom regressors, such as tan(u(t-1)), u(t-1)2, or u(t-1)*y(t-3).

In the System Identification Tool GUI. You can create custom regressors in the Model Regressors dialog box. For more information, see How to Estimate Nonlinear ARX Models in the GUI.

At the command line. Use the customreg or polyreg command to construct custom regressors in terms of input-output variables. For more information, see the corresponding reference page.

The linear block includes all standard and custom regressors. However, you can include specific standard and custom regressors in your nonlinear block to fine-tune the model structure.

To get a linear-in-the-parameters ARX model structure, you can exclude the nonlinear block from the model structure completely. When using only a linear block with custom regressors, you can create the simplest types of nonlinear models. In this case, the custom regressors capture the nonlinearities and the estimation routine computes the weights of the standard and custom regressors in the linear block to predict the output.

Nonlinearity Estimators for Nonlinear ARX Models

Nonlinear ARX models support the following nonlinearity estimators:

For a summary of all nonlinearity estimators and links to the corresponding reference pages, see Supported Nonlinearity Estimators.

You can exclude the nonlinearity function from the model structure. In this case, the model includes all standard and custom regressors and is linear in the parameters.

In the System Identification Tool GUI. You can omit the nonlinear block by selecting None for the Nonlinearity.

At the command line. You can omit the nonlinear block by setting the Nonlinearity property value to 'Linear'. For more information, see the nlarx and idnlarx reference pages.

For a description of each nonlinearity estimator, see Supported Nonlinearity Estimators.

How to Estimate Nonlinear ARX Models in the GUI

You must have already imported your data into the System Identification Tool GUI. For more information about preparing your data, see Data Processing.

To estimate a nonlinear ARX model in the System Identification Tool GUI:

  1. In the System Identification Tool GUI, select Estimate > Nonlinear models to open the Nonlinear Models dialog box. The Model Type tab is selected.

  2. In the Model Structure list, select Nonlinear ARX.

    This action updates the options in the Nonlinear Models dialog box to correspond to this model structure. For information about this model structure, see Definition of the Nonlinear ARX Model.

  3. In the Model name field, edit the name of the model, or keep the default name. The name of the model should be unique to all nonlinear ARX models in the System Identification Tool GUI.

  4. (Optional) If you want to try refining a previously estimated model, select the name of this model in the Initial model list.

    A model is available in the Initial model list under the following conditions:

  5. Keep the default settings in the Nonlinear Models dialog box that specify the model structure and the algorithm, or modify the following settings:

    For more information about the available options, click Help in the Nonlinear Models dialog box to open the GUI help.

  6. Click Estimate to add this model to the Model Board in the System Identification Tool GUI.

    The Estimation tab displays the estimation progress and results.

  7. To plot the response of this model, select the appropriate check box in the Model Views area of the System Identification Tool GUI. If you get an inaccurate fit, try estimating a new model with different orders or nonlinearity estimator. For more information about validating models, see Model Analysis.

  8. For further analysis, export the model to the MATLAB workspace by dragging it to the To Workspace rectangle in the System Identification Tool GUI.

How to Estimate Nonlinear ARX Models at the Command Line

General nlarx Syntax

You can estimate nonlinear ARX models using nlarx. The resulting models are stored as idnlarx model objects.

Use the following general syntax to both configure and estimate nonlinear ARX models:

m = nlarx(data,'na',na,...
               'nb',nb,...
               'nk',nk,...
                Nonlinearity,...
               'Property1',Value1,...,
               'PropertyN',ValueN)

where data is the estimation data. na, nb, and nk specify the model orders and delays. For more information about model orders, see Specifying Model Order and Delays.

Nonlinearity specifies the nonlinearity estimator object as 'sigmoidnet', 'wavenet', 'treepartition', 'customnet', 'neuralnet', or 'linear'.

The property-value pairs specify any idnlarx model properties that configure the estimation algorithm. You can enter all model property-value pairs and top-level algorithm properties as a comma-separated list in nlarx.

For multiple inputs and outputs, na, nb, and nk are described in Options for Multiple-Input and Multiple-Output ARX Orders.

You can specify different nonlinearity estimators for different output channels by setting Nonlinearity to an object array. For example:

m = nlarx(data,[[2 1; 0 1] [2;1] [1;1]],...
               [wavenet;sigmoidnet('num',7)])

To specify the same nonlinearity for all outputs, set Nonlinearity to a single nonlinearity estimator. For example:

m = nlarx(data,[[2 1; 0 1] [2;1] [1;1]],...
               sigmoidnet('num',7))

For detailed information about the nlarx and idnlarx properties and values, see the corresponding reference page.

For more information about validating models, see Model Analysis.

You can also use pem to refine parameter estimates of an existing nonlinear ARX model, as described in Refining Nonlinear Black-Box Models.

Example – Using nlarx to Estimate Nonlinear ARX Models

This example uses nlarx to estimate a nonlinear ARX model for the two-tank system. The data for this system is described in Tutorial – Identifying Nonlinear Black-Box Models Using the GUI in the System Identification Toolbox Getting Started Guide.

Prepare the data for estimation using the following commands:

load twotankdata
z = iddata(y, u, 0.2);
ze = z(1:1000); zv = z(1001:3000);

Estimate several models using different model orders, delays, and nonlinearity settings:

m1 = nlarx(ze,[2 2 1],'wav');
m2 = nlarx(ze,[2 2 3],wavenet);
m3 = nlarx(ze,[2 2 3],wavenet('num',8));
m4 = nlarx(ze,[2 2 3],wavenet('num',8),...
                      'nlr', [1 2]);
m5 = nlarx(ze,[2 2 3],sigmoidnet('num',14),...
                      'nlr',[1 2]);

Compare the resulting models by plotting the model outputs on top of the measured output:

compare(zv, m1,m2,m3,m4,m5)

MATLAB software responds with the following plot.

  


 © 1984-2008- The MathWorks, Inc.    -   Site Help   -   Patents   -   Trademarks   -   Privacy Policy   -   Preventing Piracy   -   RSS