Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

predict yields array of 0s. #357

Closed
zachlefevre opened this issue Jul 8, 2020 · 1 comment
Closed

predict yields array of 0s. #357

zachlefevre opened this issue Jul 8, 2020 · 1 comment

Comments

@zachlefevre
Copy link

Question

data = [359125698.64, -419934.7, -31623185.37, 19556515.5, 934374.83, 88643847.73, 18983611.85, 638945.66, -4079020.52, -41301474.38, -999558.35, -999558.35, 52100319.7, -784917.62, 48527345.98, -3161926.01, 1757748.53, 86546250.69, 66971847.0, 1386714.85, -13195016.89, -19012979.5, 1152601.3, 11968257.33, 71107580.44, -1156768.56, -27878666.6, 888604.13, -29190832.71, 5499733.88, -23377004.53, -91490448.09, 7413504.15, 19425919.04, 742786.38, -3862882.17]

auto_arima(data, seasonal=False).predict() # yields [0., 0., ...]. order=(0, 0, 0)

Why does this only produce 0s? statsmodels.tsa.arima_model.ARIMA(data, order=(0,0,0)).fit().predict() does not.

Am I able to pull a statsmodel ARIMA from the AutoArima object?

Version:
System:
python: 3.6.9 |Anaconda, Inc.| (default, Jul 30 2019, 13:42:17) [GCC 4.2.1 Compatible Clang 4.0.1 (tags/RELEASE_401/final)]
executable: /Users/zacharylefevre/anaconda3/envs/forecasting-service/bin/python
machine: Darwin-19.5.0-x86_64-i386-64bit

Python dependencies:
pip: 20.0.2
setuptools: 46.4.0.post20200518
sklearn: 0.23.1
statsmodels: 0.11.1
numpy: 1.18.1
scipy: 1.5.0
Cython: 0.29.17
pandas: 1.0.3
joblib: 0.16.0
pmdarima: 1.6.1

@aaronreidsmith
Copy link
Member

statsmodels.tsa.arima_model.ARIMA has been all but deprecated by statsmodels (see this comment and corresponding PR in our project), so we use statsmodels.tsa.statespace.sarimax.SARIMAX under the hood.

Am I able to pull a statsmodel ARIMA from the AutoArima object?

Yes, you can access this through the arima_res_ attribute of the returned model

With all of that being said, it should be noted that statsmodels.tsa.statespace.sarimax.SARIMAX returns the same predictions in this case:

>>> statsmodels.tsa.statespace.sarimax.SARIMAX(data, order=(0,0,0)).fit().predict()
RUNNING THE L-BFGS-B CODE

           * * *

Machine precision = 2.220D-16
 N =            1     M =           10
 This problem is unconstrained.

At X0         0 variables are exactly at the bounds

At iterate    0    f=  1.94764D+01    |proj g|=  3.55318D-10

           * * *

Tit   = total number of iterations
Tnf   = total number of function evaluations
Tnint = total number of segments explored during Cauchy searches
Skip  = number of BFGS updates skipped
Nact  = number of active bounds at final generalized Cauchy point
Projg = norm of the final projected gradient
F     = final function value

           * * *

   N    Tit     Tnf  Tnint  Skip  Nact     Projg        F
    1      0      1      0     0     0   3.553D-10   1.948D+01
  F =   19.476442963321666     

CONVERGENCE: NORM_OF_PROJECTED_GRADIENT_<=_PGTOL            
array([0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0.,
       0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0.,
       0., 0.])

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants