-
Notifications
You must be signed in to change notification settings - Fork 2
/
Copy path04-model-advanced.Rmd
50 lines (37 loc) · 1.48 KB
/
04-model-advanced.Rmd
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
# Advanced modelling {#advanced}
## Batch
https://github.com/tidyverts/fable/wiki/Tidy-forecasting-with-the-fable-package
Estimating multiple models is a **key** feature of fable. Most time series can be naturally disaggregated using a series of factors known as keys. These keys are used to uniquely identify separate time series, each of which can be modelled separately.
```{r batch}
UKLungDeaths %>%
gather("sex", "deaths") %>%
model(ETS(deaths))
```
## Decomposition
https://github.com/tidyverts/fable/wiki/Combining-models
Objects which support a `components` method can then have their components modelled separately. The working name for this functionality is `model_components`, however a shorter (single word) verb is preferred.
The user should be able to specify how each of the components are modelled, and the `components` method should define how each component is combined (and perhaps some default models that can be used).
```{r decomp}
library(feasts)
md_decomp <- UKLungDeaths %>%
STL(mdeaths ~ season(window = 12))
md_decomp
```
```{r decomp-plot, echo = FALSE}
md_decomp %>%
gather(component, value) %>%
ggplot(aes(x = index, y = value)) +
geom_line() +
facet_grid(component ~ ., scales = "free_y", switch = "y") +
theme_minimal() +
ylab(NULL)
```
```{r modelcomponents, eval = FALSE}
md_decomp %>%
model_components(???)
```
## Ensemble
https://github.com/tidyverts/fable/issues/34
## Boosting
## Reconciliation
https://github.com/tidyverts/fable/issues/36