Skip to content

ARIMA fitting issue - ValueError: On entry to DLASCL parameter number 4 had an illegal value #5396

Closed

Description

@samyoung17

I'm trying to fit an ARIMA model to my uig_factor dataset: a pandas timeseries object. This seems to work on my local machine and in docker, but causes faults in the same docker image on the server.

When executing the following code:

uig_factor = uig_factor[uig_factor['OvoUigFactor'].isnull() == False].set_index('GasFlowDate')
fit = ARIMA(uig_factor, order=(7, 1, 0)).fit(disp=0)

I get this stack trace:

File "/root/gas_forecast/gas_forecast/uig.py", line 190, in uig_factor_arima
    fit = ARIMA(uig_factor, order=(7, 1, 0)).fit(disp=0)
  File "/usr/local/lib/python3.6/site-packages/statsmodels/tsa/arima_model.py", line 1157, in fit
    callback, start_ar_lags, **kwargs)
  File "/usr/local/lib/python3.6/site-packages/statsmodels/tsa/arima_model.py", line 959, in fit
    callback=callback, **kwargs)
  File "/usr/local/lib/python3.6/site-packages/statsmodels/base/model.py", line 466, in fit
    full_output=full_output)
  File "/usr/local/lib/python3.6/site-packages/statsmodels/base/optimizer.py", line 191, in _fit
    hess=hessian)
  File "/usr/local/lib/python3.6/site-packages/statsmodels/base/optimizer.py", line 410, in _fit_lbfgs
    **extra_kwargs)
  File "/usr/local/lib/python3.6/site-packages/scipy/optimize/lbfgsb.py", line 199, in fmin_l_bfgs_b
    **opts)
  File "/usr/local/lib/python3.6/site-packages/scipy/optimize/lbfgsb.py", line 335, in _minimize_lbfgsb
    f, g = func_and_grad(x)
  File "/usr/local/lib/python3.6/site-packages/scipy/optimize/lbfgsb.py", line 280, in func_and_grad
    f = fun(x, *args)
  File "/usr/local/lib/python3.6/site-packages/scipy/optimize/optimize.py", line 293, in function_wrapper
    return function(*(wrapper_args + args))
  File "/usr/local/lib/python3.6/site-packages/statsmodels/base/model.py", line 440, in f
    return -self.loglike(params, *args) / nobs
  File "/usr/local/lib/python3.6/site-packages/statsmodels/tsa/arima_model.py", line 780, in loglike
    return self.loglike_kalman(params, set_sigma2)
  File "/usr/local/lib/python3.6/site-packages/statsmodels/tsa/arima_model.py", line 790, in loglike_kalman
    return KalmanFilter.loglike(params, self, set_sigma2)
  File "/usr/local/lib/python3.6/site-packages/statsmodels/tsa/kalmanf/kalmanfilter.py", line 649, in loglike
    R_mat, T_mat)
  File "kalman_loglike.pyx", line 342, in statsmodels.tsa.kalmanf.kalman_loglike.kalman_loglike_double
  File "kalman_loglike.pyx", line 74, in statsmodels.tsa.kalmanf.kalman_loglike.kalman_filter_double
  File "/usr/local/lib/python3.6/site-packages/numpy/linalg/linalg.py", line 1872, in pinv
    u, s, vt = svd(a, full_matrices=False)
  File "/usr/local/lib/python3.6/site-packages/numpy/linalg/linalg.py", line 1562, in svd
    u, s, vh = gufunc(a, signature=signature, extobj=extobj)
ValueError: On entry to DLASCL parameter number 4 had an illegal value

I have openblas but not mkl installed

Activity

  1. ChadFulton commented on Nov 26, 2018

    @ChadFulton
    Member

    I think this usually happens when you have a NaN or an inf value in your endog.

  2. ChadFulton commented on Nov 26, 2018

    @ChadFulton
    Member

    If not, then I guess this is an issue with OpenBLAS - in any case, the error is occuring at a lower level than statsmodels itself.

  3. samyoung17 commented on Nov 27, 2018

    @samyoung17
    Author
  4. skatsuta commented on Dec 10, 2018

    @skatsuta

    I recently encountered the same error too when using GLM.
    In my case it turned out that upgrading statsmodels from 0.8.0 -> 0.9.0 seems to cause this problem.
    Downgrading to 0.8.0 fixed the error.
    I don't know the root cause but hope this helps.

  5. bashtage commented on Jul 16, 2019

    @bashtage
    Member

    Closing, no action.

  6. added this to the 0.11 milestone on Dec 18, 2019
  7. YuliaGazizova commented on Jun 21, 2020

    @YuliaGazizova

    I have the same problem and my data certainly does not contain NaNs or inf

    from statsmodels.tsa.arima_model import ARIMA
    model = ARIMA(st['students'], order=(6,1,0))
    model_fit = model.fit(disp=0)
    

    On entry to DLASCL parameter number 4 had an illegal value

    statsmodels 0.11.1

  8. bashtage commented on Jun 21, 2020

    @bashtage
    Member

    Have you tried statsmodels.tsa.arima.model.ARIMA. Note the . rather than the _.

  9. bashtage commented on Jun 21, 2020

    @bashtage
    Member

    When this happens I suspect that the LLF is returning a NaN somewhere in the optimization and this then propagates back to the parameters until you get an invalid value.

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

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions