alkaline-ml / pmdarima

A statistical library designed to fill the void in Python's time series analysis capabilities, including the equivalent of R's auto.arima function.
https://www.alkaline-ml.com/pmdarima
MIT License
1.57k stars 231 forks source link

Setting `m` for Stock Market Predictions #485

Closed amangalampalli closed 2 years ago

amangalampalli commented 2 years ago

Describe the question you have

Hello,

I am trying to perform time-series forecasting on stock market data. However, the "Setting M" documentation says that m should be set to the number of observances per seasonal cycle. Stock Market data is recorded 253 times a year, so does that mean m should be set to 253?

Versions (if necessary)

No response

sonicpierre commented 2 years ago

Hello,

From my point of view m is the period for seasonal differencing. As you know to predict your stock market it needs to be stationary and that's why you need differenciation. To set it you just need to know what is your seasonal order, here if you have yearly seasonality you can put m = 12. Hope it'll help.

tgsmith61591 commented 2 years ago

Yes this is not something that can be set unilaterally, it depends on you, the model developer to have an understanding of your data. Please see this section of the documentation to understand m better.

@sonicpierre is correct that the stock market data may not be seasonal (I am not your financial advisor 😃 ; take this with a grain of salt), and m depends completely on your data.