# idSigmoidNetwork

Sigmoid network function for nonlinear ARX and Hammerstein-Wiener models

## Description

An idSigmoidNetwork object implements a sigmoid network function, and is a nonlinear mapping function for estimating nonlinear ARX and Nonlinear Hammerstein-Wiener models. The mapping function, which is also referred to as a nonlinearity, uses a combination of linear weights, an offset and a nonlinear function to compute its output. The nonlinear function contains sigmoid unit functions that operate on a ridge combination (weighted linear sum) of inputs.

Mathematically, idSigmoidNetwork is a function that maps m inputs X(t) = [x(t1),x2(t),…,xm(t)]T to a scalar output y(t) using the following relationship:

$y\left(t\right)={y}_{0}+Χ{\left(t\right)}^{T}PL+S\left(Χ\left(t\right)\right)$

Here:

• X(t) is an m-by-1 vector of inputs, or regressors.

• y0 is the output offset, a scalar.

• P is an m-by-p projection matrix, where m is the number of regressors and is p is the number of linear weights. m must be greater than or equal to p.

• L is a p-by-1 vector of weights.

• S(X) is a sum of dilated and translated sigmoid functions. The total number of sigmoid functions is referred to as the number of units n of the network.

For the definition of the sigmoid function term S(X) , see More About.

Use idSigmoidNetwork as the value of the OutputFcn property of an idnlarx model or the InputNonlinearity and OutputLinearity properties of an idnlhw object. For example, specify idSigmoidNetwork when you estimate an idnlarx model with the following command.

sys = nlarx(data,regressors,idSigmoidNetwork)
When nlarx estimates the model, it essentially estimates the parameters of the idSigmoidNetwork function.

You can configure the idSigmoidNetwork function to disable components and fix parameters. To omit the linear component, set LinearFcn.Use to false. To omit the offset, set Offset.Use to false. To specify known values for the linear function and the offset, set their Value attributes directly and set the corresponding Free attributes to False. Use evaluate to compute the output of the function for a given vector of inputs.

## Creation

### Description

example

S = idSigmoidNetwork creates a idSigmoidNetwork object S that uses 10 units. The number of inputs is determined during model estimation and the number of outputs is 1.

example

S = idSigmoidNetwork(numUnits) specifies the number of sigmoid functions numUnits.

example

S = idSigmoidNetwork(numUnits,UseLinearFcn) specifies whether the function uses a linear function as a subcomponent.

example

S = idSigmoidNetwork(numUnits,UseLinearFcn,UseOffset) specifies whether the function uses an offset term y0 parameter.

### Input Arguments

expand all

Number of units, specified as a positive integer. numUnits determines the number of sigmoid functions.

This argument sets the S.NonlinearFcn.NumberOfUnits property.

Option to use the linear function subcomponent, specified as true or false. This argument sets the value of the S.LinearFcn.Use property.

Option to use an offset term, specified as true or false. This argument sets the value of the S.Offset.Use property.

## Properties

expand all

Input signal names for the inputs to the mapping object, specified as a 1-by-m cell array, where m is the number of input signals. This property is determined during estimation.

Output signal name for the output of the mapping object, specified as a 1-by-1 cell array. This property is determined during estimation.

Parameters of the linear function, specified as follows:

• Use — Option to use the linear function in the sigmoid network, specified as a scalar logical. The default value is true.

• Value — Linear weights that compose L', specified as a 1-by-p vector.

• InputProjection — Input projection matrix P, specified as an m-by-p matrix, that transforms the detrended input vector of length m into a vector of length p. For Hammerstein-Wiener models, InputProjection is equal to 1.

• Free — Option to update entries of Value during estimation, specified as a 1-by-p logical vector. The software honors the Free specification only if the starting value of Value is finite. The default value is true.

Parameters of the offset term, specified as follows:

• Use — Option to use the offset in the sigmoid network, specified as a scalar logical. The default value is true.

• Value — Offset value, specified as a scalar.

• Free — Option to update Value during estimation, specified as a scalar logical. The software honors the Free specification of false only if the value of Value is finite. The default value is true.

Parameters of the nonlinear function, specified as follows:

