class: center, middle, inverse, title-slide # Modelling and forecasting time series in R ###
Dr Matt Ashby
| UCL Jill Dando Institute | October 2021 --- class: animated, fadeIn <img src="forecasting-time-series-in-r_files/figure-html/chart-generic-time-series-1-1.png" width="100%" /> --- class: animated, fadeIn <img src="forecasting-time-series-in-r_files/figure-html/chart-generic-time-series-2-1.png" width="100%" /> --- class: animated, fadeIn <img src="forecasting-time-series-in-r_files/figure-html/chart-generic-time-series-3-1.png" width="100%" /> --- class: animated, fadeIn <img src="forecasting-time-series-in-r_files/figure-html/chart-generic-time-series-4-1.png" width="100%" /> --- class: big-text, animated, fadeIn <img src="forecasting-time-series-in-r_files/figure-html/chart-different-trends-1-1.png" width="100%" /> --- class: big-text, animated, fadeIn <img src="forecasting-time-series-in-r_files/figure-html/chart-different-trends-2-1.png" width="100%" /> --- class: big-text, animated, fadeIn <img src="forecasting-time-series-in-r_files/figure-html/chart-multiple-seasons-1-1.png" width="100%" /> --- class: big-text, animated, fadeIn <img src="forecasting-time-series-in-r_files/figure-html/chart-multiple-seasons-2-1.png" width="100%" /> --- class: big-text, middle, center, animated, fadeIn time-series data typically violate<br>the assumptions of regression models --- class: big-text, animated, fadeIn <img src="forecasting-time-series-in-r_files/figure-html/acf-norm-1.png" width="100%" /> --- class: big-text, animated, fadeIn <img src="forecasting-time-series-in-r_files/figure-html/acf-ts-1.png" width="100%" /> --- class: big-text, middle, center, animated, fadeIn there are *many* ways of<br>modelling time-series data --- class: big-text, middle, animated, fadeIn **ARIMA** models combine one or more: 1. **auto-regression**: *lagged* values of the DV 2. **integration**: *differenced* values of the DV 3. **moving-average** values of the DV --- class: big-text, middle, animated, fadeIn `arima()` in the `stats` package `Arima()` in the `forecast` package `auto.arima()` in the `forecast` package **`ARIMA()` in the `fable` package** `stan_sarima()` in the `bayesforecast` package --- class: middle, center, animated, fadeIn <span style="font-size: 750%">
</span> --- class: big-text, middle, animated, fadeIn # Thanks! These slides:<br>**lesscrime.info/slides/time-series-models-nscr**
**matthew.ashby@ucl.ac.uk**
**@LessCrime** <p style="font-size: 90%;">Cover photo by <a href="https://unsplash.com/@qrenep?utm_source=unsplash&utm_medium=referral&utm_content=creditCopyText">Rene Böhmer</a> on <a href="https://unsplash.com/s/photos/data?utm_source=unsplash&utm_medium=referral&utm_content=creditCopyText">Unsplash</a></p>