简体   繁体   English

如何训练具有多个系列的statsmodels.tsa.ARIMA模型

[英]How to train statsmodels.tsa.ARIMA model with multiple series

The usual way to fit an ARIMA model with the statsmodels python package is: 使用statsmodels python包调整ARIMA模型的常用方法是:

model  = statsmodels.tsa.ARMA(series, order=(2,2))
result = model.fit(trend='nc', disp=1)

however, i have multiple time series data to train with, say, from the same underlying process, how could i do that? 但是,我有多个时间序列数据来训练,比方说,从同一个基础过程,我怎么能这样做?

When you say, multiple time series data, it is not clear if they are of the same type. 当您说多个时间序列数据时,不清楚它们是否属于同一类型。 There is no straightforward way to specify multiple series in ARMA model. 在ARMA模型中指定多个系列没有直接的方法。 However you could use the 'exog' optional variable to indicate the second series. 但是,您可以使用'exog'可选变量来指示第二个系列。

Please refer for the actual definition of ARMA model. 参考 ARMA模型的实际定义。

model  = statsmodels.tsa.ARMA(endog = series1, exog=series2, order=(2,2))

Please refer for the explanation of the endog, exog variables. 参考 endog,exog变量的解释。

Please see a working example of how this could be implemented 请参阅一个如何实现此功能的工作示例

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM