polyenmialRegressor
为非线性ARX模型指定多项式回归器
描述
多项式回归器是由延迟输入和输出变量组成的多项式。例如,y(t–1)2和y(t–1)u(t1)都是多项式解释变量的命令2 and variable delays of one sample. ApolyenmialRegressor
object encapsulates a set of polynomial regressors. UsepolyenmialRegressor
当您使用非线性ARX模型时idnlarx
或者Nlarx
。You can specifypolyenmialRegressor
objects along with线性重构器
,周期性重物
, 和CustomRegressor
objects and combine them into a single combined regressor set.
创建
Syntax
描述
创建一个preg
= polynomialRegressor(Variables,Lags,Order)polyenmialRegressor
订单的对象命令
。
指定preg
= polynomialRegressor(Variables,Lags,Order,UseAbsolute)利用Absolute
是否使用变量的绝对值来创建回归剂。
指定preg
= polyenmialRegressor(变量,滞后,订单,useabsolute,abervariablemix)允许Variablemix
whether 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)2和u(t–1)2。
指定preg
= polynomialRegressor(Variables,Lags,Order,UseAbsolute,AllowVariableMix,AllowLagMix)AllowLagMix
whether 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
, 和允许Variablemix
is 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)。
特性
变量
—输出和输入变量名称
细胞阵列|iddata
对象属性
输出和输入变量名称,指定为字符串或单元格数组的单元格数组输出名称
和InputName
An的属性iddata
目的。每个条目必须是一个没有特殊字符的字符串。有关使用此属性的示例,请参见Estimate Nonlinear ARX Model with Polynomial Regressors。
例子:{'y1','u1'}
例子:[z.Outputname;Z.InputName]''
滞后
—每个变量中的滞后
cell array of non-negative integers
每个变量中的滞后,指定为1乘nvcell array of non-negative integer row vectors, wherenv是回归变量的总数。每个行向量都包含nr指定的整数nr相应变量的回归滞后。例如,假设您需要以下回归量:
Output variabley1:y1(t–1)2和y1(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]}
利用Absolute
—绝对值指示器
false
(默认)|逻辑向量
允许Variablemix
—Mixed variables indicator
false
(默认)|逻辑向量
混合变量指标确定是否在回归器公式中使用多个变量,例如y(t–1)u(t–1),指定为逻辑向量,长度等于变量数。
有关设置此属性的示例,请参阅利用Multiple Variables in Polynomial Regressor Term。
例子:[true,false]
AllowLagMix
—混合滞后指示器
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]
时间变化
—时间名称变量
't'
(默认)|字符阵列|细绳
Name of the time variable, specified as a valid MATLAB®可变名称与值不同变量
。
例子:'ClockTime'
例子
Estimate Nonlinear ARX Model with Polynomial Regressors
加载数据并创建一个iddata
objectz
样品时间为0.1秒。
loadtwotankdatayuz = iddata(y,u,'ts',0.1);
指定具有表格的多项式回归器 , , 和 。
利用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'}
指定命令for Polynomial Regressor
指定三阶多项式回归器 。
变量='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
利用Multiple Variables in Polynomial Regressor Term
Create a polynomial regressor set that includes the terms , , 和 。
指定变量和滞后。
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)'}
回归器包含可变变量的条款。
在多项式回归器项中使用混合滞后
指定一个多项式回归器集,该集合包含表单的项 。
指定变量名和滞后。
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)'}
回归器包括混合延迟项。
用多项式和线性回归器估计非线性ARX模型
加载数据并创建一个iddata
objectz
。
loadtwotankdatayuz = iddata(y,u,'ts',0.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'}
指定L
as the set of linear regressors that represents
,
, 和
。
l = linearRegressor(名称,{1,[2 5]});
指定P
作为多项式回归器
。
p = polyenmialRegressor(名称(1),1,2);
指定C
作为自定义回归器
。利用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
matlab命令
You clicked a link that corresponds to this MATLAB command:
通过在MATLAB命令窗口中输入该命令。Web浏览器不支持MATLAB命令。万博1manbetx
您还可以从以下列表中选择一个网站:
如何获得最佳网站性能
Select the China site (in Chinese or English) for best site performance. Other MathWorks country sites are not optimized for visits from your location.
Americas
- AméricaLatina(Español)
- Canada(英语)
- United States(英语)