-
Notifications
You must be signed in to change notification settings - Fork 165
Expand file tree
/
Copy path8-ets_a.qmd
More file actions
143 lines (113 loc) · 4.4 KB
/
8-ets_a.qmd
File metadata and controls
143 lines (113 loc) · 4.4 KB
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
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
---
title: "ETC3550/ETC5550 Applied forecasting"
author: "Ch8. Simple Exponential smoothing"
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(gganimate)
library(purrr)
library(rlang)
library(magick)
```
## Historical perspective
* Developed in the 1950s and 1960s as methods (algorithms) to produce point forecasts.
* Combine a "level", "trend" (slope) and "seasonal" component to describe a time series.
* The rate of change of the components are controlled by "smoothing parameters": $\alpha$, $\beta$ and $\gamma$ respectively.
* Need to choose best values for the smoothing parameters (and initial states).
* Equivalent ETS state space models developed in the 1990s and 2000s.
## Big idea: control the rate of change
\fontsize{13}{14}\sf
$\alpha$ controls the flexibility of the **level**
* If $\alpha = 0$, the level never updates (mean)
* If $\alpha = 1$, the level updates completely (naive)
$\beta$ controls the flexibility of the **trend**
* If $\beta = 0$, the trend is linear
* If $\beta = 1$, the trend changes suddenly every observation
$\gamma$ controls the flexibility of the **seasonality**
* If $\gamma = 0$, the seasonality is fixed (seasonal means)
* If $\gamma = 1$, the seasonality updates completely (seasonal naive)
## Models and methods
### Methods
* Algorithms that return point forecasts.
### Models
* Generate same point forecasts but can also generate forecast distributions.
* A stochastic (or random) data generating process that can generate an entire forecast distribution.
* Allow for "proper" model selection.
## Simple Exponential Smoothing
\vspace*{0.2cm}
\begin{block}{Iterative form}
\centerline{$\pred{y}{t+1}{t} = \alpha y_t + (1-\alpha) \pred{y}{t}{t-1}$}
\end{block}\pause
\begin{block}{Weighted average form}
\centerline{$\displaystyle\pred{y}{T+1}{T}=\sum_{j=0}^{T-1} \alpha(1-\alpha)^j y_{T-j}+(1-\alpha)^T \ell_{0}$}
\end{block}\pause
\begin{block}{Component form}\vspace*{-0.8cm}
\begin{align*}
\text{Forecast equation}&&\pred{y}{t+h}{t} &= \ell_{t}\\
\text{Smoothing equation}&&\ell_{t} &= \alpha y_{t} + (1 - \alpha)\ell_{t-1}
\end{align*}
\end{block}
## Simple Exponential Smoothing
\fontsize{14}{14}\sf
\vspace*{0.2cm}
\begin{block}{Component form}\vspace*{-0.8cm}
\begin{align*}
\text{Forecast equation}&&\pred{y}{t+h}{t} &= \ell_{t}\\
\text{Smoothing equation}&&\ell_{t} &= \alpha y_{t} + (1 - \alpha)\ell_{t-1}
\end{align*}
\end{block}\pause\vspace*{-0.2cm}
Forecast error: $e_t = y_t - \pred{y}{t}{t-1} = y_t - \ell_{t-1}$.\pause
\begin{block}{Error correction form}\vspace*{-0.8cm}
\begin{align*}
y_t &= \ell_{t-1} + e_t\\
\ell_{t}
&= \ell_{t-1}+\alpha( y_{t}-\ell_{t-1})\\
&= \ell_{t-1}+\alpha e_{t}
\end{align*}
\end{block}\pause\vspace*{-0.2cm}
Specify probability distribution: $e_t = \varepsilon_t\sim\text{NID}(0,\sigma^2)$.
## ETS(A,N,N): SES with additive errors
\vspace*{0.2cm}
\begin{block}{ETS(A,N,N) model}\vspace*{-0.8cm}
\begin{align*}
\text{Observation equation}&& y_t &= \ell_{t-1} + \varepsilon_t\\
\text{State equation}&& \ell_t&=\ell_{t-1}+\alpha \varepsilon_t
\end{align*}
\end{block}
where $\varepsilon_t\sim\text{NID}(0,\sigma^2)$.
* "innovations" or "single source of error" because equations have the same error process, $\varepsilon_t$.
* Observation equation: relationship between observations and states.
* State equation(s): evolution of the state(s) through time.
## ETS(M,N,N): SES with multiplicative errors.
* Specify relative errors $\varepsilon_t=\frac{y_t-\pred{y}{t}{t-1}}{\pred{y}{t}{t-1}}\sim \text{NID}(0,\sigma^2)$
* Substituting $\pred{y}{t}{t-1}=\ell_{t-1}$ gives:
* $y_t = \ell_{t-1}+\ell_{t-1}\varepsilon_t$
* $e_t = y_t - \pred{y}{t}{t-1} = \ell_{t-1}\varepsilon_t$
\pause
\begin{block}{ETS(M,N,N) model}\vspace*{-0.8cm}
\begin{align*}
\text{Observation equation}&& y_t &= \ell_{t-1}(1 + \varepsilon_t)\\
\text{State equation}&& \ell_t&=\ell_{t-1}(1+\alpha \varepsilon_t)
\end{align*}
\end{block}
\pause\vspace*{-0.4cm}
* Models with additive and multiplicative errors with the same parameters generate the same point forecasts but different prediction intervals.