Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

update readme #65

Merged
merged 1 commit into from
May 15, 2020
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion DESCRIPTION
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,7 @@ Authors@R: c(
person("Sebastian", "Funk",
email = "[email protected]",
role = c("aut")))
Description: To forecast the time-varying reproduction number and using this to forecast reported case counts. Includes
Description: To forecast the time-varying reproduction number and use this to forecast reported case counts. Includes
tools to evaluate a range of models across samples and time series using proper scoring rules.
License: MIT + file LICENSE
Encoding: UTF-8
Expand Down
5 changes: 1 addition & 4 deletions README.Rmd
Original file line number Diff line number Diff line change
Expand Up @@ -16,10 +16,7 @@ knitr::opts_chunk$set(
[![R build status](https://github.com/epiforecasts/EpiSoon/workflows/R-CMD-check/badge.svg)](https://github.com/epiforecasts/EpiSoon)
[![Build Status](https://travis-ci.com/epiforecasts/EpiSoon.svg?branch=master)](https://travis-ci.com/epiforecasts/EpiSoon)


*Warning: This package is a work in progress and is currently developed solely with the COVID-19 outbreak in mind. Breaking changes may occur and the authors cannot guarantee support.*

**Aim:** To forecast the time-varying reproduction number and using this to forecast reported case counts.
**Aim:** To forecast the time-varying reproduction number and use this to forecast reported case counts.

## Installation

Expand Down
150 changes: 74 additions & 76 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,14 +2,12 @@
# EpiSoon

[![DOI](https://zenodo.org/badge/248311916.svg)](https://zenodo.org/badge/latestdoi/248311916)
[![R build
status](https://github.com/epiforecasts/EpiSoon/workflows/R-CMD-check/badge.svg)](https://github.com/epiforecasts/EpiSoon)
[![Build
Status](https://travis-ci.com/epiforecasts/EpiSoon.svg?branch=master)](https://travis-ci.com/epiforecasts/EpiSoon)

*Warning: This package is a work in progress and is currently developed
solely with the COVID-19 outbreak in mind. Breaking changes may occur
and the authors cannot guarantee support.*

**Aim:** To forecast the time-varying reproduction number and using this
**Aim:** To forecast the time-varying reproduction number and use this
to forecast reported case counts.

## Installation
Expand Down Expand Up @@ -85,72 +83,72 @@ forecasts <- EpiSoon::compare_timeseries(obs_rts, obs_cases, models,

forecasts
#> $forecast_rts
#> # A tibble: 784 x 12
#> timeseries model forecast_date date horizon median mean sd
#> <chr> <chr> <chr> <date> <int> <dbl> <dbl> <dbl>
#> 1 Region 1 AR 3 2020-03-05 2020-03-06 1 2.20 2.20 0.0422
#> 2 Region 1 AR 3 2020-03-05 2020-03-07 2 2.15 2.15 0.0382
#> 3 Region 1 AR 3 2020-03-05 2020-03-08 3 2.09 2.08 0.0611
#> 4 Region 1 AR 3 2020-03-05 2020-03-09 4 2.01 2.01 0.0541
#> 5 Region 1 AR 3 2020-03-05 2020-03-10 5 1.95 1.95 0.0331
#> 6 Region 1 AR 3 2020-03-05 2020-03-11 6 1.91 1.91 0.0444
#> 7 Region 1 AR 3 2020-03-05 2020-03-12 7 1.85 1.85 0.0375
#> 8 Region 1 AR 3 2020-03-06 2020-03-07 1 2.09 2.10 0.0364
#> 9 Region 1 AR 3 2020-03-06 2020-03-08 2 2.02 2.02 0.0158
#> 10 Region 1 AR 3 2020-03-06 2020-03-09 3 1.94 1.94 0.0261
#> # … with 774 more rows, and 4 more variables: bottom <dbl>, lower <dbl>,
#> # upper <dbl>, top <dbl>
#> # A tibble: 798 x 12
#> timeseries model forecast_date date horizon median mean sd bottom
#> <chr> <chr> <chr> <date> <int> <dbl> <dbl> <dbl> <dbl>
#> 1 Region 1 AR 3 2020-03-04 2020-03-05 1 0 1.08 2.15 0
#> 2 Region 1 AR 3 2020-03-04 2020-03-06 2 0.203 0.955 1.59 0
#> 3 Region 1 AR 3 2020-03-04 2020-03-07 3 0.232 0.790 1.26 0
#> 4 Region 1 AR 3 2020-03-04 2020-03-08 4 0.259 1.70 2.69 0
#> 5 Region 1 AR 3 2020-03-04 2020-03-09 5 0.238 1.40 2.35 0
#> 6 Region 1 AR 3 2020-03-04 2020-03-10 6 0.862 0.830 0.880 0
#> 7 Region 1 AR 3 2020-03-04 2020-03-11 7 1.22 1.92 2.95 0
#> 8 Region 1 AR 3 2020-03-05 2020-03-06 1 0.378 1.18 1.88 0
#> 9 Region 1 AR 3 2020-03-05 2020-03-07 2 0.536 1.87 3.64 0
#> 10 Region 1 AR 3 2020-03-05 2020-03-08 3 0.758 1.87 3.44 0
#> # … with 788 more rows, and 3 more variables: lower <dbl>, upper <dbl>,
#> # top <dbl>
#>
#> $rt_scores
#> # A tibble: 616 x 14
#> timeseries model forecast_date date horizon dss crps logs
#> <chr> <chr> <chr> <date> <int> <dbl> <dbl> <dbl>
#> 1 Region 1 AR 3 2020-03-05 2020-03-06 1 -6.43 0.00837 -2.50
#> 2 Region 1 AR 3 2020-03-05 2020-03-07 2 -6.61 0.00733 -2.74
#> 3 Region 1 AR 3 2020-03-05 2020-03-08 3 -5.44 0.0117 -2.43
#> 4 Region 1 AR 3 2020-03-05 2020-03-09 4 -5.16 0.0337 1.22
#> 5 Region 1 AR 3 2020-03-05 2020-03-10 5 -0.766 0.0601 -0.295
#> 6 Region 1 AR 3 2020-03-05 2020-03-11 6 0.361 0.0853 0.418
#> 7 Region 1 AR 3 2020-03-05 2020-03-12 7 10.5 0.128 15.8
#> 8 Region 1 AR 3 2020-03-06 2020-03-07 1 -4.82 0.0378 0.634
#> 9 Region 1 AR 3 2020-03-06 2020-03-08 2 23.8 0.0774 25.4
#> 10 Region 1 AR 3 2020-03-06 2020-03-09 3 14.5 0.102 7.65
#> # … with 606 more rows, and 6 more variables: bias <dbl>, sharpness <dbl>,
#> # A tibble: 630 x 14
#> timeseries model forecast_date date horizon dss crps logs bias
#> <chr> <chr> <chr> <date> <int> <dbl> <dbl> <dbl> <dbl>
#> 1 Region 1 AR 3 2020-03-04 2020-03-05 1 1.76 1.42 13.8 -0.6
#> 2 Region 1 AR 3 2020-03-04 2020-03-06 2 1.49 1.14 2.48 -0.8
#> 3 Region 1 AR 3 2020-03-04 2020-03-07 3 1.65 1.15 2.49 -0.8
#> 4 Region 1 AR 3 2020-03-04 2020-03-08 4 1.90 0.914 2.04 -0.400
#> 5 Region 1 AR 3 2020-03-04 2020-03-09 5 1.70 0.999 2.45 -0.400
#> 6 Region 1 AR 3 2020-03-04 2020-03-10 6 1.70 0.851 1.80 -0.8
#> 7 Region 1 AR 3 2020-03-04 2020-03-11 7 2.06 0.564 1.62 -0.400
#> 8 Region 1 AR 3 2020-03-05 2020-03-06 1 1.48 1.18 6.29 -0.6
#> 9 Region 1 AR 3 2020-03-05 2020-03-07 2 2.48 1.00 2.29 -0.6
#> 10 Region 1 AR 3 2020-03-05 2020-03-08 3 2.37 0.779 1.75 -0.6
#> # … with 620 more rows, and 5 more variables: sharpness <dbl>,
#> # calibration <dbl>, median <dbl>, iqr <dbl>, ci <dbl>
#>
#> $forecast_cases
#> # A tibble: 616 x 12
#> timeseries model forecast_date date horizon median mean sd
#> <chr> <chr> <chr> <date> <int> <dbl> <dbl> <dbl>
#> 1 Region 1 AR 3 2020-03-05 2020-03-06 1 84 81.7 12.0
#> 2 Region 1 AR 3 2020-03-05 2020-03-07 2 101 101. 7.16
#> 3 Region 1 AR 3 2020-03-05 2020-03-08 3 114. 114. 13.8
#> 4 Region 1 AR 3 2020-03-05 2020-03-09 4 130. 133. 17.5
#> 5 Region 1 AR 3 2020-03-05 2020-03-10 5 152 156. 18.0
#> 6 Region 1 AR 3 2020-03-05 2020-03-11 6 187 184 24.0
#> 7 Region 1 AR 3 2020-03-05 2020-03-12 7 202. 212. 33.1
#> 8 Region 1 AR 3 2020-03-06 2020-03-07 1 93 91.2 8.98
#> 9 Region 1 AR 3 2020-03-06 2020-03-08 2 94.5 97.3 8.71
#> 10 Region 1 AR 3 2020-03-06 2020-03-09 3 118 116. 10.7
#> # … with 606 more rows, and 4 more variables: bottom <dbl>, lower <dbl>,
#> # upper <dbl>, top <dbl>
#> # A tibble: 630 x 12
#> timeseries model forecast_date date horizon median mean sd bottom
#> <chr> <chr> <chr> <date> <int> <dbl> <dbl> <dbl> <dbl>
#> 1 Region 1 AR 3 2020-03-04 2020-03-05 1 0 32.3 66.2 0
#> 2 Region 1 AR 3 2020-03-04 2020-03-06 2 7.5 36.3 62.3 0
#> 3 Region 1 AR 3 2020-03-04 2020-03-07 3 6 33.9 70.3 0
#> 4 Region 1 AR 3 2020-03-04 2020-03-08 4 6.5 60.3 129. 0
#> 5 Region 1 AR 3 2020-03-04 2020-03-09 5 4.5 67.7 170. 0
#> 6 Region 1 AR 3 2020-03-04 2020-03-10 6 16 38.7 50.0 0
#> 7 Region 1 AR 3 2020-03-04 2020-03-11 7 38.5 53.9 64.1 0
#> 8 Region 1 AR 3 2020-03-05 2020-03-06 1 13 46.4 74.3 0
#> 9 Region 1 AR 3 2020-03-05 2020-03-07 2 17.5 88.6 178. 0
#> 10 Region 1 AR 3 2020-03-05 2020-03-08 3 30.5 67.7 107. 0
#> # … with 620 more rows, and 3 more variables: lower <dbl>, upper <dbl>,
#> # top <dbl>
#>
#> $case_scores
#> # A tibble: 616 x 15
#> timeseries model sample forecast_date date horizon dss crps
#> <chr> <chr> <chr> <chr> <date> <int> <dbl> <dbl>
#> 1 Region 1 AR 3 1 2020-03-05 2020-03-06 1 5.45 6.13
#> 2 Region 1 AR 3 1 2020-03-05 2020-03-07 2 7.38 8.96
#> 3 Region 1 AR 3 1 2020-03-05 2020-03-08 3 5.96 7.5
#> 4 Region 1 AR 3 1 2020-03-05 2020-03-09 4 6.69 9.02
#> 5 Region 1 AR 3 1 2020-03-05 2020-03-10 5 6.41 7.77
#> 6 Region 1 AR 3 1 2020-03-05 2020-03-11 6 6.81 12.4
#> 7 Region 1 AR 3 1 2020-03-05 2020-03-12 7 7.21 7.99
#> 8 Region 1 AR 3 1 2020-03-06 2020-03-07 1 4.43 2.98
#> 9 Region 1 AR 3 1 2020-03-06 2020-03-08 2 4.55 3.51
#> 10 Region 1 AR 3 1 2020-03-06 2020-03-09 3 4.64 2.86
#> # … with 606 more rows, and 7 more variables: logs <dbl>, bias <dbl>,
#> # sharpness <dbl>, calibration <dbl>, median <dbl>, iqr <dbl>, ci <dbl>
#> # A tibble: 630 x 15
#> timeseries model sample forecast_date date horizon dss crps logs
#> <chr> <chr> <chr> <chr> <date> <int> <dbl> <dbl> <dbl>
#> 1 Region 1 AR 3 1 2020-03-04 2020-03-05 1 8.52 40.8 35.8
#> 2 Region 1 AR 3 1 2020-03-04 2020-03-06 2 8.54 36.3 5.79
#> 3 Region 1 AR 3 1 2020-03-04 2020-03-07 3 9.06 55.9 8.89
#> 4 Region 1 AR 3 1 2020-03-04 2020-03-08 4 9.74 58.9 6.74
#> 5 Region 1 AR 3 1 2020-03-04 2020-03-09 5 10.3 77.9 10.3
#> 6 Region 1 AR 3 1 2020-03-04 2020-03-10 6 12.4 78.2 6.29
#> 7 Region 1 AR 3 1 2020-03-04 2020-03-11 7 11.7 91.1 7.27
#> 8 Region 1 AR 3 1 2020-03-05 2020-03-06 1 8.65 38.1 7.27
#> 9 Region 1 AR 3 1 2020-03-05 2020-03-07 2 10.3 43.1 6.13
#> 10 Region 1 AR 3 1 2020-03-05 2020-03-08 3 9.36 38.6 5.66
#> # … with 620 more rows, and 6 more variables: bias <dbl>, sharpness <dbl>,
#> # calibration <dbl>, median <dbl>, iqr <dbl>, ci <dbl>
```

- Plot an evaluation of Rt forecasts using iterative
Expand Down Expand Up @@ -186,18 +184,18 @@ EpiSoon::plot_forecast_evaluation(forecasts$forecast_cases, obs_cases, c(7)) +
``` r
EpiSoon::summarise_scores(forecasts$case_scores)
#> # A tibble: 27 x 9
#> score model bottom lower median mean upper top sd
#> <chr> <chr> <dbl> <dbl> <dbl> <dbl> <dbl> <dbl> <dbl>
#> 1 bias AR 3 -1.00e+0 1.00e-1 7.00e-1 4.81e-1 1.00e+0 1.00e+0 6.01e-1
#> 2 bias ARIMA -1.00e+0 2.00e-1 8.00e-1 5.37e-1 1.00e+0 1.00e+0 5.79e-1
#> 3 bias Semi-l… -1.00e+0 2.00e-1 6.00e-1 4.87e-1 1.00e+0 1.00e+0 5.79e-1
#> 4 calib… AR 3 8.57e-5 8.57e-5 8.57e-5 2.83e-2 1.20e-4 3.16e-1 8.06e-2
#> 5 calib… ARIMA 8.57e-5 8.57e-5 8.57e-5 3.80e-2 2.00e-4 4.12e-1 9.34e-2
#> 6 calib… Semi-l… 8.57e-5 8.57e-5 9.29e-5 7.22e-2 6.04e-3 9.11e-1 2.01e-1
#> 7 ci AR 3 2.64e+1 5.07e+1 9.99e+1 1.18e+3 2.05e+3 6.79e+3 1.94e+3
#> 8 ci ARIMA 2.25e+1 4.55e+1 9.51e+1 1.09e+3 2.02e+3 6.14e+3 1.77e+3
#> 9 ci Semi-l… 2.61e+1 5.30e+1 9.60e+1 1.07e+3 1.76e+3 5.29e+3 1.71e+3
#> 10 crps AR 3 2.84e+0 6.37e+0 1.66e+1 4.55e+1 7.54e+1 2.03e+2 5.76e+1
#> score model bottom lower median mean upper top sd
#> <chr> <chr> <dbl> <dbl> <dbl> <dbl> <dbl> <dbl> <dbl>
#> 1 bias AR 3 -1.00e+0 -8.75e-1 -8.00e-1 -6.94e-1 -6.00e-1 -0.200 2.65e-1
#> 2 bias ARIMA -1.00e+0 2.00e-1 8.00e-1 5.33e-1 1.00e+0 1 5.70e-1
#> 3 bias Semi-l… -1.00e+0 3.00e-1 8.00e-1 5.37e-1 1.00e+0 1 5.63e-1
#> 4 calib… AR 3 8.57e-5 8.57e-5 8.57e-5 2.83e-2 2.00e-3 0.504 1.26e-1
#> 5 calib… ARIMA 8.57e-5 8.57e-5 8.57e-5 3.59e-2 1.50e-4 0.509 1.15e-1
#> 6 calib… Semi-l… 8.57e-5 8.57e-5 8.57e-5 4.30e-2 1.50e-4 0.587 1.28e-1
#> 7 ci AR 3 1.41e+2 3.76e+2 6.91e+2 1.60e+3 1.63e+3 8488. 2.28e+3
#> 8 ci ARIMA 2.28e+1 4.62e+1 8.40e+1 1.04e+3 1.57e+3 6341. 1.72e+3
#> 9 ci Semi-l… 2.51e+1 5.67e+1 1.26e+2 1.05e+3 1.62e+3 5913. 1.75e+3
#> 10 crps AR 3 3.63e+1 9.19e+1 1.40e+2 1.58e+2 2.00e+2 429. 9.54e+1
#> # … with 17 more rows
```

Expand Down
1 change: 1 addition & 0 deletions _pkgdown.yml
Original file line number Diff line number Diff line change
Expand Up @@ -44,6 +44,7 @@ reference:
- bsts_model
- fable_model
- brms_model
- forecastHybrid_model
- title: Predicting cases from reproduction numbers
desc: Functions to for mapping reproduction number estimates to forecast cases
contents:
Expand Down
Binary file modified man/figures/unnamed-chunk-7-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 modified man/figures/unnamed-chunk-8-1.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.