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

Convergence information being displayed during ARIMA.fit() regardless of disp value #3191

Open
philipobrien opened this issue Sep 6, 2016 · 9 comments

Comments

@philipobrien
Copy link

>>> sm.version.full_version
'0.8.0.dev0+bb1db2b'
arima_model = ARIMA(transformed_data, order=(model_order[0], model_order[1], model_order[2]))
arima_results = arima_model.fit(disp=False)  # or disp=-1
RUNNING THE L-BFGS-B CODE

           * * *

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

At X0         0 variables are exactly at the bounds

At iterate    0    f=  7.16189D+00    |proj g|=  1.29181D-01

At iterate    5    f=  7.00504D+00    |proj g|=  1.47562D-03

At iterate   10    f=  7.00442D+00    |proj g|=  1.79098D-02

At iterate   15    f=  6.93115D+00    |proj g|=  2.95095D-01

At iterate   20    f=  6.84326D+00    |proj g|=  7.16658D-04

           * * *

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
    3     23     25      1     0     0   4.230D-07   6.843D+00
  F =   6.8432611444769238

CONVERGENCE: NORM_OF_PROJECTED_GRADIENT_<=_PGTOL

 Cauchy                time 0.000E+00 seconds.
 Subspace minimization time 0.000E+00 seconds.
 Line search           time 0.000E+00 seconds.

 Total User time 0.000E+00 seconds.
@bashtage
Copy link
Member

bashtage commented Sep 8, 2016

Can't reproduce

from statsmodels.tsa.api import ARIMA
import numpy as np

y = np.random.randn(1000)

arima_model = ARIMA(y, order=(1, 1, 1))
arima_results = arima_model.fit(disp=False)  # or disp=-1

What deps do you have installed?

from statsmodels.api import show_versions
show_versions()
INSTALLED VERSIONS
------------------
Python: 3.5.2.final.0

Statsmodels
===========

Installed: 0.8.0.dev0+bb1db2b (c:\git\statsmodels\statsmodels)

Required Dependencies
=====================

cython: 0.24.1 (C:\anaconda\lib\site-packages\Cython)
numpy: 1.11.1 (C:\anaconda\lib\site-packages\numpy)
scipy: 0.18.0 (C:\anaconda\lib\site-packages\scipy)
pandas: 0.18.1 (C:\anaconda\lib\site-packages\pandas)
    dateutil: 2.5.3 (C:\anaconda\lib\site-packages\dateutil)
patsy: 0.4.1 (C:\anaconda\lib\site-packages\patsy)

Optional Dependencies
=====================

matplotlib: 1.5.1 (C:\anaconda\lib\site-packages\matplotlib)
cvxopt: Not installed

Developer Tools
================

IPython: 5.1.0 (C:\anaconda\lib\site-packages\IPython)
    jinja2: 2.8 (C:\anaconda\lib\site-packages\jinja2)
sphinx: Not installed
    pygments: 2.1.3 (C:\anaconda\lib\site-packages\pygments)
nose: Not installed
virtualenv: Not installed

@philipobrien
Copy link
Author

INSTALLED VERSIONS
------------------
Python: 2.7.12.final.0
OS: Linux 3.13.0-93-generic #140-Ubuntu SMP Mon Jul 18 21:21:05 UTC 2016 x86_64
byteorder: little
LC_ALL: None
LANG: en_US.UTF-8

Statsmodels
===========

Installed: 0.8.0.dev0+bb1db2b (/home/vagrant/miniconda/envs/me/lib/python2.7/site-packages/statsmodels-0.8.0-py2.7-linux-x86_64.egg/statsmodels)

Required Dependencies
=====================

cython: 0.24.1 (/home/vagrant/miniconda/envs/me/lib/python2.7/site-packages/Cython)
numpy: 1.11.1 (/home/vagrant/miniconda/envs/me/lib/python2.7/site-packages/numpy)
scipy: 0.18.0 (/home/vagrant/miniconda/envs/me/lib/python2.7/site-packages/scipy)
pandas: 0.18.1 (/home/vagrant/miniconda/envs/me/lib/python2.7/site-packages/pandas)
    dateutil: 2.5.3 (/home/vagrant/miniconda/envs/me/lib/python2.7/site-packages/dateutil)
