python - fbprophet库中的 'yhat'(预测)是如何计算的?

标签 python time-series prediction

我正在Python中使用fbprophet进行时间序列预测,我想知道yhat(预测)列是如何计算的。我使用了以下代码。

import quandl
import fbprophet

tesla = quandl.get('WIKI/TSLA')
tesla = tesla.reset_index()
tesla = tesla.rename(columns={'Date': 'ds', 'Adj. Close': 'y'})
tesla = tesla[['ds', 'y']]

prophet = fbprophet.Prophet()
prophet.fit(tesla)
future = prophet.make_future_dataframe(periods=365)
future = prophet.predict(future)

future 数据框包含以下列:

['ds', 'trend', 'trend_lower', 'trend_upper', 'yhat_lower', 'yhat_upper', 
'seasonal', 'seasonal_lower', 'seasonal_upper', 'seasonalities', 
'seasonalities_lower', 'seasonalities_upper', 'weekly', 'weekly_lower', 
'weekly_upper', 'yearly', 'yearly_lower', 'yearly_upper', 'yhat']

我知道yhat是预测,但它是趋势、季节性、季节性、每周、每年还是其他内容的组合?

我尝试将 trend、seasonal、seasonality、weekly、yearly 列组合起来,看看它们是否等于 yhat 列,但它们不相等:

future['combination'] = future['trend'] + future['seasonal'] + future['weekly'] + future['yearly'] + future['seasonalities']

print(future[['combination', 'yhat']].head())

   combination       yhat
0    57.071956  27.681139
1    55.840545  27.337270
2    53.741200  26.704090
3    51.874192  26.148355
4    47.827763  25.065950

我无法在文档中找到答案,但如果我只是错过了它,我深表歉意。

最佳答案

我是 fbprophet 的初学者,但想分享我的猜测。 尽管我不确定它是否正确,但以下等式可能在预言家的默认设置下成立。

yhat = trend + seasonal

希望我的回答对您有帮助!

关于python - fbprophet库中的 'yhat'(预测)是如何计算的?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/48218323/

相关文章:

R神经网络在时间序列的stepmax内不收敛

python - 使用机器学习预测行数

scikit-learn - 如何调整投票分类器 (Sklearn) 中的权重

python - 在成对列表中查找成对项目的频率

python - 如何刷新本地 pip 缓存

javascript - Python 相当于 JS `Symbol` ?

sql - 在数据库中存储大量时间序列的有效方法是什么?

python - 比较随机和urandom

r - 如何使用循环在多个站点上执行 Mann-kendall 测试?

python - 使用 SlopeOne 算法预测玩家是否可以完成游戏中的关卡?