R-每周预报

R-Weekly Forecast

当我使用 ts <- ts(df, frequency=52, start=c(2007,1)) 然后打印它时,我得到如下所示的结果,而不是 2007.01、2007.02、2007.52 ... ., 我得到 2007.000, 2007.019, ....它从 1/52=0.019 得到,这在数学上是正确的但不太容易解释,有没有办法将它标记为日期本身,就像数据框一样,或者至少2007 年第 1 周、2007 年第 2 周 ...

时间序列:

开始 = c(2007, 1)

结束 = c(2014, 11)

频率 = 52

Week,          Amount

2007.000,      645575.4

2007.019,      2185193.2

2007.038,      1016711.8

2007.058,      1894056.4    

2007.077,      2317517.6    

2007.096,      2522955.8    

2007.115,      2266107.3    

适合 <- auto.arima(dmsales[[2]])<br> fcast<-forecast(fit,h=input$ahead)<br> dfcast<-data.frame(fcast)<br> b<-data.frame(seq(as.Date(dmsales[[3]]+7), by = "week", length.out = input$ahead))<br> ffcast<-as.data.frame(cbind(b,dfcast$Point.Forecast,dfcast$Lo.95,dfcast$Hi.95))<br> 名称(ffcast)<-c("Week","Forecast","Lo-95","Hi-95")