Documentation Center |
Nonlinear ARX model
m = idnlarx([na nb nk])
m = idnlarx([na nb nk],Nonlinearity)
m = idnlarx([na nb nk],Nonlinearity,'Name',Value)
m = idnlarx(LinModel)
m = idnlarx(LinModel,Nonlinearity)
m = idnlarx(LinModel,Nonlinearity,'PropertyName',PropertyValue)
Represents nonlinear ARX model. The nonlinear ARX structure is an extension of the linear ARX structure and contains linear and nonlinear functions. For more information, see Nonlinear ARX Model Extends the Linear ARX Structure.
Typically, you use the nlarx command to both construct the idnlarx object and estimate the model parameters. You can configure the model properties directly in the nlarx syntax.
You can also use the idnlarx constructor to create the nonlinear ARX model structure and then estimate the parameters of this model using nlarx or pem.
For idnlarx object properties, see:
m = idnlarx([na nb nk]) creates an idnlarx object using a default wavelet network as its nonlinearity estimator. na, nb, and nk are positive integers that specify model orders and delays.
m = idnlarx([na nb nk],Nonlinearity) specifies a nonlinearity estimator Nonlinearity, as a nonlinearity estimator object or string representing the nonlinearity estimator type.
m = idnlarx([na nb nk],Nonlinearity,'Name',Value) creates the object using options specified as idnlarx model property or idnlarx algorithm property name and value pairs. Specify Name inside single quotes.
m = idnlarx(LinModel) creates an idnlarx object using a linear model (in place of [na nb nk]), and a wavelet network as its nonlinearity estimator. LinModel is a discrete time input-output polynomial model of ARX structure (idpoly). LinModel sets the model orders, input delay, input-output channel names and units, sample time, and time unit of m, and the polynomials initialize the linear function of the nonlinearity estimator.
m = idnlarx(LinModel,Nonlinearity) specifies a nonlinearity estimator Nonlinearity.
m = idnlarx(LinModel,Nonlinearity,'PropertyName',PropertyValue) creates the object using options specified as idnlarx property name and value pairs.
Nonlinearity |
Nonlinearity estimator, specified as a nonlinearity estimator object or string representing the nonlinearity estimator type.
Specifying a string creates a nonlinearity estimator object with default settings. Use object representation to configure the properties of a nonlinearity estimator. 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. |
LinModel |
Discrete time input-output polynomial model of ARX structure (idpoly), typically estimated using the arx command. |
After creating the object, you can use get or dot notation to access the object property values. For example:
% Get the model time unit get(m,'TimeUnit') % Get value of Nonlinearity property m.Nonlinearity
You can specify property name-value pairs in the model estimator or constructor to configure the model structure and estimation algorithm.
Use set or dot notation to set a property of an existing object.
The following table summarizes idnlarx model properties. The general idnlmodel properties also apply to this nonlinear model object (see the corresponding reference page).
Property Name | Description | ||||||||||||||||||||||||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
Algorithm | A structure that specifies the estimation algorithm options, as described in idnlarx Algorithm Properties. | ||||||||||||||||||||||||||||||||||
CustomRegressors | Custom expression in terms of standard regressors. | ||||||||||||||||||||||||||||||||||
EstimationInfo | A read-only structure that stores estimation settings and results. The structure has the following fields:
| ||||||||||||||||||||||||||||||||||
Focus | Specifies 'Prediction' or 'Simulation'.
| ||||||||||||||||||||||||||||||||||
NonlinearRegressors | Specifies which standard or custom regressors enter the nonlinear block. For multiple-output models, use cell array of n_{y} elements (n_{y} = number of model outputs). For each output, assignable values are:
| ||||||||||||||||||||||||||||||||||
Nonlinearity | Nonlinearity estimator object. Assignable values include wavenet (default), sigmoidnet, treepartition, customnet, neuralnet, and linear. If the model contains only one regressor, you can also use saturation, deadzone, pwlinear, or poly1d. For ny outputs, Nonlinearity is an ny-by-1 array. For example, [sigmoidnet;wavenet] for a two-output model. When you specify a scalar object, this nonlinearity applies to all outputs. | ||||||||||||||||||||||||||||||||||
na nb nk | Nonlinear ARX model orders and input delays, where na is the number of output terms, nb is the number of input terms, and nk is the delay from input to output in terms of the number of samples. For ny outputs and nu inputs, 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. |
The following table summarizes the fields of the Algorithm idnlarx model properties. Algorithm is a structure that specifies the estimation-algorithm options.
Property Name | Description | ||||||||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
Advanced | A structure that specifies additional estimation algorithm options. The structure has the following fields:
| ||||||||||||||||||
Criterion | The search method of lsqnonlin supports the Trace criterion only. Use for multiple-output models only. Criterion can have the following values:
Both the Det and Trace criteria are derived from a general requirement of minimizing a weighted sum of least squares of prediction errors. Det can be interpreted as estimating the covariance matrix of the noise source and using the inverse of that matrix as the weighting. You should specify the weighting when using the Trace criterion. If you want to achieve better accuracy for a particular channel in MIMO models, use Trace with weighting that favors that channel. Otherwise, use Det. If you use Det, check cond(model.NoiseVariance) after estimation. If the matrix is ill-conditioned, try using the Trace criterion. You can also use compare on validation data to check whether the relative error for different channels corresponds to your needs or expectations. Use the Trace criterion if you need to modify the relative errors, and check model.NoiseVariance to determine what weighting modifications to specify. | ||||||||||||||||||
Display | Toggles displaying or hiding estimation progress information
in the MATLAB^{®} Command Window.
| ||||||||||||||||||
IterWavenet | (For wavenet nonlinear
estimator only)
| ||||||||||||||||||
LimitError | Robustification criterion that limits the influence of
large residuals, specified as a positive real value. Residual values
that are larger than 'LimitError' times the estimated
residual standard deviation have a linear cost instead of the usual
quadratic cost. | ||||||||||||||||||
MaxIter | Maximum number of iterations for the estimation algorithm,
specified as a positive integer. | ||||||||||||||||||
MaxSize | The number of elements (size) of the largest matrix to
be formed by the algorithm. Computational loops are used for larger
matrices. Use this value for memory/speed trade-off.MaxSize can
be any positive integer. | ||||||||||||||||||
Regularization | Options for regularized estimation of model parameters. For more information on regularization, see Regularized Estimates of Model Parameters. Structure with the following fields:
| ||||||||||||||||||
SearchMethod | Method used by the iterative search algorithm.
| ||||||||||||||||||
Tolerance | Specifies to terminate the iterative search when the
expected improvement of the parameter values is less than Tolerance,
specified as a positive real value in %. | ||||||||||||||||||
Weighting | (For multiple-output models only) Specifies the relative importance of outputs in MIMO models (or reliability of corresponding data) as a positive semi-definite matrix W. Use when Criterion = 'Trace' for weighted trace minimization. By default, Weighting is an identity matrix of size equal to the number of outputs. |
Create nonlinear ARX model structure with (default) wavelet network nonlinearity:
m = idnlarx([2 2 1]) % na=nb=2 and nk=1
Create nonlinear ARX model structure with sigmoid network nonlinearity:
m=idnlarx([2 3 1],sigmoidnet('Num',15)) % number of units is 15
Create nonlinear ARX model structure with no nonlinear function in nonlinearity estimator:
m=idnlarx([2 2 1],[])
Construct a nonlinear ARX model using a linear ARX model:
% Construct a linear ARX model. A = [1 -1.2 0.5]; B = [0.8 1]; LinearModel = idpoly(A, B, 'Ts', 0.1); % Construct nonlinear ARX model using the linear ARX model. m1 = idnlarx(LinearModel)
addreg | customnet | customreg | findop(idnlarx) | getreg | idnlmodel | linear | linearize(idnlarx) | nlarx | pem | polyreg | sigmoidnet | wavenet