How to automate ARIMA model 'order' selection based on ACF and PACF plots?

30 ビュー (過去 30 日間)
na ja
na ja 2016 年 10 月 3 日
コメント済み: Hamed Majidiyan 2022 年 3 月 8 日
While modeling in MATLAB, we have to provide values of p, d and q in arima(p,d,q) implementation, by observing ACF - PACF plots and may be differencing the data afterwards. Is there a way so that these values can be assigned automatically from ACF - PACF plots and AIC test? I know, there are some other factors affecting these input argument values. But, for beginning I would be focusing on ACF - PACF plot, AIC test and need of differentiating the data only. The aim of this procedure is to get best fit possible.

採用された回答

Asad (Mehrzad) Khoddam
Asad (Mehrzad) Khoddam 2016 年 10 月 3 日
編集済み: Asad (Mehrzad) Khoddam 2016 年 10 月 3 日
I am not sure that it is your answer or not. But I have used this function to find the best values for p and q for a given time series y
function ar=checkArima(y,pp,qq)
% pp is the maximum for p
% qq is the maximum for q
LOGL = zeros(pp+1,qq+1); %Initialize
PQ = zeros(pp+1,qq+1);
for p = 1:pp+1
for q = 1:qq+1
mod = arima(p-1,0,q-1)
[fit,~,logL] = estimate(mod,y,'print',false);
LOGL(p,q) = logL;
PQ(p,q) = p+q;
end
end
LOGL = reshape(LOGL,(pp+1)*(qq+1),1);
PQ = reshape(PQ,(pp+1)*(qq+1),1);
[~,bic] = aicbic(LOGL,PQ+1,100);
ar=reshape(bic,pp+1,qq+1);
% the rows correspond to the AR degree (p) and the
% columns correspond to the MA degree (q). The smallest value is best
  3 件のコメント
Hamed Majidiyan
Hamed Majidiyan 2022 年 3 月 7 日
Hi Asad,
Thanks for the code in advance. I ran the code and I got the following results, even though I don't know how to intrepret the outcomes, so any help would be highly appreciated
ARMA=checkarma(datac_chunk,2,1,2)
ARMA(:,:,1) =
1.0e+05 *
-0.9306 -1.7988 -0.9305
-1.7988 -2.5917 -1.6927
-2.6918 -3.0212 -0.0683
ARMA(:,:,2) =
1.0e+05 *
-1.7987 -0.9305 -1.7987
-2.5914 -1.6966 -2.5907
-1.7986 -1.5608 -3.1177
Hamed Majidiyan
Hamed Majidiyan 2022 年 3 月 8 日
Hi Asad,
Thanks for the code in advance. I ran the code and I got the following results, even though I don't know how to intrepret the outcomes, so any help would be highly appreciated
ARMA=checkarma(datac_chunk,2,1,2)
ARMA(:,:,1) =
1.0e+05 *
-0.9306 -1.7988 -0.9305
-1.7988 -2.5917 -1.6927
-2.6918 -3.0212 -0.0683
ARMA(:,:,2) =
1.0e+05 *
-1.7987 -0.9305 -1.7987
-2.5914 -1.6966 -2.5907
-1.7986 -1.5608 -3.1177

サインインしてコメントする。

その他の回答 (0 件)

カテゴリ

Help Center および File ExchangeConditional Mean Models についてさらに検索

Community Treasure Hunt

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

Start Hunting!

Translated by