customRegressor
Specify custom regressor for nonlinear ARX model
Description
A custom regressor represents a single user-provided formula that operates on delayed input and output variables. For example,y(t–1)eu(t–1)is a custom regressor that you can construct using the formula@(x,y)x.*exp(y)
. AcustomRegressor
object encapsulates a set of custom regressors. UsecustomRegressor
objects when you create nonlinear ARX models usingidnlarx
ornlarx
. You can specifycustomRegressor
objects along withlinearRegressor
,polynomialRegressor
, andperiodicRegressor
objects and combine them into a single combined regressor set.
Creation
Syntax
Description
creates acReg
= customRegressor(Variables,Lags,Fcn)customRegressor
object, with the output and input names inVariables
, the corresponding lags inlags
, and the function handle inFcn
.Fcn
sets theVariablesToRegressorFcn
property. For example, ifVariables
contains'y'
,lags
contains the corresponding lag vector[2 4]
, and the custom function is@(x)sin(x)
, then the regressors that use'y'
are sin(y(t–2)) and sin(y(t–4)).
specifies whethercReg
= customRegressor(变量、滞后Fcn矢量化)Fcn
can process a vector of inputs to return a vector of output values, based on the value ofVectorized
.