getreg
Regressor expressions and numerical values in nonlinear ARX model
Syntax
Rs = getreg(model)
Rm = getreg(model,data)
Rm = getreg(model,data,init)
Rm = getreg(___,'Type',regressorType)
Description
Rs = getreg(model) returns expressions for computing regressors
in the nonlinear ARX model. model is an idnlarx object. A typical use of the regression matrices built by
getreg is to generate input data when you want to evaluate the
output of a mapping function such as idWaveletNetwork using evaluate. For example, the following pair of commands evaluates the
output of a mapping function
model.
Regressor_Value = getreg(model,data,'z')
y = evaluate(model.OutputFcn,RegressorValue)y = predict(model,data,1,predictOptions('InitialCondition','z'))
Rm = getreg(model,data) returns regressor values as a timetable for the specified input/output data set
data. data can be a timetable, a
comma-separated pair of input and output matrices, or an iddata object.
Rm = getreg(model,data,init) uses the initial conditions that are
specified in init. The first N rows of each
regressor matrix depend on the initial states init, where
N is the maximum delay in the regressors (see
getDelayInfo).
Rm = getreg(___,'Type',
returns the names of the regressors of the specified regressorType)regressorType.
For example, use the command Rm = getreg(model,'Type','input') to
return the names of only the input regressors.
Input Arguments
dataTimetable, comma-separated pair of numeric input/output matrices u,y, or
iddataobject containing measured data consisting of the values of the input and output variables corresponding to[model.InputName]and[model.OutputName].initInitial conditions of your data:
'z'(default) specifies zero initial state.NaNdenotes unknown initial conditions.Real column vector containing the initial state values. For more information on initial states, see Definition of idnlarx States in
idnlarx. For multiple-experiment data, this is a matrix where each column specifies the initial state of the model corresponding to that experiment.iddataobject containing input and output samples at time instants before to the first sample indata. When theiddataobject contains more samples than the maximum delay in the model, only the most recent samples are used. The number of samples required is equal tomax(getDelayInfo(model)).
modeliddataobject representing nonlinear ARX model.regressorTypeType of regressor to return, specified as one of the following:
'all'(default) — All regressors'input'— Only input regressors'output'— Only output regressors'standard'— Only linear and polynomial regressors'custom'— Only custom regressors
Output Arguments
Rmtimetableof regressor values for all or a specified subset of regressors. Each column inRmcontains as many rows as there are data samples. For a model withnrregressors,Rmcontains one column for each regressor. Whendatacontains multiple experiments,Rmis a cell array where each element corresponds to a timetable of regressor values for an experiment.RsRegressor expressions represented as a cell array of character vectors. For example, the expression
'u1(t-2)'computes the regressor by delaying the input signalu1by two time samples. Similarly, the expression'y2(t-1)'computes the regressor by delaying the output signaly2by one time sample.The order of regressors in
Rscorresponds to regressor indices in theidnlarxobject propertymodel.RegressorUsage.
Examples
Version History
Introduced in R2007aSee Also
idnlarx | linearRegressor | polynomialRegressor | customRegressor | evaluate

