Why I am getting error for performing AIC test for model orders varying in 0:3 range?

조회 수: 1(최근 30일)
na ja
na ja 2016년 10월 6일
댓글: na ja 2016년 10월 7일
For ARIMA(p,d,q) if AIC test is applied for p,q = 0:3 keeping d = 0 and 1, it shows error. I want to confirm for possibilities when p and/or q = 0 also. What can be done to achieve so? This is my code.
LOGL = zeros(4,4);
PQ = zeros(4,4);
for p = 0:3
for q = 0:3
mod = arima(p,1,q);
[fit,~,logL] = estimate(mod,z,'print',false);
LOGL(p,q) = logL;
PQ(p,q) = p+q;
LOGL = reshape(LOGL,16,1);
PQ = reshape(PQ,16,1);
[aic,bic] = aicbic(LOGL,PQ+1,100);
the error is due to log function. Is there any way to achieve what I want?

채택된 답변

Brendan Hamm
Brendan Hamm 2016년 10월 7일
MATLAB indexing starts at 1, so when wither p or q is equal to 0 your indexing,
LOGL(p,q) = logL;
PQ(p,q) = p+q;
will fail. Change this to:
LOGL(p+1,q+1) = logL;
PQ(p+1,q+1) = p+q;

추가 답변(0개)

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by