2
$\begingroup$

Currently attempting to interpret the results of my forecast using an ARIMA model that was applied to time series data (Dataset below). The forecast attempted is for a year into the future. The data was fitted to an ARIMA(1,0,1) model after using auto.arima to see what the best model would be.

To give a little background on the dataset, it displays the amount of breaking & entering's that happened in Toronto by month between 2014 to 2021.

Plot results of the forecast: https://i.stack.imgur.com/j8IuE.png

What I used for my forecast:

#Convert timeseries
BEDATA_GROUPEDtssarima <- ts(BEDATA_GROUPED[,2], frequency = 12, start = c(2014, 1))
class(BEDATA_GROUPEDtssarima)

#Plot
forecast::autoplot(BEDATA_GROUPEDtssarima)

# Check autocorrelation: High autocorrelation and data is non stationary
acf(BEDATA_GROUPEDtssarima)

#Partial Autocorelation
pacf(BEDATA_GROUPEDtssarima)

#augmented test
adf.test(BEDATA_GROUPEDtssarima)

#auto.arima
beddatamodel <- auto.arima(BEDATA_GROUPEDtssarima,ic="aic",trace = TRUE)

#look at model
beddatamodel

#autocorelation for auto.arima
acf(ts(beddatamodel$residuals))

#Partial autocorrelation
pacf(ts(beddatamodel$residuals))

#Forecast
mybeddataforecast <- forecast(beddatamodel, level = c(95), h=12)

#Check forecast
mybeddataforecast

#plot
plot(mybeddataforecast)

#Check Accuracy
accuracy(mybeddataforecast)

DATA:

structure(list(occurrence_yrmn = c("2014-January", "2014-February", 
"2014-March", "2014-April", "2014-May", "2014-June", "2014-July", 
"2014-August", "2014-September", "2014-October", "2014-November", 
"2014-December", "2015-January", "2015-February", "2015-March", 
"2015-April", "2015-May", "2015-June", "2015-July", "2015-August", 
"2015-September", "2015-October", "2015-November", "2015-December", 
"2016-January", "2016-February", "2016-March", "2016-April", 
"2016-May", "2016-June", "2016-July", "2016-August", "2016-September", 
"2016-October", "2016-November", "2016-December", "2017-January", 
"2017-February", "2017-March", "2017-April", "2017-May", "2017-June", 
"2017-July", "2017-August", "2017-September", "2017-October", 
"2017-November", "2017-December", "2018-January", "2018-February", 
"2018-March", "2018-April", "2018-May", "2018-June", "2018-July", 
"2018-August", "2018-September", "2018-October", "2018-November", 
"2018-December", "2019-January", "2019-February", "2019-March", 
"2019-April", "2019-May", "2019-June", "2019-July", "2019-August", 
"2019-September", "2019-October", "2019-November", "2019-December", 
"2020-January", "2020-February", "2020-March", "2020-April", 
"2020-May", "2020-June", "2020-July", "2020-August", "2020-September", 
"2020-October", "2020-November", "2020-December", "2021-January", 
"2021-February", "2021-March", "2021-April", "2021-May", "2021-June", 
"2021-July", "2021-August", "2021-September", "2021-October", 
"2021-November", "2021-December"), MCI = c(586, 482, 567, 626, 
625, 610, 576, 634, 636, 663, 657, 556, 513, 415, 510, 542, 549, 
618, 623, 666, 641, 632, 593, 617, 541, 523, 504, 536, 498, 552, 
522, 519, 496, 541, 602, 570, 571, 492, 560, 525, 507, 523, 593, 
623, 578, 657, 683, 588, 664, 582, 619, 512, 630, 644, 563, 654, 
635, 732, 639, 748, 719, 567, 607, 746, 739, 686, 805, 762, 696, 
777, 755, 675, 704, 617, 732, 609, 464, 487, 565, 609, 513, 533, 
505, 578, 526, 418, 428, 421, 502, 452, 509, 492, 478, 469, 457, 
457)), class = c("tbl_df", "tbl", "data.frame"), row.names = c(NA, 
-96L))

My questions:

(1) What would be a more in depth analysis of my plot? I can tell that according to the forecast, there will be and upward trend most of the year 2022 but beyond that I'm not sure how to interpret it in depth. I see as well that that there is a relatively large range.

(2) Are there any steps that I should've done that I missed?

(3) Based on my results, what would be a good next step to choose a better model?

$\endgroup$

1 Answer 1

2
$\begingroup$

First off, thank you for a very nice question that we can immediately work with.

In my opinion, the main thing to address is the elephant in the room. Your plot shows an upward trend starting in 2016 until the beginning of 2020. Your forecast would look quite different if you had run it at the end of 2019:

plot(forecast(auto.arima(window(BEDATA_GROUPEDtssarima,end=c(2019,12))),h=12))

What happened to depress the time series so strongly is presumably the COVID pandemic and its repercussions. People stayed home (whether locked down or voluntarily), so would-be burglars did a lot less breaking and entering.

Your ARIMA model has no clue about this intervention, and how it is going to play out. It currently believes that the series will revert to its long-term average of 575.70, because that is what ARIMA(1,0,1) processes do. I would not trust that forecast overly, because your data generating process, given this structural change, is definitely not ARIMA(1,0,1). (At least auto.arima() get the fact about the huge uncertainty right, which translates into wide prediction intervals.) But see below.

One possibility would be to include a dummy regressor that notes the beginning of the pandemic and run a regression with ARIMA errors. But of course that does not capture the dynamics of the changing response to COVID (and the changed response of burglars to that changed activity pattern of their victims). It's quite possible that people will get out more again, and burglars will become more active, so your original forecast may be quite fine. Alternatively, perhaps the burglars have permanently moved into other areas of activity, and burglaries will stay low. Or we may get another severe COVID wave, people stay home, and burglaries again stay low.

I think your best bet is to make educated assumptions about the COVID pandemic and the likely response by the authorities and the population, then run different models corresponding to these assumptions. One model might include a dummy regressor as above. Another one might model a trend that only starts in the very recent past. Yet another one might use data from the beginning of 2020 on only, modeling a "new normal". Essentially, I am advocating a scenario analysis. I believe you will learn more from that than from trying to tweak your ARIMA model.

$\endgroup$
1
  • $\begingroup$ Thank you for the very detailed response, this provides the insight I was looking for and I can build upon your input to work on this further! $\endgroup$ Dec 7, 2022 at 14:59

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.