Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

LU decomposition error using SARIMAX in statsmodels

I get a 'LU decomposition' error where using SARIMAX in the statsmodels python package. This is the code:

from statsmodels.tsa.statespace.sarimax import SARIMAX
model = SARIMAX(endog=series, order=(0,0,1), seasonal_order=(1,0,1,12), trend='n')
model_fit = model.fit()
predictions = model_fit.predict(len(series), len(series)+30)

The error I get is: 'LinAlgError: LU decomposition error'. The error appears only for certain combination of numbers in 'order' and 'seasonal_order'.

like image 471
randomwalker Avatar asked Jul 05 '26 13:07

randomwalker


1 Answers

model = SARIMAX(endog=series, order=(0,0,1), seasonal_order=(1,0,1,12), trend='n', enforce_stationarity=False)

Do not enforce stationarity so that your model can still fit on non-stationary data

like image 64
Mardy Marn Avatar answered Jul 07 '26 04:07

Mardy Marn



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!