Skip to content

Commit

Permalink
Improved readme
Browse files Browse the repository at this point in the history
  • Loading branch information
robjhyndman committed Aug 9, 2020
1 parent e5bed6f commit 9c0779a
Show file tree
Hide file tree
Showing 4 changed files with 25 additions and 17 deletions.
14 changes: 12 additions & 2 deletions README.Rmd
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,17 @@ output: github_document

Book chapter by Rob J Hyndman.

```{r setup, message=FALSE}

```{r setup, include = FALSE}
knitr::opts_chunk$set(
collapse = TRUE,
comment = "#>",
fig.path = "man/figures/README-",
out.width = "100%"
)
```

```{r load, message=FALSE}
library(dplyr)
library(tidyr)
library(ggplot2)
Expand Down Expand Up @@ -116,5 +126,5 @@ snaive_crps <- crps %>%
pull(CRPS)
crps %>%
mutate(skillscore = 100 * (1 - CRPS / snaive_crps)) %>%
arrange(skillscore)
arrange(skillscore)
```
28 changes: 13 additions & 15 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -57,7 +57,7 @@ train %>%
guides(colour = guide_legend("Model"))
```

![](README_files/figure-gfm/unnamed-chunk-1-1.png)<!-- -->
<img src="man/figures/README-unnamed-chunk-1-1.png" width="100%" />

Figure 2: deciles from ETS model

Expand All @@ -77,7 +77,7 @@ fit %>%
labs(x = "Month", y = "Turnover (A$million)")
```

![](README_files/figure-gfm/quantiles-1.png)<!-- -->
<img src="man/figures/README-quantiles-1.png" width="100%" />

Ensemble combining ETS and ARIMA sample paths

Expand All @@ -100,11 +100,10 @@ ensemble <- fit %>%
) %>%
select(-sample) %>%
as_fable(index = date, key = ".model", distribution = value, response = "value")
#> Warning: The dimnames of the fable's distribution are missing and have been set
#> to match the response variables.
```

## Warning: The dimnames of the fable's distribution are missing and have been set
## to match the response variables.

CRPS calculations

``` r
Expand All @@ -118,14 +117,13 @@ snaive_crps <- crps %>%
pull(CRPS)
crps %>%
mutate(skillscore = 100 * (1 - CRPS / snaive_crps)) %>%
arrange(skillscore)
arrange(skillscore)
#> # A tibble: 5 x 4
#> .model .type CRPS skillscore
#> <chr> <chr> <dbl> <dbl>
#> 1 SNAIVE Test 68.6 0
#> 2 ARIMA Test 32.9 52.0
#> 3 ETS Test 31.5 54.0
#> 4 ENSEMBLE Test 31.4 54.3
#> 5 COMBINATION Test 30.9 54.9
```

## # A tibble: 5 x 4
## .model .type CRPS skillscore
## <chr> <chr> <dbl> <dbl>
## 1 SNAIVE Test 68.6 0
## 2 ARIMA Test 32.9 52.0
## 3 ETS Test 31.5 54.0
## 4 ENSEMBLE Test 31.4 54.3
## 5 COMBINATION Test 30.9 54.9
Binary file added man/figures/README-quantiles-1.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added man/figures/README-unnamed-chunk-1-1.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.

0 comments on commit 9c0779a

Please sign in to comment.