Custom nonlinearity estimator for nonlinear ARX and HammersteinWiener models
C=customnet(H)
C=customnet(H,PropertyName
,PropertyValue
)
customnet
is an object that stores a custom
nonlinear estimator with a userdefined unit function. This custom
unit function uses a weighted sum of inputs to compute a scalar output.
C=customnet(H)
creates a nonlinearity estimator
object with a userdefined unit function using the function handle H
. H
must
point to a function of the form [f,g,a] = function_name(x)
,
where f
is the value of the function, g
= df/dx
, and a
indicates the unit function
active range. g
is significantly nonzero in the
interval [a a]
. HammersteinWiener models require
that your custom nonlinearity have only one input and one output.
C=customnet(H,
creates
a nonlinearity estimator using propertyvalue pairs defined in customnet Properties.PropertyName
,PropertyValue
)
You can include propertyvalue pairs in the constructor to specify the object.
After creating the object, you can use get
or
dot notation to access the object property values. For example:
% List all property values get(C) % Get value of NumberOfUnits property C.NumberOfUnits
You can also use the set
function to set
the value of particular properties. For example:
set(C, 'LinearTerm', 'on')
set
must be the name of a MATLAB^{®} variable.Property Name  Description 

NumberOfUnits  Integer specifies the number of nonlinearity units in
the expansion. For example: customnet(H,'NumberOfUnits',5) 
LinearTerm  Can have the following values:
For example: customnet(H,'LinearTerm','on') 
Parameters 
A structure containing the parameters in the nonlinear expansion, as follows:
Typically, the values of this structure are set by estimating a model with a

UnitFcn  Stores the function handle that points to the unit function. 
Define custom unit function and save it in gaussunit.m
:
function [f, g, a] = GAUSSUNIT(x) % x: unit function variable % f: unit function value % g: df/dx % a: unit active range (g(x) is significantly % nonzero in the interval [a a]) % The unit function must be "vectorized": for % a vector or matrix x, the output arguments f and g % must have the same size as x, % computed elementbyelement. % GAUSSUNIT customnet unit function example [f, g, a] = gaussunit(x) f = exp(x.*x); if nargout>1 g =  2*x.*f; a = 0.2; end
Use custom networks in nlarx
and nlhw
model estimation commands:
% Define handle to example unit function. H = @gaussunit; % Estimate nonlinear ARX model using % Gauss unit function with 5 units. m = nlarx(Data,Orders,customnet(H,'NumberOfUnits',5));
Use customnet
to define a nonlinear function $$y=F(x)$$, where y is
scalar and x is an m
dimensional
row vector. The unit function is based on the following function expansion
with a possible linear term L:
$$\begin{array}{l}F(x)=(xr)PL+{a}_{1}f\left(\left(xr\right)Q{b}_{1}+{c}_{1}\right)+\dots \\ \text{}+{a}_{n}f\left(\left(xr\right)Q{b}_{n}+{c}_{n}\right)+d\end{array}$$
where f is a unit function that you define using the function handle H.
P and Q are m
byp
and m
byq
projection
matrices, respectively. The projection matrices P and Q are
determined by principal component analysis of estimation data. Usually, p=m
.
If the components of x in the estimation data
are linearly dependent, then p<m
. The number
of columns of Q, q
, corresponds
to the number of components of x
used in the unit
function.
When used to estimate nonlinear ARX models, q
is
equal to the size of the NonlinearRegressors
property
of the idnlarx
object. When
used to estimate HammersteinWiener models, m=q=1
and Q is
a scalar.
r is a 1bym
vector
and represents the mean value of the regressor vector computed from
estimation data.
d, a, and c are scalars.
L is a p
by1
vector.
b represents q
by1
vectors.
The function handle of the unit function of the custom net must
have the form [f,g,a] = function_name(x)
. This
function must be vectorized, which means that for a vector or matrix x
,
the output arguments f
and g
must
have the same size as x
and be computed elementbyelement.
customnet
uses an iterative search technique
for estimating parameters.