How to get the coefficients from a nlarx model constructed using System Identification Toolbox?

14 views (last 30 days)
Hey all,
I am using System Identification Toolbox for constructing a non linear regression model. This is what I've done:
[num] = xlsread( '1.xlsx' ,1);
u1 = num(:,10); % Input Channel 1
u2 = num(:,3); % Input Channel 2
u = [u1 u2]; %Concatenate both input channels
y = num(:,11); % Output Channel
ts = 0.04; % Sampling Interval
data = iddata(y,u,0.04); % Construct data object with the specified input arguments
get(data) % Get the properities of the data object
advice(data)
datae = misdata(data,idarx); % This command linearly interpolates missing % values to estimate the first model. Then, it uses this model to estimate % the missing data as parameters by minimizing the output prediction errors % obtained from the reconstructed data.
advice(datae)
% Define the order by trial and error m1 = nlarx(datae,[4 4*ones(1,2) zeros(1,2)],'tree')
compare(datae,m1)
m2 = nlarx(datae,[2 2*ones(1,2) zeros(1,2)],'tree')
compare(datae,m2)
My second model was better with 94% fit. But now I don't know how to get the coefficients of the regressors and how to convert the model into a Transfer Function and to a SS model??
For example if I want to see the estimated parameters for M = ARX(DATA,ORDERS) I will type m.a

Accepted Answer

Rajiv Singh
Rajiv Singh on 5 Nov 2012
The coefficients of the nonlinear arx model are stored in the property called "Nonlinearity". In particular, look at m2.Nonlinearity.Parameters. The coefficients stored correspond to a certain equation whose nature depends upon the type of the nonlinearity chosen (tree partition in your case). Type "idprops treepartition", "idprops wavenet" etc for more information on the underlying equations. A couple of comments:
1. The model obtained by 1-step ahead prediction error minimization can be quite different from the one obtained by simulation error minimization. See the "focus" property which lets you toggle between prediction and simulation.
2. NLARX is a nonlinear model. You cannot just convert it into a (linear) transfer function or a state space model. If you want a linear approximation, use the idnlarx/linearize and idnlarx/linapp commands. If you are looking for a way of importing the nonlinear model into Simulink, use the dedicated "Nonlinear ARX" block which is part of System Identification Toolbox blockset.
Some useful links: For insights into the structure of nonlinear models, see:
For setting up the mask parameters for Nonlinear ARX model block in Simulink, see:
The reference page for idnlarx has lots of information too:
  4 Comments
Chahira Mahjoub
Chahira Mahjoub on 9 Apr 2017
T have the same problem, when I try m.Nonlinearity.Parameters to get the paramets, this command does not focus and Matlab gives an error " Error using InputOutputModel/subsref (line 43) Dot-reference can be used for a scalar nonlinearity estimator only." Please help me !!!!!!!!!!
Douglas Freire
Douglas Freire on 25 Jul 2017
I'm having the same problem that @Chahira Mahjoub reported.
"Error using idnlfunVector/subsref (line 42) Dot-reference can be used for a scalar nonlinearity estimator only." (R2017a)
Does anyone know how to solve this?

Sign in to comment.

More Answers (0)

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!