0

假设我们遵循模型

https://dsp.stackexchange.com/questions/15326/can-someone-show-the-details-of-how-to-apply-aic-for-sinusoidal-models-to-specif

其中epsilon是白噪声,我尝试了以下代码

function [aic_matrix,bic_matrix]=ARMA_model(y,n);
%n possible order of each model
LOGL = zeros(n,n); %Initialize
PQ = zeros(n,n);
for p = 1:n
    for q = 1:n
        mod = arima(p,0,p);
        [fit,~,logL] = estimate(mod,y,'print',false);
        LOGL(p,q) = logL;
        PQ(p,q) = p+q;
     end
end
LOGL = reshape(LOGL,n*n,1);
PQ = reshape(PQ,n*n,1);
[aic1,bic1] = aicbic(LOGL,PQ+1,length(y));
aic_matrix=reshape(aic1,n,n);
bic_matrix=reshape(bic1,n,n);
end

但是当我运行以下命令时

[aic_matric,bic_matrix]=ARMA_model(B,100);

我得到了结果

Error using arima/validateModel (line 1314)
The non-seasonal moving average polynomial is non-invertible.

Error in arima/setLagOp (line 391)
   Mdl = validateModel(Mdl);

Error in arima/estimate (line 1183)
  Mdl = setLagOp(Mdl, 'MA' , LagOp([1  coefficients(iMA)' ], 'Lags', [0 LagsMA ]));

Error in ARMA_model (line 9)
        [fit,~,logL] = estimate(mod,y,'print',false);

这是否意味着该信号是非平稳的?与我的代码有关的问题是什么?请帮助我

4

1 回答 1

1

我认为这条线是不正确的:

mod = arima(p,0,p); 

我认为应该是

mod = arima(p,0,q);

此外,您真的不希望系统的 MA 部分具有比 AR 部分更高的顺序(如果错误得到修复,您的循环将执行此操作)。循环

for q = 1:n 

应该读

for q = 1:p.

除了这些问题之外,您的代码似乎还可以。

于 2014-03-31T12:09:32.920 回答