Main Content

polyest

使用时间或频域数据估算多项式模型

Syntax

sys = polyest(data,[na nb nc nd nf nk])
sys =保利(数据,(na nb数控nd nf nk)名称、值)
sys = polyest(data,init_sys)
sys = polyest(___, opt)
[sys,ic] = polyest(___)

Description

sys= polyest(data,[[NANBNCndnfNK])estimates a polynomial model,sys,使用时间或频域数据,data.

sysis of the form

A ( q ) y ( t ) = B ( q ) F ( q ) u ( t - n k ) + C ( q ) D ( q ) e ( t )

A(q),B(q),F(q),C(q)ndD(q)是多项式矩阵。u(t)是输入,NK是输入延迟。y(t)是输出,e(t)是干扰信号。NA,NB,NC,ndnfare the orders of theA(q),B(q),C(q),D(q)ndF(q)多项式。

sys= polyest(data,[[NANBNCndnfNK],名称,价值)estimates a polynomial model with additional attributes of the estimated model structure specified by one or more名称,价值pair arguments.

sys= polyest(data,init_sys)estimates a polynomial model using the linear systeminit_systo configure the initial parameterization.

sys= polyest(___,opt)estimates a polynomial model using the option set,opt, to specify estimation behavior.

[sys,我知道了] = polyest(___)返回估计的初始条件作为initialCondition目的。如果您计划使用相同的估计输入数据模拟或预测模型响应,则使用此语法,然后将响应与相同的估计输出数据进行比较。在模拟的第一部分中,结合初始条件可以更好地匹配。

输入参数

data

Estimation data.

对于时间域估计,datais aniddata包含输入和输出信号值的对象。

You can estimate only discrete-time models using time-domain data. For estimating continuous-time models using time-domain data, seetfest.

For frequency-domain estimation,datacan be one of the following:

  • 记录的频率响应数据(FRD(Control System Toolbox)或者idfrd)

  • iddata对象具有其属性,如下所示:

    • InputData- 输入信号的傅立叶变换

    • OutputData— Fourier transform of the output signal

    • Domain— ‘Frequency’

    It may be more convenient to useOE或者tfestto estimate a model for frequency-domain data.

NA

多项式的顺序A(q)。

NAis an纽约-by-纽约matrix of nonnegative integers.纽约是输出的数量,nuis the number of inputs.

NAmust be zero if you are estimating a model using frequency-domain data.

NB

多项式的顺序B(q) + 1.

NBis an纽约-by-numatrix of nonnegative integers.纽约是输出的数量,nuis the number of inputs.

NC

多项式的顺序C(q)。

NCis a column vector of nonnegative integers of length纽约.纽约是输出数。

NCmust be zero if you are estimating a model using frequency-domain data.

nd

多项式的顺序D(q)。

ndis a column vector of nonnegative integers of length纽约.纽约是输出数。

ndmust be zero if you are estimating a model using frequency-domain data.

nf

多项式的顺序F(q)。

nfis an纽约-by-numatrix of nonnegative integers.纽约是输出的数量,nuis the number of inputs.

NK

输入的样品数量延迟,表示为固定的前导零Bpolynomial.

NKis an纽约-by-numatrix of nonnegative integers.

NKmust be zero when estimating a continuous-time model.

opt

估计选项。

optis an options set, created usingpolyestOptions,指定估计选项,包括:

  • 估计目标

  • Handling of initial conditions

  • numerical search method to be used in estimation

init_sys

配置初始参数化的线性系统sys.

You obtaininit_sysby either performing an estimation using measured data or by direct construction.

如果init_sysis anidpolymodel,polyest使用parameters and constraints defined ininit_sysas the initial guess for estimatingsys.

利用the结构property ofinit_systo configure initial guesses and constraints forA(q),B(q),F(q),C(q), 和D(q)。For example:

  • To specify an initial guess for theA(q) term ofinit_sys, setinit_sys.Structure.A.Valueas the initial guess.

  • 指定约束B(q) term ofinit_sys:

    • Setinit_sys.structure.b.minimineto the minimumB(q) coefficient values.

    • Setinit_sys.structure.b.maximumto the maximumB(q) coefficient values.

    • Setinit_sys.Structure.B.Freeto indicate whichB(q) coefficients are free for estimation.

如果init_sys不是idpolymodel, the software first convertsinit_systo a polynomial model.polyest使用parameters of the resulting model as the initial guess for estimation.

如果opt未指定,init_sysis created by estimation, then the estimation options frominit_sys.Report.OptionsUsedare used.

名称值对参数

Specify optional comma-separated pairs of名称,价值arguments.Nameis the argument name and价值是相应的值。Name必须出现在引号中。您可以按任何顺序指定几个名称和值对参数Name1,Value1,...,NameN,ValueN.

'IODelay'

Transport delays.IODelayis a numeric array specifying a separate transport delay for each input/output pair.

For continuous-time systems, specify transport delays in the time unit stored in theTimeUnitproperty. For discrete-time systems, specify transport delays in integer multiples of the sample time,Ts.

用于带有的MIMO系统纽约outputs andnuinputs, setIODelayto a纽约-by-nu大批。该数组的每个条目都是一个数值值,代表相应的输入/输出对的传输延迟。您也可以设置IODelayto a scalar value to apply the same delay to all input/output pairs.

Default:0对于所有输入/输出对

“ inputdelay'

Input delay for each input channel, specified as a scalar value or numeric vector. For continuous-time systems, specify input delays in the time unit stored in theTimeUnitproperty. For discrete-time systems, specify input delays in integer multiples of the sample timeTs. For example,InputDelay = 3means a delay of three sample times.

For a system withnuinputs, setInputDelay到一个nu-by-1 vector. Each entry of this vector is a numerical value that represents the input delay for the corresponding input channel.

您也可以设置InputDelay标量值将相同的延迟应用于所有通道。

Default:0

'IntegrateNoise'

Logical vector specifying integrators in the noise channel.

IntegrateNoise是长度的逻辑向量纽约, where纽约是输出数。

SettingIntegrateNoiseto真的对于特定的输出导致模型:

A ( q ) y ( t ) = B ( q ) F ( q ) u ( t - n k ) + C ( q ) D ( q ) e ( t ) 1 - q - 1

在哪里, 1 1 - q - 1 是噪声通道中的集成器,e(t)。

利用IntegrateNoiseto create an ARIMAX model.

For example,

loadiddata1z1;z1 = iddata(cumsum(z1.y),cumsum(z1.u),z1.Ts,'InterSample','foh');sys = polyest(z1, [2 2 2 0 0 1],'IntegrateNoise',true);

Output Arguments

sys

Polynomial model, returned as anidpolymodel. This model is created using the specified model orders, delays, and estimation options.

如果data.tsis zero,sys是代表的连续时间模型:

Y ( s ) = B ( s ) F ( s ) U ( s ) + E ( s )

Y(s),U(s)ndE(s)re the Laplace transforms of the time-domain signalsy(t),u(t)nde(t),respectively.

Information about the estimation results and options used is stored in theReport模型的属性。Reporthave the following fields:

Report Field Description
Status

Summary of the model status, which indicates whether the model was created by construction or obtained by estimation.

Method

使用的估计命令。

初始条件

Handling of initial conditions during model estimation, returned as one of the following values:

  • 'zero'— The initial conditions were set to zero.

  • '估计'— The initial conditions were treated as independent estimation parameters.

  • “反广播”— The initial conditions were estimated using the best least squares fit.

This field is especially useful to view how the initial conditions were handled when the初始条件选项inthe estimation option set is'auto'.

Fit

Quantitative assessment of the estimation, returned as a structure. See损失功能和模型质量指标有关这些质量指标的更多信息。该结构具有以下字段:

Field Description
FitPercent

标准化的根平方误差(NRMSE)测量模型的响应拟合估计数据的效果,以百分比表示fit= 100(1-NRMSE).

Lossfcn

价值of the loss function when the estimation completes.

MSE

Mean squared error (MSE) measure of how well the response of the model fits the estimation data.

FPE

模型的最终预测错误。

AIC

Raw Akaike Information Criteria (AIC) measure of model quality.

AICc

Small sample-size corrected AIC.

naic

Normalized AIC.

BIC

Bayesian Information Criteria (BIC).

Parameters

Estimated values of model parameters.

OptionsUsed

选项设置用于估计。如果没有定义啊ptions were configured, this is a set of default options. SeepolyestOptionsfor more information.

RandState

估计开始时随机数流的状态。空的,[],如果在估计过程中未使用随机化。有关更多信息,请参阅RNG.

DataUsed

Attributes of the data used for estimation, returned as a structure with the following fields:

Field Description
Name

Name of the data set.

Type

Data type.

Length

数据样本的数量。

Ts

Sample time.

InterSample

Input intersample behavior, returned as one of the following values:

  • 'zoh'— Zero-order hold maintains a piecewise-constant input signal between samples.

  • 'foh'- 一阶保持在样品之间保持分段线性输入信号。

  • 'bl'— Band-limited behavior specifies that the continuous-time input signal has zero power above the Nyquist frequency.

输入

Offset removed from time-domain input data during estimation. For nonlinear models, it is[].

OutputOffset

Offset removed from time-domain output data during estimation. For nonlinear models, it is[].

Termination

Termination conditions for the iterative search used for prediction error minimization, returned as a structure with the following fields:

Field Description
为什么挡住

Reason for terminating the numerical search.

Iterations

估计算法执行的搜索迭代次数。

FirstOrderOptimality

-norm of the gradient search vector when the search algorithm terminates.

FcnCount

number of times the objective function was called.

UpdateNorm

最后一次迭代中梯度搜索向量的规范。搜索方法是'lsqnonlin'或者'fmincon'.

LastImprovement

Criterion improvement in the last iteration, expressed as a percentage. Omitted when the search method is'lsqnonlin'或者'fmincon'.

Algorithm

Algorithm used by'lsqnonlin'或者'fmincon'search method. Omitted when other search methods are used.

For estimation methods that do not require numerical search optimization, theTermination省略了字段。

For more information on usingReport, seeEstimation Report.

我知道了

Estimated initial conditions, returned as aninitialConditionobject or an object array ofinitialConditionvalues.

  • For a single-experiment data set,我知道了represents, in state-space form, the free response of the transfer function model (ACmatrices) to the estimated initial states (x0)。

  • 对于带有多个实验数据集的Ne实验,我知道了is an object array of lengthNe其中包含一组initialConditionvalues for each experiment.

如果polyestreturns我知道了values of0和the you know that you have non-zero initial conditions, set the'InitialCondition'选项inpolyestOptionsto'估计'和pass the updated option set topolyest. For example:

opt = polyestotions('InitialCondition,'estimate') [sys,ic] = polyest(data,[nb nc nd nf nk],opt)
默认值'auto'setting of'InitialCondition'使用'zero'method when the initial conditions have a negligible effect on the overall estimation-error minimization process. Specifying'估计'ensures that the software estimates values for我知道了.

有关更多信息,请参阅initialCondition. For an example of using this argument, seeObtain Initial Conditions.

Examples

全部收缩

Estimate a model with redundant parameterization. That is, a model with all polynomials ( A , B , C , D , 和 F ) 积极的。

Load estimation data.

loadiddata2z2;

Specify the model orders and delays.

Na = 2;NB = 2;NC = 3;nd = 3;nf = 2;nk = 1;

Estimate the model.

sys = polyest(z2,[na nb nc nd nf nk]);

通过转换正则化ARX模型来估计正则多项式模型。

Load estimation data.

load正则化exampledata.matm0simdata;

Estimate an unregularized polynomial model of order 20.

m1 = polyest(m0simdata(1:150),[0 20 20 20 20 1]);

Estimate a regularized polynomial model of the same order. Determine the Lambda value by trial and error.

opt = polyestOptions; opt.Regularization.Lambda = 1; m2 = polyest(m0simdata(1:150),[0 20 20 20 20 1],opt);

通过转换正则化ARX模型并降低其顺序,获得了低阶多项式模型。利用arxregulto determine the regularization parameters.

[L,R] = arxRegul(m0simdata(1:150),[30 30 1]); opt1 = arxOptions; opt1.Regularization.Lambda = L; opt1.Regularization.R = R; m0 = arx(m0simdata(1:150),[30 30 1],opt1); mr = idpoly(balred(idss(m0),7));

将模型输出与数据进行比较。

opt2 = compareoptions('InitialCondition','Z');compare(m0simdata(150:end),m1,m2,mr,opt2);

Figure contains an axes. The axes contains 4 objects of type line. These objects represent Validation data (y1), m1: 23.82%, m2: 26.09%, mr: 64.91%.

Load input/output data and create cumulative sum input and output signals for estimation.

loadiddata1z1data = iddata (cumsum (z1.y) cumsum (z1.u) z1.Ts,'InterSample','foh');

Specify the model polynomial orders. Set the orders of the inactive polynomials, D F , to0.

Na = 2;NB = 2;NC = 2;nd = 0;nf = 0;nk = 1;

Identify an ARIMAX model by setting the'IntegrateNoise'option to真的.

sys = polyest(data,[na nb nc nd nf nk],'IntegrateNoise',true);

Estimate a multi-output ARMAX model for a multi-input, multi-output data set.

Load estimation data.

loadiddata1z1loadiddata2z2data = [Z1 Z2(1:300)];

data是一个具有2个输入和2个输出的数据集。第一个输入仅影响第一个输出。同样,第二个输入仅影响第二个输出。

Specify the model orders and delays. TheFDpolynomials are inactive.

NA= [2 2; 2 2]; nb = [2 2; 3 4]; nk = [1 1; 0 0]; nc = [2;2]; nd = [0;0]; nf = [0 0; 0 0];

Estimate the model.

sys = polyest(data,[na nb nc nd nf nk]);

In the estimated ARMAX model, the cross terms, which model the effect of the first input on the second output and vice versa, are negligible. If you assigned higher orders to those dynamics, their estimation would show a high level of uncertainty.

Analyze the results.

h = bodeplot(sys);展示信号(H,3)

Figure contains 8 axes. Axes 1 with title From: u1 contains an object of type line. This object represents sys. Axes 2 contains an object of type line. This object represents sys. Axes 3 contains an object of type line. This object represents sys. Axes 4 contains an object of type line. This object represents sys. Axes 5 with title From: u2 contains an object of type line. This object represents sys. Axes 6 contains an object of type line. This object represents sys. Axes 7 contains an object of type line. This object represents sys. Axes 8 contains an object of type line. This object represents sys.

The responses from the cross terms show larger uncertainty.

加载数据。

loadiddata1icz1i

Estimate a polynomial modelsys并返回初始条件我知道了.

Na = 2;NB = 2;NC = 3;nd = 3;nf = 2;nk = 1;[sys,ic] = polyest(z1i,[na nb nc nd nf nk]); ic
我知道了= initialCondition with properties: A: [7x7 double] X0: [7x1 double] C: [0 0 0 0 0 0 1] Ts: 0.1000

我知道了is aninitialConditionobject that encapsulates the free response ofsys, in state-space form, to the initial state vector inX0. You can incorporate我知道了when you simulatesysz1iinput signal and compare the response with thez1ioutput signal.

Tips

  • In most situations, all the polynomials of an identified polynomial model are not simultaneously active. Set one or more of the ordersNA,NC,ndnf零以简化模型结构。

    For example, you can estimate an Output-Error (OE) model by specifyingNA,NCndas zero.

    Alternatively, you can use a dedicated estimating function for the simplified model structure. Linear polynomial estimation functions includeOE,bj,arxArmax.

Alternatives

  • 要使用时间序列数据估算多项式模型,请使用ar.

  • 利用polyestto estimate a polynomial of arbitrary structure. If the structure of the estimated polynomial model is known, that is, you know which polynomials will be active, then use the appropriate dedicated estimating function. For examples, for an ARX model, usearx. Other polynomial model estimating functions include,OE,Armax, 和bj.

  • To estimate a continuous-time transfer function, usetfest. You can also useOE, but only with continuous-time frequency-domain data.

Extended Capabilities

在R2012a中引入