#๐Ÿ”’ How to determine the range of p and q values for ARIMA/SARIMA using ACF and PACF plots ?

48 messages ยท Page 1 of 1 (latest)

random hull
#

Iโ€™m building ARIMA / SARIMA models and want to systematically choose the range of p and q values based on ACF and PACF plots.
Given example ACF and PACF plots:

  1. How should I interpret the threshold values (or upper bounds) for p and q?
  2. More specifically, how can I avoid large ranges for pdq combinations and restrict p, q to some meaningful values suggested by the plots?

Considering the plots given in the images, can anyone please help me for appropriate way to minimize the range for pdq combinations
EOD I'll be using

p_vals = range(0, p_upper_bound)
d_vals = range(0, 1)
q_vals = range(0, q_upper_bound)

pdq_combinations = list(product(p_vals, d_vals, q_vals))

and then fit, predict, evaluate the ARIMA, SARIMA models for each order and select the pdq values which will give least rmse

wraith spokeBOT
#

@random hull

Python help channel opened

Remember to:

  • Ask your Python question, not if you can ask or if there's an expert who can help.
  • Show a code sample as text (rather than a screenshot) and the error message, if you've got one.
  • Explain what you expect to happen and what actually happens.

:warning: Do not pip install anything that isn't related to your question, especially if asked to over DMs.

warm flint
#

hmmm better you ask on huggingface discord ๐Ÿ˜‰

random hull
#

is that another server or a channel in this server ?

warm flint
#

Nothing against the pros here... but here is only basic and pure Python help, less about what you can do with it and applications.
Its another server, google
huggingface discord
you will find ...

random hull
#

i did it seems like I need to have a hugging face account for it and authorize the server to access it

#

thanks for the help
I'll ask the same question there

shadow sequoia
#

I doubt hf would help, that's more for deep learning folks

random hull
#

hmm let's see

shadow sequoia
#

if my rusty statistics knowledge serves, you look at peaks of the pacf to determine max ar, and peaks of acf for max ma
though if both show geometric-y decay, you have an ar-ma and you usually determine it through other stats like aic

#

for example here, they don't even talk about looking at (p)acf, and only about aic/bic/aicc

#

and also, are you doing this because you're hitting a computational wall or smthn?

random hull
shadow sequoia
#

(as well as, my statistics is really rusty, so the more ml side of me is just quietly whispering just throw more compute at it)

random hull
#

so instead of arguing with them I thought of getting some help from discord ๐Ÿ˜…

shadow sequoia
random hull
#

for the better results I shall go with following pdq_combinations

p_vals = range(1, 6)
d_vals = range(0, 1)
q_vals = range(1, 4)

pdq_combinations = list(product(p_vals, d_vals, q_vals))

correct ?

shadow sequoia
# random hull okay so considering this from acf plot I have attached q should be ranging fro...

if you want to strictly look at what falls or doesn't fall into the bands
pacf has 1, 4, 5, 7, with 1 and 5 looking more out there, so p could potentially be 1 or 5 like you have ar(1) or ar(5) (or ar(4) or ar(7))
acf has 1 and 2 (maybe even 4), so q could potentially be 1 or 2 (or 4) like you have ma(1) or ma(2) (or ma(4))

ig if you really want to be thorough from that you're gonna check p from 1-7 and q from 1-4, note that setting it too high might make it overfit easier tho

and in the end it honestly might just be arma(1, 1) lul

#

and (if you've been taught this) you can use something like the adf test to check if the original series is stationary, if it's not then d=0 is not needed

random hull
#

yeah I did the adf test, the p-value came out to be 0.0039 which is way lesser than 0.05 so d has to be 0
still I don't want to take any chances hence I'm going [0, 1]

shadow sequoia
#

in practice many packages come with autoarima which usually has a good enough default (p, q, d) range it fits & checks thru, and gives you the best one

random hull
#

oh really

shadow sequoia
shadow sequoia
random hull
#

basically this assignment stuff that I'm doing right now is not the way they use in real life

#

it's just for understanding how it works underneath

shadow sequoia
#

technically it doesn't check through the entire parameter grid and uses a heuristic, but you get the idea
as the end user you just have 1 big my_model = AutoARIMA() then my_model.fit( ... ) instead of having to loop yourself

random hull
#

ohh that's interesting

#

though it must be needing a lot of time right ?
as underneath it needs to find the appropriate p,d,q fit the model, and do some extra stuff as well

shadow sequoia
#

(though I'm not sure if ppl would actually use in those cases, might just resort to a deep learning model)

random hull
#

yeah I think that's the case with every business use case

shadow sequoia
random hull
#

edd ?

shadow sequoia
#

ye, another helper in this server named Edd
I'm a bit afraid to ping other ppl tho

random hull
#

ohh

#

well I'm not really comparing but you're quite knowledgable too

#

at least much much better than me

#

I'm like totally new to this overall ML field

shadow sequoia
random hull
shadow sequoia
#

nixtla's probably the leading team to look when you just want performant forecasting

random hull
#

right

wraith spokeBOT
#
Python help channel closed for inactivity

This help channel has been closed. Feel free to create a new post in #1035199133436354600. To maximize your chances of getting a response, check out this guide on asking good questions.