使用Matlab的ar函数进行AR模型估算:哪里出了问题?

问题描述

我正在尝试使用https://www.mathworks.com/help/ident/ref/ar.html中给出的最小二乘法来估计2级,长度3的AR(2)模型的系数。

请问有人可以帮助我更正我的代码以及关于OLS为什么不能给出AR(2)模型的真实估计的概念。该代码返回以下结构。我是否需要进行几次试验或其他操作,以便获得正确的估算值。 MSE很高,估计参数与实际值之间的误差也很高。我要去哪里错了?

clear
h =[1,0.195,- 0.95]; %true coefficients
L=length(h);
N=500; %number of datapoints
x=randn(1,N); %driving signal

y(1) = 0.1;
y(2) = 0.2;

% Generate the AR model.
for i =3 : N
    y(i) = 0.195 *y(i-1) -0.95*y(i-2) + x(i);
end

mdl = ar(y',2);
----------------------

结果:

Discrete-time AR model: A(z)y(t) = e(t)
A(z) = 1 - 0.2032 z^-1 + 0.9584 z^-2

Sample time: 1 seconds

Parameterization:
Polynomial orders:   na=2
Number of free coefficients: 2
Use "polydata","getpvec","getcov" for parameters and their uncertainties.
    
    Status:
    Estimated using AR ('fb/now') on time domain data.
    Fit to estimation data: 71.6%
    FPE: 1.127e+04,MSE: 1.11e+04 

 
    

解决方法

暂无找到可以解决该程序问题的有效方法,小编努力寻找整理中!

如果你已经找到好的解决方法,欢迎将解决方案带上本链接一起发送给小编。

小编邮箱:dio#foxmail.com (将#修改为@)

相关问答

错误1:Request method ‘DELETE‘ not supported 错误还原:...
错误1:启动docker镜像时报错:Error response from daemon:...
错误1:private field ‘xxx‘ is never assigned 按Alt...
报错如下,通过源不能下载,最后警告pip需升级版本 Requirem...