主要内容

polyenmialRegressor

为非线性ARX模型指定多项式回归器

描述

多项式回归器是由延迟输入和输出变量组成的多项式。例如,y(t–1)2y(t–1)u(t1)都是多项式解释变量的命令2 and variable delays of one sample. ApolyenmialRegressorobject encapsulates a set of polynomial regressors. UsepolyenmialRegressor当您使用非线性ARX模型时idnlarx或者Nlarx。You can specifypolyenmialRegressorobjects along with线性重构器,周期性重物, 和CustomRegressorobjects and combine them into a single combined regressor set.

创建

描述

example

preg= polyenmialRegressor(变量,滞后)创建一个polyenmialRegressor订单的对象2 that contains output and input names in变量和the corresponding lags in滞后。例如,如果变量contains'y'lagscontains the corresponding lag vector[2 4],然后使用的回归器'y'y(t–2)2y(t–4)2

example

preg= polynomialRegressor(Variables,Lags,Order)创建一个polyenmialRegressor订单的对象命令

example

preg= polynomialRegressor(Variables,Lags,Order,UseAbsolute)指定利用Absolute是否使用变量的绝对值来创建回归剂。

example

preg= polyenmialRegressor(变量,滞后,订单,useabsolute,abervariablemix)指定允许Variablemixwhether to allow multiple variables in the regressor formulas. For example, if变量is equal to{'y','u'},滞后is equal to{1,1}, 和命令is equal to2, then a value of真的for允许Variablemix导致包含混合变量回归器y(t–1)u(t–1),以及单变量回归器y(t–1)2u(t–1)2

example

preg= polynomialRegressor(Variables,Lags,Order,UseAbsolute,AllowVariableMix,AllowLagMix)指定AllowLagMixwhether to allow different lags in the regressor formulas. For example, if变量is equal to{'y','u'},滞后is equal to{2,[0 3]},命令is equal to2, 和允许Variablemixis equal tofalse, then a value of真的forAllowLagMix导致包含混合延迟回归器u(t)u(t–3),以及独特的滞后回归器y(t–2)2,u(t)2, 和u(t–3)2。请注意,如果您设置允许Variablemix真的,然后回归器集也将包括y(t–2)u(t) 和y(t–2)u(t–3)。

特性

展开全部

输出和输入变量名称,指定为字符串或单元格数组的单元格数组输出名称InputNameAn的属性iddata目的。每个条目必须是一个没有特殊字符的字符串。有关使用此属性的示例,请参见Estimate Nonlinear ARX Model with Polynomial Regressors

例子:{'y1','u1'}

例子:[z.Outputname;Z.InputName]''

每个变量中的滞后,指定为1乘nvcell array of non-negative integer row vectors, wherenv是回归变量的总数。每个行向量都包含nr指定的整数nr相应变量的回归滞后。例如,假设您需要以下回归量:

  • Output variabley1:y1(t–1)2y1(t–2)2

  • Input variableu1:u1(t–3)2

To obtain these lags, set滞后{[1 2],3}

如果滞后对应于一个的输出变量idnlarx模型,最小滞后必须大于或等于1。

有关使用此属性的示例,请参见Estimate Nonlinear ARX Model with Polynomial Regressors

例子:{1 1}

例子:{[1 2],[1,3,4]}

绝对值指示灯确定是否使用回归器变量的绝对值,而不是符号值,该值指定为逻辑向量,其长度等于变量数量。

有关设置此属性的示例,请参阅在多项式回归器集中使用绝对值

例子:[true,false]

混合变量指标确定是否在回归器公式中使用多个变量,例如y(t–1)u(t–1),指定为逻辑向量,长度等于变量数。

有关设置此属性的示例,请参阅利用Multiple Variables in Polynomial Regressor Term

例子:[true,false]

混合滞后指示器that determines whether to use different lags in regressor formulas such asu(t)u(t–3), specified as a logical vector with a length equal to the number of variables.

为现有的非线性ARX模型设置此属性系统,使用DOT符号,如以下命令所示。

有关设置此属性的示例,请参阅在多项式回归器项中使用混合滞后

例子:[true,false]

Name of the time variable, specified as a valid MATLAB®可变名称与值不同变量

例子:'ClockTime'

例子

collapse all

加载数据并创建一个iddataobjectz样品时间为0.1秒。

loadtwotankdatayuz = iddata(y,u,'ts',0.1);

指定具有表格的多项式回归器 u ( t - 2 ) 2 , u ( t - 4 ) 2 , 和 y ( t - 1 ) 2

