-
Notifications
You must be signed in to change notification settings - Fork 167
/
9-arima_a.qmd
101 lines (73 loc) · 2.76 KB
/
9-arima_a.qmd
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
---
title: "ETC3550/ETC5550 Applied forecasting"
author: "Ch9. ARIMA models"
institute: "OTexts.org/fpp3/"
pdf-engine: pdflatex
fig-width: 7.5
fig-height: 3
format:
beamer:
theme: monash
aspectratio: 169
fontsize: 14pt
section-titles: false
knitr:
opts_chunk:
dev: "cairo_pdf"
include-in-header: header.tex
execute:
echo: false
message: false
warning: false
---
```{r setup, include=FALSE}
source("setup.R")
library(patchwork)
library(purrr)
```
## ARIMA models
\begin{tabular}{@{}rl}
\textbf{AR}: & autoregressive (lagged observations as inputs)\\
\textbf{I}: & integrated (differencing to make series stationary)\\
\textbf{MA}: & moving average (lagged errors as inputs)
\end{tabular}
###
An ARIMA model is rarely interpretable in terms of visible data structures like trend and seasonality. But it can capture a huge range of time series patterns.
## Stationarity
\vspace*{0.2cm}
\begin{block}{Definition}
If $\{y_t\}$ is a stationary time series, then for all $s$, the distribution of $(y_t,\dots,y_{t+s})$ does not depend on $t$.
\end{block}\pause\vspace*{-0.3cm}
Transformations help to **stabilize the variance**.\newline
For ARIMA modelling, we also need to **stabilize the mean**.
### Differencing
* Differencing helps to **stabilize the mean**.
* First differencing: *change* between consecutive observations: $y'_t = y_t - y_{t-1}$.
* Seasonal differencing: *change* between years: $y'_t = y_t - y_{t-m}$.
## Automatic differencing
\vspace*{0.2cm}
### Using unit root tests for first differencing
1. Augmented Dickey Fuller test: null hypothesis is that the data are non-stationary and non-seasonal.
2. Kwiatkowski-Phillips-Schmidt-Shin (KPSS) test: null hypothesis is that the data are stationary and non-seasonal.
### Seasonal strength
STL decomposition: $y_t = T_t+S_t+R_t$
Seasonal strength $F_s = \max\big(0, 1-\frac{\text{Var}(R_t)}{\text{Var}(S_t+R_t)}\big)$
If $F_s > 0.64$, do one seasonal difference.
## Random walk model
If differenced series is white noise with zero mean:
\begin{block}{}
\centerline{$y_t-y_{t-1}=\varepsilon_t$ \hspace{0.4cm} or \hspace{0.4cm} $y_t=y_{t-1}+\varepsilon_t$}
\end{block}\vspace*{-0.3cm}
where $\varepsilon_t \sim NID(0,\sigma^2)$.
* Model behind the \alert{naïve method}.
* Forecast are equal to the last observation (future movements up or down are equally likely).
\vspace*{10cm}
## Random walk with drift model
If differenced series is white noise with non-zero mean:
\begin{block}{}
\centerline{$y_t-y_{t-1}=c+\varepsilon_t$ \hspace{0.4cm} or \hspace{0.4cm} $y_t=c+y_{t-1}+\varepsilon_t$}
\end{block}\vspace*{-0.3cm}
where $\varepsilon_t \sim NID(0,\sigma^2)$.
* $c$ is the \alert{average change} between consecutive observations.
* Model behind the \alert{drift method}.
\vspace*{10cm}