Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
假设我正在使用Rets中的包中的函数,forecast并且我已经将模型拟合到单个时间序列t,例如
ets
forecast
t
ets_model = ets(t) fcast = forecast(ets_model, h=1)
如果我fcast在控制台中输入,我可以看到预测,但我如何实际提取这个值以便我可以将它用作程序的一部分?我一直在搜索内容,str(fcast)但在任何地方都找不到实际的预测。
fcast
str(fcast)
它是fcast$mean:
fcast$mean
fcast <- forecast(ets(rnorm(20)), h = 1) fcast # Point Forecast Lo 80 Hi 80 Lo 95 Hi 95 # 21 -0.06945796 -0.9153854 0.7764694 -1.363192 1.224276 fcast$mean # Time Series: # Start = 21 # End = 21 # Frequency = 1 # [1] -0.06945796