| Products & Services | Solutions | Academia | Support | User Community | Company |
| Download Product Updates | | | Get Pricing | | | Trial Software |
| Documentation → System Identification Toolbox |
| Contents | Index |
| Learn more about System Identification Toolbox |
m = nlarx(data,[na nb nk])
m = nlarx(data,[na nb nk],Nonlinearity)
m = nlarx(data,[na nb nk],'CustomRegressors',CustomReg)
m = nlarx(data,[na nb nk],'PropertyName',PropertyValue)
m = nlarx(data,[na nb nk]) constructs and estimates a nonlinear ARX model. data is the estimation data. na, nb, and nk are positive integers that specify the model orders and delays. For ny output channels and nu input channels, na is an ny-by-ny matrix whose i-jth entry gives the number of delayed jth outputs used to compute the ith output. nb and nk are ny-by-nu matrices, where each row defines the orders for the corresponding output. By default, the nonlinearity estimator is the wavelet network (see the wavenet reference page), which takes all standard regressors as inputs to its linear and nonlinear functions.
m = nlarx(data,[na nb nk],Nonlinearity) uses the nonlinearity estimator Nonlinearity. To use the nonlinearity estimator with default options, specify as a string: 'wavenet', 'sigmoidnet', 'treepartition', or 'linear'. Nonlinearity can also be the constructor wavenet, sigmoidnet, treepartition, neuralnet, or customnet. For a neural network, specify the network object you created using the Neural Network Toolbox software. For a custom network, specify the custom network you created. For supported nonlinearities, see Nonlinearity Estimators for Nonlinear ARX Models.
m = nlarx(data,[na nb nk],'CustomRegressors',CustomReg) specifies custom regressors. CustomReg is a customreg object. For ny output channels, CustomReg is an ny-by-1 cell array of customreg objects or of cell array of strings.
m = nlarx(data,[na nb nk],'PropertyName',PropertyValue) constructs and estimates the model using options specified as idnlarx property name and value pairs.
data |
Time-domain iddata object. | |||||||||||||||
na nb nk |
Positive integers that specify the model orders and delays. For ny output channels and nu input channels, na is an ny-by-ny matrix whose i-jth entry gives the number of delayed jth outputs used to compute the ith output. nb and nk are ny-by-nu matrices, where each row defines the orders for the corresponding output. | |||||||||||||||
Nonlinearity |
Nonlinearity estimator object. Specify Nonlinearity as a string to use the default configuration of the object. Alternatively, specify these values as object constructors (see the corresponding nonlinearity reference page). For ny output channels, you can specify nonlinear estimators individually for each output channel by setting Nonlinearity to an ny-by-1 cell array or object array of nonlinearity estimators. To specify the same nonlinearity for all outputs, specify Nonlinearity as a single nonlinearity estimator.
Specify a multilayered neural network using: m = nlarx(data,[na nb nk],NNet) where NNet is the neural network object you create using the Neural Network Toolbox software. See the neuralnet reference page. Specify a custom network by defining a function called gaussunit.m, as described in the customnet reference page. Define the custom network object CNetw and estimate the model: CNetw = cutomnet(@gaussunit); m = nlarx(data,[na nb nk],CNetw) |
Estimate nonlinear ARX model with default settings:
load twotankdata Ts = 0.2; % Sampling interval is 0.2 min z = iddata(y,u,Ts); % constructs iddata object m = nlarx(z,[4 4 1]) % na=nb=4 and nk=1
Estimate nonlinear ARX model with a specific nonlinearity:
NL = wavenet('NumberOfUnits',5);
% Wavelet network has 5 units
m = nlarx(z,[4 4 1],NL)Estimate nonlinear ARX model with specific algorithm settings:
m = nlarx(z,[4 4 1],'sigmoidnet','MaxIter',50,...
'Focus','Simulation')
% Maximum number of estimation iterations is 50.
% Estimation focus 'simulation' optimizes model for
% simulation applications.
Estimate nonlinear ARX model from time series data:
t = 0:0.01:10;
y = 10*sin(2*pi*10*t)+rand(size(t));
z = iddata(y',[],0.01);
m = nlarx(z,2,'sigmoid')
compare(z,m,1) % compare 1-step-ahead
% prediction pf response
Estimate nonlinear ARX model and avoid local minima:
% Estimate initial model. load iddata1 m1=nlarx(z1,[4 2 1],'wave','nlr',[1:3]) % Perturb parameters slightly to avoid local minima: m2=init(m1) % Estimate model with perturbed initial parameter values: m2=nlarx(z1,m2)
Estimate nonlinear ARX model with custom regressors:
% Load sample data z1 (iddata object).
load iddata1
% Estimate the model parameters:
m = nlarx(z1,[0 0 0],'linear','CustomReg',...
{'y1(t-1)^2',...
'y1(t-2)*u1(t-3)'})
% na=nb=nk=0 means there are no standard regressors.
% 'linear' means that the nonlinear estimator has only
% the linear function.Estimate nonlinear ARX model with custom regressor object:
% Load sample data z1 (iddata object):
load iddata1
% Define custom regressors as customreg objects:
C1 = customreg(@(x)x^2,{‘y1'}, [1]); % y1(t-1)^2
C2 = customreg(@(x,y)x*y,{‘y1', ‘u1'},...
[2 3]); % y1(t-2)*u1(t-3)
C = [C1, C2]; % object array of custom regressors
% Estimate model with custom regressors:
m = nlarx(z1,[0 0 0],‘linear',‘CustomReg',C);
% List all model regressors:
getreg(m) Estimate nonlinear ARX model and search for optimum regressors for input to the nonlinear function:
load iddata1
m = nlarx(z1,[4 4 1],'sigmoidnet',...
'NonlinearRegressors','search');
m.NonlinearRegressors
% regressors indices in nonlinear functionEstimate nonlinear ARX model with selected regressors as inputs to the nonlinear function:
load iddata1
m = nlarx(z1,[4 4 1],'sigmoidnet',...
'NonlinearReg','input');
% Only input regressors enter the nonlinear function.
% m is linear in past outputs.Estimate nonlinear ARX model with no linear term in the nonlinearity estimator:
load iddata1
SNL = sigmoidnet('LinearTerm','off')
m = nlarx(z1,[2 2 1],SNL);Estimate MIMO nonlinear ARX model that has the same nonlinearity estimator for all output channels:
m = nlarx(data,[[2 1;0 1] [2;1] [1;1]],...
sigmoidnet('num',7))
% m uses a sigmoid network with 7 units
% for all output channels.Estimate MIMO nonlinear ARX model with different nonlinearity estimator for each output channel:
m = nlarx(data,[[2 1;0 1] [2;1] [1;1]],...
['wavenet'; sigmoidnet('num',7)])
% first output channel uses a wavelet network
% second output channel uses a sigmoid network with 7 unitsaddreg | customreg | getreg | idnlarx | init | polyreg
![]() | nkshift | nlhw | ![]() |

Includes the most popular MATLAB recorded presentations with Q&A sessions led by MATLAB experts.
| © 1984-2009- The MathWorks, Inc. - Site Help - Patents - Trademarks - Privacy Policy - Preventing Piracy - RSS |