主要内容

佩姆

预测误差最小化线性和非线性模型

描述

example

sys= pem(数据,init_sys)更新初始模型的参数以符合估计数据。该函数使用预测 - 纠纷最小化算法来更新初始模型的参数。使用此命令来完善先前估计的模型的参数。

example

sys= pem(数据,init_sys,opt)使用选项集指定估计选项。

例子

全部收缩

Estimate a discrete-time state-space model using the subspace method. Then, refine it by minimizing the prediction error.

Estimate a discrete-time state-space model usingN4SID, which applies the subspace method.

loadiddata7Z7;Z7a = z7(1:300); opt = n4sidOptions('重点','模拟');init_sys = n4sid(z7a,4,opt);

init_sys为估计数据提供73.85%的拟合度。

init_sys.report.fit.fitpercent
ANS = 73.8490

利用佩姆提高拟合的亲密关系。

sys = pem(z7a,init_sys);

Analyze the results.

比较(z7a,sys,init_sys);

Figure contains an axes. The axes contains 3 objects of type line. These objects represent z7a (y1), sys: 74.54%, init\_sys: 73.85%.

sysprovides a 74.54% fit to the estimation data.

估计非线性灰色框模型的参数以适合直流电动机数据。

加载实验数据,并指定信号属性,例如开始时间和单位。

负载(fullfile(Matlabroot,,'工具箱',“身份”,'iddemos','数据','dcmotordata');data = iddata(y,u,0.1);data.tstart = 0;data.timeunit ='s';

配置非线性灰色框模型(艾德格里) 模型。

对于此示例,请使用dcmotor_m.m文件。要查看此文件,请输入edit dcmotor_m.mat the MATLAB® command prompt.

file_name ='dcmotor_m';顺序= [2 1 2];参数= [1; 0.28];onirom_states = [0; 0];TS = 0;init_sys = idnlgrey(file_name,order,parameters,initial_states,ts);init_sys.timeunit ='s';setinit(init_sys,'Fixed',{false false});

init_sysis a nonlinear grey-box model with its structure described bydcmotor_m.m。该模型具有一个输入,两个输出和两个状态,如命令

setInit(init_sys,'recied',{false false})指定init_sysare free estimation parameters.

估计模型参数和初始状态。

sys = pem(data,init_sys);

sys是一个艾德格里model, which encapsulates the estimated parameters and their covariance.

分析估计结果。

compare(data,sys,init_sys);

图包含2轴。轴1包含3对象of type line. These objects represent data (y1), sys: 98.34%, init\_sys: 79.39%. Axes 2 contains 3 objects of type line. These objects represent data (y2), sys: 84.48%, init\_sys: 49.15%.

sys为估计数据提供98.34%的拟合度。

Create a process model structure and update its parameter values to minimize prediction error.

Initialize the coefficients of a process model.

init_sys = idproc('p2udz');init_sys.kp = 10;init_sys.tw = 0.4;init_sys.zeta = 0.5;init_sys.td = 0.1;init_sys.tz = 0.01;

TheKP,Tw,Zeta,Td, 和Tz系数init_sys用他们的初始猜测配置。

利用init_sys配置估计of a prediction error minimizing model using measured data. Becauseinit_sys是一个idprocmodel, useprocestOptions创建选项集。

loadIDDATA1Z1;opt = procestoptions('展示','on','SearchMethod','lm');sys = pem(z1,init_sys,opt);
Process Model Identification Estimation data: Time domain data z1 Data has 1 outputs, 1 inputs and 300 samples. Model Type: {'P2DUZ'} Algorithm: Levenberg-Marquardt search 
------------------------------------------------------------------------------------------
Norm of First-order Improvement (%)
Iteration Cost step optimality Expected Achieved Bisections
------------------------------------------------------------------------------------------ 0 21.2201 - 414 3.8 - - 1 19.4048 1.15 323 3.8 8.55 7 2 14.8743 2.48 814 4.41 23.3 0 3 6.84305 0.873 451 4.43 54 11 4 5.20354 0.977 1.49e+03 8.75 24 7 5 1.83911 0.973 473 13 64.7 0 6 1.67582 0.225 20.3 4.98 8.88 0 7 1.67335 0.062 6.57 0.0829 0.147 0 8 1.67334 0.00494 0.0555 0.000374 0.000648 0 ------------------------------------------------------------------------------------------ Termination condition: Near (local) minimum, (norm(g) < tol).. Number of iterations: 8, Number of function evaluations: 42 Status: Estimated using PEM Fit to estimation data: 70.63%, FPE: 1.73006

检查模型拟合。

sys.report.fit.fitpercent
ANS = 70.6330

sys为测量数据提供70.63%的拟合度。

输入参数

全部收缩

包含测量输入输出数据的估计数据,指定为iddata或者IDFRD目的。您只能在init_sys是线性模型。

The input-output dimensions of数据init_sys必须匹配。

确定的模型,配置了初始参数化的sys,指定为线性, or非线性模型。您可以获得init_sysby performing an estimation using measured data or by direct construction.

init_sysmust have finite parameter values. You can configure initial guesses, specify minimum/maximum bounds, and fix or free for estimating any parameter ofinit_sys:

  • For linear models, use the结构财产。有关更多信息,请参阅对模型参数值施加约束

  • 对于非线性灰色框架,请使用InitialStatesParametersproperties. Parameter constraints cannot be specified for nonlinear ARX and Hammerstein-Wiener models.

Estimation options that configure the algorithm settings, handling of estimation focus, initial conditions, and data offsets, specified as an option set. The command used to create the option set depends on the initial model type:

Output Arguments

全部收缩

已识别的模型,返回为同一模型类型与init_sys。The model is obtained by estimating the free parameters ofinit_sys使用预测误差最小化算法。

算法

PEM使用数值优化来最小化成本功能,预测误差的加权规范,定义为标量输出的如下:

V N ( G , H ) = t = 1 N e 2 ( t )

wheree(t)is the difference between the measured output and the predicted output of the model. For a linear model, the error is defined as:

e ( t ) = H 1 ( q ) [ y ( t ) G ( q ) u ( t ) ]

wheree(t)是向量和成本功能 V N ( G , H ) 是标量值。下标N表明成本函数是数据样本数量的函数,并且对于更大的值而言变得更准确N。对于多出输出模型,先前的方程式更为复杂。有关更多信息,请参见第7章System Identification: Theory for the User, Second Edition, by Lennart Ljung, Prentice Hall PTR, 1999.

替代功能

You can achieve the same results as佩姆通过为各种模型结构使用专用估算命令。例如,使用sest(数据,init_sys)for estimating state-space models.

在R2006a之前引入