finding best value for ARIMA (p,d,q) model?
14 views (last 30 days)
Show older comments
ANURAG DEEPAK
on 30 Jan 2020
Commented: Hamed Majidiyan
on 7 Mar 2022
function ar = checkarma(y,pp,dd,qq)
LOGL = zeros(pp+1,dd+1,qq+1);
PQ = zeros(pp+1,dd+1,qq+1);
for p = 1:pp+1
for d = 1:dd+1
for q = 1:qq+1
mod = arima(p-1,d-1,q-1)
[fit,~,logL] = estimate(mod,y,'print',false);
LOGL(p,d,q) = logL;
PQ(p,d,q) = p+d+q;
end
end
end
LOGL = reshape(LOGL,(pp+1)*(qq+1)*(dd+1),1);
PQ = reshape(PQ,(pp+1)*(qq+1)*(dd+1),1);
[~,bic] = aicbic(LOGL,PQ+1,100);
ar = reshape(bic,pp+1,qq+1,dd+1);
Sir, i have a univariate time-series y having 10 values and i want to estimate optimum (p,d,q) values for ARIMA model.... it is giving error 'print is not a recongnized parameter'.
1 Comment
Darren Lim
on 3 Mar 2021
Hi Anurag,
I am pretty new to matlab , may i know how do i get the best p , d and q from the matrix ar ? Thx!
i try to use min(ar) and get the below result in my sample test.
(:,:,1) =
805.4103 811.6983 882.3894
(:,:,2) =
809.4923 815.7831 831.8577
(:,:,3) =
813.9255 820.2356 833.2110
but i am not sure how it translate to get the best p , d and q, thanks!
Darren
Accepted Answer
Divya Gaddipati
on 11 Feb 2020
The estimate function doesn't have "print" as a Name-Value pair argument.
Instead, you can use something like this to turn off displaying the result from the function:
[fit, ~, logL] = estimate(mod, y, 'Display', 'off');
Hope this helps!
2 Comments
Hamed Majidiyan
on 7 Mar 2022
Hi Divya,
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
More Answers (0)
See Also
Categories
Find more on Conditional Mean Models in Help Center and File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!