patsy: 0.4.1 (/home/vagrant/miniconda/envs/me/lib/python2.7/site-packages/patsy)

Optional Dependencies
=====================

matplotlib: 1.5.1 (/home/vagrant/miniconda/envs/me/lib/python2.7/site-packages/matplotlib)
cvxopt: Not installed

Developer Tools
================

IPython: 5.1.0 (/home/vagrant/miniconda/envs/me/lib/python2.7/site-packages/IPython)
    jinja2: Not installed
sphinx: Not installed
    pygments: 2.1.3 (/home/vagrant/miniconda/envs/me/lib/python2.7/site-packages/pygments)
nose: 1.3.7 (/home/vagrant/miniconda/envs/me/lib/python2.7/site-packages/nose)
virtualenv: Not installed

@bashtage
Copy link
Member

bashtage commented Sep 8, 2016

Strange, can't repro on Linux either.

Versions are essentially identical.

INSTALLED VERSIONS
------------------
Python: 2.7.12.final.0
OS: Linux 4.4.0-36-generic #55-Ubuntu SMP Thu Aug 11 18:01:55 UTC 2016 x86_64
byteorder: little
LC_ALL: None
LANG: en_GB.UTF-8

Statsmodels
===========

Installed: 0.8.0.dev0+bb1db2b (/home/kevin/anaconda/envs/py27/lib/python2.7/site-packages/statsmodels-0.8.0-py2.7-linux-x86_64.egg/statsmodels)

Required Dependencies
=====================

cython: 0.24.1 (/home/kevin/anaconda/envs/py27/lib/python2.7/site-packages/Cython)
numpy: 1.11.1 (/home/kevin/anaconda/envs/py27/lib/python2.7/site-packages/numpy)
scipy: 0.18.0 (/home/kevin/anaconda/envs/py27/lib/python2.7/site-packages/scipy)
pandas: 0.18.1 (/home/kevin/anaconda/envs/py27/lib/python2.7/site-packages/pandas)
    dateutil: 2.5.3 (/home/kevin/anaconda/envs/py27/lib/python2.7/site-packages/dateutil)
patsy: 0.4.1 (/home/kevin/anaconda/envs/py27/lib/python2.7/site-packages/patsy)

Optional Dependencies
=====================

matplotlib: Not installed
cvxopt: Not installed

Developer Tools
================

IPython: 5.1.0 (/home/kevin/anaconda/envs/py27/lib/python2.7/site-packages/IPython)
    jinja2: Not installed
sphinx: Not installed
    pygments: 2.1.3 (/home/kevin/anaconda/envs/py27/lib/python2.7/site-packages/pygments)
nose: 1.3.7 (/home/kevin/anaconda/envs/py27/lib/python2.7/site-packages/nose)
virtualenv: Not installed

@bashtage
Copy link
Member

bashtage commented Sep 8, 2016

If you use a fresh IPython and just paste my code do you see output?

@josef-pkt
Copy link
Member

is it possible that there is the lbfgsb log file piped to the console?

I'm not sure what the current status is, but some time ago the log file was always created unless the special option turned it of.

@plankthom
Copy link

... statsmodels.api.SARIMAX.fit gives this output.
statsmodels.api.tsa.ARIMA.fit doesn't because of

bounds=bounds, iprint=-1)

@plankthom
Copy link

plankthom commented Sep 21, 2018

... while the issue title states that it is/was the other way round. Anyway, still a (wrong fix of this?) bug: the disp parameter on ARIMA.fit is still ignored.

@josef-pkt
Copy link
Member

fmin_l_bfgs_b has two display keywords, disp and iprint, so it's a bit messy
https://docs.scipy.org/doc/scipy/reference/generated/scipy.optimize.fmin_l_bfgs_b.html

default iprint in base.optimizer is set to 0
my guess is that we should change the default to iprint=-1 if disp is False

@josef-pkt
Copy link
Member

another issue in @plankthom ARIMA code link is that we don't have in general separate options for preliminary estimation of start_params.

Those are usually hard coded to no display. In discrete models I introduced a backdoor through an unadvertised (?) extra kwarg optim_kwds_prelim which I needed for cases when the preliminary estimator ran into convergence problems, which can also handle disp for the prelim estimator.

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

4 participants