简体   繁体   中英

Time Series Forecasting (Using R)

I am trying to forecast the number of incoming calls for the next 4 period. While my forecast shows me the same figure for the next 4 periods, so I am a little confused as to where did I go wrong.

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

Trying to Forecast the next 4 months data using R

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

37716 for the next 4 months does not seem appropriate. How do I calculate the forecast for the next 4 months

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

your problem is similar to https://stats.stackexchange.com/questions/286900/arima-forecast-straight-line

Basicly auto.arima is indeed searching for seasonal models but it is also searching for non seasonal models, use the argument trace so that you can see the models being tested.

To "solve" this problem refer to the link and force D>1.

example.

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

also here is the data

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"))

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM