R 预测';tslm&x27;接收未使用的参数错误

R 预测';tslm&x27;接收未使用的参数错误,r,time-series,forecast,R,Time Series,Forecast,这是我的密码: 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-

这是我的密码:

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)

如何使forecast函数工作?

显然,使用了来自其他软件包的
forecast
函数。相反,您可以指定要使用
forecast
包中的一个:

forecast::forecast(oldstuffmodel, newdata = newstuff)
#          Point Forecast     Lo 80   Hi 80     Lo 95    Hi 95
# 2019.076      -921205.5 -10112280 8269869 -16929516 15087105
# 2019.095      -930932.3 -11151447 9289583 -18732243 16870378
# 2019.114      -304598.4  -7883188 7273991 -13504405 12895208
# 2019.133      -181770.1  -7936566 7573026 -13688480 13324940
forecast::forecast(oldstuffmodel, newdata = newstuff)
#          Point Forecast     Lo 80   Hi 80     Lo 95    Hi 95
# 2019.076      -921205.5 -10112280 8269869 -16929516 15087105
# 2019.095      -930932.3 -11151447 9289583 -18732243 16870378
# 2019.114      -304598.4  -7883188 7273991 -13504405 12895208
# 2019.133      -181770.1  -7936566 7573026 -13688480 13324940