• NumberOfUnits — Number of units, specified as a positive integer. NumberOfUnits determines the number of sigmoid functions.

• Parameters — Parameters of idSigmoidNetwork, specified as in the following table:

Field NameDescriptionDefault
InputProjection

Projection matrix Q, specified as an m-by-q matrix. Q transforms the detrended input vector $\left(X-\overline{X}\right)$ of length m into a vector of length q. Typically, Q has the same dimensions as the linear projection matrix P. In this case, q is equal to p, which is the number of linear weights.

For Hammerstein-Wiener models, InputProjection is equal to 1.

[]
OutputCoefficient

Sigmoid function output coefficients si, specified as an n-by-1 vector.

[]
Translation

Translation matrix, specified as an n-by-q matrix of translation row vectors ci.

[]
Dilation

Dilation coefficients bi, specified as an n-by-1 vector.

[]

• Free — Option to estimate parameters, specified as a logical scalar. If all the parameters have finite values, such as when the idSigmoidNetwork object corresponds to a previously estimated model, then setting Free to false causes the parameters of the nonlinear function S(X) to remain unchanged during estimation. The default value is true.

## Examples

collapse all

Load the data z7 and create a subset to use as estimation data.

ze = z7(1:300);

Create and configure an idSigmoidNetwork mapping object. Fix the offset to 0.2 and the number of units to 15.

S = idSigmoidNetwork;
S.Offset.Value = 0.2;
S.Offset.Free = false;
S.NonlinearFcn.NumberOfUnits = 15;

Create linear and polynomial model regressors. Use the input and output variable names from z7 as the variable names for the regressors.

var_names = [z7.OutputName;z7.InputName]
var_names = 3x1 cell
{'y1'}
{'u1'}
{'u2'}

Reg1 = linearRegressor(var_names,{1:4,0:4,1});
Reg2 = polynomialRegressor(var_names,{1:2,0:2,0},2);

Set the estimation options.

opt = nlarxOptions('SearchMethod','fmincon');
opt.SearchOptions.MaxIterations = 40;

Estimate the nonlinear ARX model.

sys = nlarx(ze,[Reg1;Reg2],S,opt)
sys =

Nonlinear ARX model with 1 output and 2 inputs
Inputs: u1, u2
Outputs: y1

Regressors:
1. Linear regressors in variables y1, u1, u2
2. Order 2 regressors in variables y1, u1, u2

Output function: Sigmoid network with 15 units
Sample time: 1 seconds

Status:
Termination condition: Maximum number of iterations or number of function evaluations reached..
Number of iterations: 40, Number of function evaluations: 88

Estimated using NLARX on time domain data "ze".
Fit to estimation data: 74.27% (prediction focus)
FPE: 6.11, MSE: 0.6547

Estimate a Hammerstein-Wiener model that uses idSigmoidNetwork as the output nonlinearity.

Create an idSigmoidNetwork mapping object that has 15 units and that has no input nonlinearity or offset.

S = idSigmoidNetwork(15,false,false)
S =
Sigmoid Network

Nonlinear Function: Sigmoid network with 15 units
Linear Function: not in use
Output Offset: not in use

Inputs: {1x0 cell}
Outputs: {1x0 cell}
NonlinearFcn: 'Sigmoid units and their parameters'
LinearFcn: 'Linear function parameters'
Offset: 'Offset parameters'

Estimate a Hammerstein-Wiener model.

sys = nlhw(ThrottleData,[4 4 0],[],S)
sys =

Hammerstein-Wiener model with 1 output and 1 input

Linear transfer function corresponding to the orders nb = 4, nf = 4, nk = 0

Input nonlinearity: None
Output nonlinearity: Sigmoid network with 15 units
Sample time: 0.01 seconds

Status:
Termination condition: Maximum number of iterations reached..
Number of iterations: 20, Number of function evaluations: 345

Estimated using NLHW on time domain data "ThrottleData".
Fit to estimation data: 55.55%
FPE: 309.4, MSE: 218

expand all

## Algorithms

idSigmoidNetwork uses an iterative search technique for estimating parameters.

## Version History

Introduced in R2007a

expand all