【问题标题】:LU decomposition error using SARIMAX in statsmodels在 statsmodels 中使用 SARIMAX 的 LU 分解错误
【发布时间】:2020-10-17 10:52:21
【问题描述】:

在 statsmodels python 包中使用 SARIMAX 时出现“LU 分解”错误。 这是代码:

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)

我得到的错误是:'LinAlgError: LU 分解错误'。 该错误仅出现在 'order' 和 'seasonal_order' 中的某些数字组合中。

【问题讨论】:

    标签: python statsmodels


    【解决方案1】:

    如果你以系列值的对数为例

    Train_log = np.log(train['Count'])
    
    import statsmodels.api as sm
    model=sm.tsa.statespace.SARIMAX(Train_log,order=(2, 1, 4),seasonal_order=(0,1,1,24))
    result=model.fit()
    

    将有助于解决错误,因为我遇到了同样的错误,并且通过将其更改为 Train_log 错误消失了。

    【讨论】:

      猜你喜欢
      • 2022-07-06
      • 2017-07-30
      • 2019-06-05
      • 1970-01-01
      • 2017-07-24
      • 2017-06-06
      • 2021-09-03
      • 1970-01-01
      • 1970-01-01
      相关资源
      最近更新 更多