gpt4 book ai didi

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

转载 作者:行者123 更新时间:2023-12-04 04:06:50 27 4
gpt4 key购买 nike

我试图用外生变量预测时间序列,并成功地使用 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/

27 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com