这是我的代码:
library(forecast)
oldstuff<-read.table(text="Week Forecast Actual prevAccuracy
49 2018-12-03 6775906 280215.00 0.01723065
50 2018-12-10 3659630 740035.90 0.05604323
51 2018-12-17 4009861 0.00 0.22264551
52 2018-12-24 4262533 92620.51 0.24447944
53 2018-12-31 4463402 3109617.17 0.19740596
54 2019-01-07 4786782 1881454.00 0.02625039
55 2019-01-14 4771027 1091031.00 0.02115797
56 2019-01-21 5382587 5095186.83 0.06343317")
newstuff<-read.table(text=" Week Forecast prevAccuracy
57 2019-01-28 1124392 0.8382692
58 2019-02-04 2161792 0.9130823
59 2019-02-11 2480092 0.6848097
60 2019-02-18 3197242 0.6848097")
oldstuffts<- ts(oldstuff, freq=365.25/7, start=2018 + 337/365.25)
oldstuffmodel <- tslm(Actual~Forecast + prevAccuracy, data=oldstuffts)
forecast(oldstuffmodel, newdata=newstuff)
当我尝试预测我的模型时,我收到了这个错误:
Error in forecast(oldstuffmodel, newdata = newstuff) :
unused argument (newdata = newstuff)
如何让预测功能发挥作用?