срок 2 года в Ариме - PullRequest
       6

срок 2 года в Ариме

0 голосов
/ 14 февраля 2020

Как я могу установить период 2 года для значений m в функции auto_arima здесь -

import pmdarima

stepwise_model = auto_arima(data.tractors_sold, start_p=1, start_q=1,
                           max_p=3, max_q=3, m=12,
                           start_P=0, seasonal=True,
                           d=1, D=1, trace=True,
                           error_action='ignore',  
                           suppress_warnings=True, 
                           stepwise=True)
print(stepwise_model.aic())

1 Ответ

0 голосов
/ 14 февраля 2020

Согласно источнику pmdarima github: m относится к числу периодов в каждом сезоне.

Внутренне он вызывает модель statsmodel sarimax. там это становится s и согласно документам:

`s` is an integer giving the periodicity (number of periods in season), often it
is 4 for quarterly data or 12 for monthly data. Default is no seasonal effect.
So all above points is for one year of periodicity. So if you have daily data
and you want to set periodicity of 2 years then you have to set m = 365 * 2,
which wont work as it is used in power. so for that you have to make data monthly
or quarterly or yearly and then set m = 24(for monthly data, i.e. 24 points will
make period.), m = 8 for quarterly data and m = 2 for yearly data.
   The SARIMA model is specified :math:`(p, d, q) \times (P, D, Q)_s`.
    .. math::
        \phi_p (L) \tilde \phi_P (L^s) \Delta^d \Delta_s^D y_t = A(t) +
            \theta_q (L) \tilde \theta_Q (L^s) \zeta_t

проверьте ниже ссылку для получения более подробной информации:

https://github.com/statsmodels/statsmodels/blob/master/statsmodels/tsa/statespace/sarimax.py

...