Skip to content

Commit 6dfa27b

Browse files
committed
fixing rebase problem
1 parent 66d5652 commit 6dfa27b

File tree

1 file changed

+75
-12
lines changed

1 file changed

+75
-12
lines changed

README.Rmd

+75-12
Original file line numberDiff line numberDiff line change
@@ -7,12 +7,41 @@ output: github_document
77
```{r, include = FALSE}
88
options(width = 76)
99
knitr::opts_chunk$set(
10-
collapse = TRUE,
11-
comment = "#>",
1210
fig.path = "man/figures/README-",
13-
out.width = "100%"
11+
digits = 3,
12+
comment = "#>",
13+
collapse = TRUE,
14+
cache = TRUE,
15+
dev.args = list(bg = "transparent"),
16+
dpi = 300,
17+
cache.lazy = FALSE,
18+
out.width = "90%",
19+
fig.align = "center",
20+
fig.width = 9,
21+
fig.height = 6
22+
)
23+
ggplot2::theme_set(ggplot2::theme_bw())
24+
options(
25+
dplyr.print_min = 6,
26+
dplyr.print_max = 6,
27+
pillar.max_footer_lines = 2,
28+
pillar.min_chars = 15,
29+
stringr.view_n = 6,
30+
pillar.bold = TRUE,
31+
width = 77
1432
)
1533
```
34+
```{r pkgs, include=FALSE, echo=FALSE}
35+
library(epipredict)
36+
library(epidatr)
37+
library(data.table)
38+
library(dplyr)
39+
library(tidyr)
40+
library(ggplot2)
41+
library(magrittr)
42+
library(purrr)
43+
library(scales)
44+
```
1645

1746
```{r coloration, include=FALSE, echo=FALSE}
1847
base <- "#002676"
@@ -48,11 +77,26 @@ scale_colour_delphi <- scale_color_delphi
4877
[![R-CMD-check](https://github.com/cmu-delphi/epipredict/actions/workflows/R-CMD-check.yaml/badge.svg)](https://github.com/cmu-delphi/epipredict/actions/workflows/R-CMD-check.yaml)
4978
<!-- badges: end -->
5079

51-
**Note:** This package is currently in development and may not work as expected. Please file bug reports as issues in this repo, and we will do our best to address them quickly.
80+
Epipredict is a framework for building transformation and forecasting pipelines
81+
for epidemiological and other panel time-series datasets.
82+
In addition to tools for building forecasting pipelines, it contains a number of
83+
"canned" forecasters meant to run with little modification as an easy way to get
84+
started forecasting.
85+
86+
It is designed to work well with
87+
[`epiprocess`](https://cmu-delphi.github.io/epiprocess/), a utility for handling
88+
various time series and geographic processing tools in an epidemiological
89+
context.
90+
Both of the packages are meant to work well with the panel data provided by
91+
[`epidatr`](https://cmu-delphi.github.io/epidatr/).
92+
93+
If you are looking for more detail beyond the package documentation, see our
94+
[forecasting book](https://cmu-delphi.github.io/delphi-tooling-book/).
5295

5396
## Installation
5497

55-
To install (unless you're making changes to the package, use the stable version):
98+
To install (unless you're planning on contributing to package development, we
99+
suggest using the stable version):
56100

57101
```r
58102
# Stable version
@@ -61,12 +105,16 @@ pak::pkg_install("cmu-delphi/epipredict@main")
61105
# Dev version
62106
pak::pkg_install("cmu-delphi/epipredict@dev")
63107
```
108+
The documentation for the stable version is at <https://cmu-delphi.github.io/epipredict>, while the development version is at <https://cmu-delphi.github.io/epipredict/dev>.
64109

65-
## Documentation
66110

67-
You can view documentation for the `main` branch at <https://cmu-delphi.github.io/epipredict>.
111+
## Motivating example
68112

69-
## Goals for `epipredict`
113+
To demonstrate the kind of forecast epipredict can make, say we're predicting COVID deaths per 100k for each state on
114+
```{r fc_date}
115+
forecast_date <- as.Date("2021-08-01")
116+
```
117+
Below the fold, we construct this dataset as an `epiprocess::epi_df` from JHU data.
70118

71119
<details>
72120
<summary> Creating the dataset using `{epidatr}` and `{epiprocess}` </summary>
@@ -182,16 +230,16 @@ To make a forecast, we will use a "canned" simple auto-regressive forecaster to
182230
[^3]: lagged by 3 in this context meaning using the value from 3 days ago.
183231

184232
```{r make-forecasts, warning=FALSE}
185-
two_week_ahead <- arx_forecaster(
186-
covid_case_death_rates,
233+
four_week_ahead <- arx_forecaster(
234+
cases_deaths |> filter(time_value <= forecast_date),
187235
outcome = "death_rate",
188236
predictors = c("case_rate", "death_rate"),
189237
args_list = arx_args_list(
190238
lags = list(c(0, 1, 2, 3, 7, 14), c(0, 7, 14)),
191-
ahead = 14
239+
ahead = 4 * 7
192240
)
193241
)
194-
two_week_ahead
242+
four_week_ahead
195243
```
196244

197245
In this case, we have used 0-3 days, a week, and two week lags for the case
@@ -242,10 +290,25 @@ forecast_plot <-
242290
) +
243291
geom_point(data = restricted_predictions, aes(y = .data$value), color = secondary)
244292
```
293+
</details>
245294

246295
```{r show-single-forecast, warning=FALSE, echo=FALSE}
247296
forecast_plot
248297
```
249298
The yellow dot gives the median prediction, while the red interval gives the 5-95% inter-quantile range.
250299
For this particular day and these locations, the forecasts are relatively accurate, with the true data being within the 25-75% interval.
251300
A couple of things to note:
301+
302+
1. Our methods are primarily direct forecasters; this means we don't need to
303+
predict 1, 2,..., 27 days ahead to then predict 28 days ahead
304+
2. All of our existing engines are geo-pooled, meaning the training data is
305+
shared across geographies. This has the advantage of increasing the amount of
306+
available training data, with the restriction that the data needs to be on
307+
comparable scales, such as rates.
308+
309+
## Getting Help
310+
If you encounter a bug or have a feature request, feel free to file an [issue on
311+
our github page](https://github.com/cmu-delphi/epipredict/issues).
312+
For other
313+
questions, feel free to contact [Daniel]([email protected]), [David]([email protected]), [Dmitry]([email protected]), or
314+
[Logan]([email protected]), either via email or on the Insightnet slack.

0 commit comments

Comments
 (0)