我试图在Python中的statsmodel包的SARIMAX函数中拟合时间序列模型。但是,我收到以下错误消息。
model = SARIMAX(y_train, order=(p,0,q),seasonal_order=(0, 0, 0, 0),enforce_stationarity=False,enforce_invertibility=False)
File "/usr/local/python/3.5.1/lib/python3.5/site-packages/statsmodels/tsa/statespace/sarimax.py", line 510, in __init__
endog, exog=exog, k_states=k_states, k_posdef=k_posdef, **kwargs
File "/usr/local/python/3.5.1/lib/python3.5/site-packages/statsmodels/tsa/statespace/mlemodel.py", line 97, in __init__
self.initialize_statespace(**kwargs)
File "/usr/local/python/3.5.1/lib/python3.5/site-packages/statsmodels/tsa/statespace/mlemodel.py", line 130, in initialize_statespace
self.ssm = KalmanSmoother(endog.shape[0], self.k_states, **kwargs)
File "/usr/local/python/3.5.1/lib/python3.5/site-packages/statsmodels/tsa/statespace/kalman_smoother.py", line 343, in __init__
k_endog, k_states, k_posdef, results_class=results_class, **kwargs
File "/usr/local/python/3.5.1/lib/python3.5/site-packages/statsmodels/tsa/statespace/kalman_filter.py", line 213, in __init__
k_endog, k_states, k_posdef, **kwargs
File "/usr/local/python/3.5.1/lib/python3.5/site-packages/statsmodels/tsa/statespace/representation.py", line 278, in __init__
raise ValueError('Number of states in statespace model must be a'
ValueError: Number of states in statespace model must be a positive number.
当我在Windows环境中在自己的笔记本电脑中运行此模型时,该模型可以正确执行。 Statsmodels的版本在我的笔记本电脑中为10.1。但是,当我尝试在大学的高性能计算系统中运行此错误时,会发生此错误。该高性能系统位于Linux环境中。