python - 有没有办法像使用 SARIMAX 模型一样使用 LSTM 来预测具有外生变量的时间序列?

标签 python time-series forecast

我试图用外生变量预测时间序列,并成功地使用 SARIMAX 模型进行预测,我试图使用 RNN 模型(特别是 LSTM 模型)做同样的事情,但无法找到任何实现外生变量的方法(我有完整的历史记录),但这个变量会影响时间序列,因此需要考虑在内。
非常感谢您的帮助
谢谢

最佳答案

查询 cond-rnn .它是一个实现您正在寻找的东西的库。

Useful if you have time series data with other inputs that do not depend on time. For example, weather data from two different cities: Paris and San Francisco. You want to predict the next temperature based on historical data. But at the same time, you expect the weather to change based on the city. You can either:

  • Combine the auxiliary features with the time series data (ugly!).

  • Concatenate the auxiliary features with the output of the RNN layer. It's some kind of post-RNN adjustment since the RNN layer won't see this auxiliary info.

  • Or just use this library! Long story short, initialize the RNN states with a learned representation of the condition (e.g. Paris or San Francisco). This way you model elegantly P(x_{t+1}|x_{0:t}, cond).



而且它真的很容易使用
outputs = cond_rnn.ConditionalRNN(units=NUM_CELLS, cell='LSTM')([inputs, cond])

关于python - 有没有办法像使用 SARIMAX 模型一样使用 LSTM 来预测具有外生变量的时间序列?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/62333807/

相关文章:

python - 在 ubuntu 20 上没有名为 'pjsua' 的模块

R 中的滚动连接 data.table

python-3.x - 如何在 matplotlib 中创建具有垂直阴影的绘图

recursion - 通过机器学习以递归方式预测时间范围

r - R 的 fracdiff 软件包无法在 Linux Mint 中安装

python - peewee + MySQL,如何创建包装 SQL 内置插件的自定义字段类型?

python - 使用Pycrypto进行图片加密解密

python - 如何解决属性错误 "Int64Index'对象没有属性 'inferred_freq'》

python - 利益相关者如何在不编写代码的情况下编写测试?

apache-spark - PySpark:如何在 For 循环中附加数据帧