利用the properties ofz至specify the variable names.

变量= [z.OutputName; z.inputName];

指定滞后。

lags = {1,[2 4]};

Create the regressor. The default order is2

preg = polyenmialRegressor(变量,滞后)
preg =订单2个变量中的回归器y1,u1 order:2变量:{'y1''u1'} lags lags:{[1] [2 4]} useAbsolute:[0 0 0]允许variablemimbix:0允许lagagmix:0允许级'该组描述的回归器

利用preg至estimate the nonlinear ARX model.

sys = nlarx(z,preg)
系统= Nonlinear ARX model with 1 output and 1 input Inputs: u1 Outputs: y1 Regressors: Order 2 regressors in variables y1, u1 List of all regressors Output function: Wavelet network with 66 units Sample time: 0.1 seconds Status: Estimated using NLARX on time domain data "z". Fit to estimation data: 95.97% (prediction focus) FPE: 5.843e-05, MSE: 5.569e-05

View the regressors.

getReg(sys)
ans =3x1单元{'y1(t-1)^2'} {'u1(t-2)^2'} {'u1(t-4)^2'}

指定三阶多项式回归器 u 1 ( t - 2 ) 3

变量='u1';滞后= 2;订单= 3;preg = polyenmialRegressor(变量,滞后,顺序)
preg= Order 3 regressors in variables u1 Order: 3 Variables: {'u1'} Lags: {[2]} UseAbsolute: 0 AllowVariableMix: 0 AllowLagMix: 0 TimeVariable: 't' Regressors described by this set

创建一个在变量中使用3、10和100的延迟的二阶多项式回归套件Y1和lags of 0 and 4 in variableU1

vars = {'y1','u1'};lags = {[3 10 100],[0,4]};

指定Y1回归器使用的绝对值Y1

利用Abs = [true,false];

Create the polynomial regressor.

reg = polynomialRegressor(vars,lags,2,UseAbs)
reg = Order 2 regressors in variables y1, u1 Order: 2 Variables: {'y1' 'u1'} Lags: {[3 10 100] [0 4]} UseAbsolute: [1 0] AllowVariableMix: 0 AllowLagMix: 0 TimeVariable: 't' Regressors described by this set

Create a polynomial regressor set that includes the terms y 1 ( t - 1 ) 2 , u 1 ( t - 1 ) 2 , 和 y 1 ( t - 1 ) u 1 ( t - 1 )

指定变量和滞后。

vars = {'y1','u1'};lags = {1,1};

指定that mixed-variable regressors be created.

Mixvar= true;

使用使用二阶多项式回归器Mixvar。设置第四位置,代表利用Absolute属性,false

reg = polyenmialRegressor(var,lags,2,false,mixvar)
reg =订单2个变量中的回归器y1,u1订单:2变量:{'y1''u1'} lags lags:{[1] [1]} useAbsolute:[0 0]允许variablemblemix:1允许lagagmix:1 allowlagmix:0 TimeVariable:0 TimeVariable:'t't't't't't't't't't't't'该组描述的回归器

As an alternative, you can create the regressor specification first using the variables and lags and set the允许Variablemix之后使用点表示法。

reg1 = polyenmialRegressor(vars,lags);Reg1.AllowVariablemix = true
reg1 =订单2变量中的回归器y1,u1订单:2变量:{'y1''u1'} lags:{[1] [1]} useAbsolute:[0 0]允许variablemblemix:1允许lagagmix:1 allowlagmix:0 timevariable:0 TimeVarable:'t't't't't't't't't't't't't't't'该组描述的回归器

利用reg1在非线性ARX模型中。

loadtwotankdatayu;z = iddata(y,u,'ts',0.1);sys = nlarx(z,reg1);

View the regressors.

getReg(sys)
ans =3x1单元{'y1(t-1)^2' } {'u1(t-1)^2' } {'y1(t-1)*u1(t-1)'}

回归器包含可变变量的条款。

指定一个多项式回归器集,该集合包含表单的项 u ( t ) u ( t - 3 )

指定变量名和滞后。

vars = {'y1','u1'};lags = {2,[0 3]};

Initialize a second-order polynomial regressor.

reg = polyenmialRegressor(vars,lags);

指定regressor use mixed lags.

reg.AllowLagMix = true;

使用非线性ARX模型中的回归器集。

loadtwotankdatayu;z = iddata(y,u,'ts',0.1);sys = nlarx(z,reg);

View the regressors.

getReg(sys)
ans =4x1 cell{'y1(t-2)^2'} {'u1(t)^2'} {'u1(t-3)^2'} {'u1(t)*u1(t-3)'}

回归器包括混合延迟项。

加载数据并创建一个iddataobjectz

loadtwotankdatayuz = iddata(y,u,'ts',0.1);

指定具有表格的多项式回归器 u ( t - 2 ) 2 u ( t - 4 ) 2 。还指定表单的线性回归器 y ( t - 1 )

指定the input lag.

ulags = {[2 4]};

指定多项式回归器。默认回归器订单是2

preg = polyenmialRegressor(z.inputname,ulags);

指定输出滞后并指定线性回归器。

llags = 1;lreg = LinearRegressor(Z.Outputname,llags);

估计非线性ARX模型。

reg = [preg; lreg]
reg = [2 1] array of polynomialRegressor, linearRegressor objects. ------------------------------------ 1. Order 2 regressors in variables u1 Order: 2 Variables: {'u1'} Lags: {[2 4]} UseAbsolute: 0 AllowVariableMix: 0 AllowLagMix: 0 TimeVariable: 't' ------------------------------------ 2. Linear regressors in variables y1 Variables: {'y1'} Lags: {[1]} UseAbsolute: 0 TimeVariable: 't' Regressors described by this set
sys = nlarx(z,reg)
SYS =具有1个输出和1个输入输入的非线性ARX模型:U1输出:Y1回归器:1。变量中的线性回归器Y1 2.订单2变量中的RENALBLES U1列表U1列表U1列表U1输出功能:带有21个单位的小波网络样本时间:0.1秒状态:使用NLARX在时域数据“ Z”上估算。适合估计数据:96.56%(预测焦点)FPE:4.133E-05,MSE:4.059E-05

View the regressors.

getReg(sys)
ans =3x1单元{'u1(t-2)^2'} {'u1(t-4)^2'} {'y1(t-1)'}

加载估计数据Z1,它具有一个输入和一个输出,并获得输出和输入名称。

loadIDDATA1Z1;名称=[z1.OutputName z1.InputName]
名称=1x2 cell{'y1'} {'u1'}

指定Las the set of linear regressors that represents y 1 ( t - 1 ) , u 1 ( t - 2 ) , 和 u 1 ( t - 5 )

l = linearRegressor(名称,{1,[2 5]});

指定P作为多项式回归器 y 1 ( t - 1 ) 2

p = polyenmialRegressor(名称(1),1,2);

指定C作为自定义回归器 y 1 ( t - 2 ) u 1 ( t - 3 ) 。利用an anonymous function handle to define this function.

C = CustomRegressor(名称,{2 3},@(x,y)x。*y)
c =自定义回归器:y1(t-2)。*u1(t-3)variablestoregressorfcn: @(x,y)x。}矢量化:1个时间变量:此集描述的“ T”回归剂

Combine the regressors in the column vectorR

r = [l; p; c]
r = [3 1]线性Regressor,polyenmialRegressor,CustomRegressor对象的数组。-------------------------------------------- 1.变量中的线性回归器Y1,U1变量:{'Y1''u1'} lags:{[1] [2 5]} useabsolute:[0 0] timeVariable:'t'------------------------------------------------------------------ 2.订单2变量中的回归器y1顺序:2变量:{'y1'}滞后:{[1]} useAbsolute:0 allowvariablemimix:0允许lagmix:0允许:0 TimeVariable:'T'----------------------------------------------- 3.自定义回归器:Y1(T-2)。*u1(t-3)variablestoregressorfcn: @(x,y)x。这套

估计具有的非线性ARX模型R

系统= nlarx(z1,R)
SYS =具有1个输出和1个输入输入的非线性ARX模型:U1输出:Y1回归器:1。变量中的线性回归器Y1,U1 2.订购2个变量中的Recressor y1 3.自定义回归器:y1(t-2)。*U1*U1(T-3)所有回归器输出功能的列表:带有1个单位样本时间的小波网络:0.1秒状态:使用NLARX在时域数据“ Z1”上估算。适合估计数据:59.73%(预测焦点)FPE:3.356,MSE:3.147

View the full regressor set.

getReg(sys)
ans =5x1单元{'y1(t-1)'} {'u1(t-2)'} {'u1(t-5)'} {'y1(t-1)^2'} {'y1(t-2)。*u1(t-3)'}

Version History

Introduced in R2021a