从给定信号估计AIC / BIC标准

时间:2014-03-31 05:51:36

标签: matlab signals signal-processing autoregressive-models

假设我们遵循模型

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);

是否意味着此信号不稳定?与我的代码有关的问题是什么?请帮帮我

1 个答案:

答案 0 :(得分:1)

我认为这一行不正确:

mod = arima(p,0,p); 

我认为应该是

mod = arima(p,0,q);

另外,你真的不希望系统的MA部分具有比AR部分更高的顺序(如果错误被修复,那么你的循环会做什么)。循环

for q = 1:n 

应该阅读

for q = 1:p.

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