我有一个两ts
对象
> ts_forecast$mean
Sep Oct Nov
5 12.74330 13.44875 14.15419
和
> tail(ts_full$time.series[,2],n=3)
Jun Jul Aug
5 55.22149 55.64993 56.22575
ts_forecast$mean
我从stlf
预测函数中得到(package forecast)
.ts_full
只不过是时间序列的随机部分,并且是作为
ts_full <-stl(ts_historic,s.window='periodic')
ts_full$time.series[,2] <----Trend part
ts_full$time.series[,3] <-----Random Part and this was used in stlf forecast function.
目标:我想将趋势部分添加到上面获得的三个预测值中。
简单来说:
forecast_mean <-ts_forecast$mean + tail(ts_full$time.series[,2],n=3)
但是我收到一条警告消息:
Warning message:
In .cbind.ts(list(e1, e2), c(deparse(substitute(e1))[1L], deparse(substitute(e2))[1L]), :
non-intersecting series
我不想使用mean(tail(ts_full$time.series[,2],n=3))
并将其添加到ts_forecast$mean
. 我在这里缺少什么?是因为ts_forecast$mean
和ts_full
的月份不同吗?
欣赏任何线索。
forecast_mean <- suppressWarnings(as.numeric(ts_forecast$mean) + as.numeric(tail(ts_full$time.series[,2],n=3)))