时间序列预测(使用R)

问题描述 投票:0回答:1

我正在尝试预测接下来4个时段的来电次数。虽然我的预测显示我接下来的4个时期的数字相同,但我对于哪里出错我有点困惑。

Data:

  Time    Total Calls
8/1/2015    69676
9/1/2015    71827
10/1/2015   62504
11/1/2015   59431
12/1/2015   63304
1/1/2016    58899
2/1/2016    55922
3/1/2016    60463
4/1/2016    56121
5/1/2016    58574
6/1/2016    64467
7/1/2016    61825
8/1/2016    75784
9/1/2016    67047
10/1/2016   63000
11/1/2016   63318
12/1/2016   66612
1/1/2017    71614
2/1/2017    62875
3/1/2017    66297
4/1/2017    66193
5/1/2017    70143
6/1/2017    72259
7/1/2017    65793
8/1/2017    53687
9/1/2017    48518
10/1/2017   58740
11/1/2017   50801
12/1/2017   44293
1/1/2018    61150
2/1/2018    49619
3/1/2018    49621
4/1/2018    48645
5/1/2018    37958
6/1/2018    37725
7/1/2018    42221
8/1/2018    41663
9/1/2018    35328
10/1/2018   37687

尝试使用R预测未来4个月的数据

tier2=ts(tier2,start=c(2015,8),end=c(2019,2),frequency=12)
tier2_train<-window(tier2[,2],end=c(2018,10))
tier2_test<-window(tier2[,2],start=c(2018,11))
plot(tier2_train,xlab="Time Period",ylab="Total Calls")
automatic<auto.arima(tier2_train,seasonal=T,stepwise=FALSE,approximation=FALSE,ic="aicc")
# automatic  ** The model decided (0,1,1)
forecast1 <- forecast::forecast(automatic, h = 4)
forecast1

Forecast output::

  Point Forecast   
Nov 2018          37716 
Dec 2018          37716   
Jan 2019          37716
Feb 2019          37716

未来4个月37716似乎不合适。如何计算未来4个月的预测

R code mentioned above

Expected results: to be close to:

11/1/2018   31657
12/1/2018   26390
1/1/2019    27542
2/1/2019    23262
r time-series forecasting
1个回答
0
投票

你的问题类似于https://stats.stackexchange.com/questions/286900/arima-forecast-straight-line

基本上auto.arima确实在搜索季节性模型,但它也在搜索非季节性模型,使用参数跟踪以便您可以看到正在测试的模型。

要“解决”这个问题,请参考链接并强制D> 1。

例。

plot(forecast(auto.arima(tier2_train,trace = TRUE,seasonal = TRUE,D=1)))

这里也是数据

structure(c(32L, 36L, 4L, 8L, 11L, 1L, 14L, 17L, 20L, 23L, 26L, 
29L, 33L, 37L, 5L, 9L, 12L, 2L, 15L, 18L, 21L, 24L, 27L, 30L, 
34L, 38L, 6L, 10L, 13L, 3L, 16L, 19L, 22L, 25L, 28L, 31L, 35L, 
39L, 7L, 32L, 36L, 4L, 8L, 69676L, 71827L, 62504L, 59431L, 63304L, 
58899L, 55922L, 60463L, 56121L, 58574L, 64467L, 61825L, 75784L, 
67047L, 63000L, 63318L, 66612L, 71614L, 62875L, 66297L, 66193L, 
70143L, 72259L, 65793L, 53687L, 48518L, 58740L, 50801L, 44293L, 
61150L, 49619L, 49621L, 48645L, 37958L, 37725L, 42221L, 41663L, 
35328L, 37687L, 69676L, 71827L, 62504L, 59431L), .Dim = c(43L, 
2L), .Dimnames = list(NULL, c("Time", "Total_Calls")), .Tsp = c(2015.58333333333, 
2019.08333333333, 12), class = c("mts", "ts", "matrix"))

© www.soinside.com 2019 - 2024. All rights reserved.