generated from epiforecasts/evaluate-delta-for-forecasting
-
Notifications
You must be signed in to change notification settings - Fork 0
/
README.Rmd
107 lines (72 loc) · 3.71 KB
/
README.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
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
---
output: github_document
---
```{r setup, include=FALSE}
knitr::opts_chunk$set(
echo = TRUE, eval = FALSE,
fig.width = 9, fig.height = 9,
dpi = 320,
fig.path = "figures/"
)
```
# Evaluating the impact of modelling Omicron strain dynamics on short-term COVID-19 forecast performance
This repository contains the code, and analysis used to evaluate the impact of modelling Omicron strain dynamics on short-term COVID-19 forecast performance. In addition it also contains the write up of this work. See the documentation for further details.
## Citation
If making use of the results of this analysis or reusing the analysis pipeline please cite:
If making using of the models evaluated in this analysis please also cite [`forecast.vocs`](https://epiforecasts.io/forecast.vocs):
## Documentation
```{r, child = "docs/chunks/documentation.Rmd", eval = TRUE, echo = FALSE}
tmp <- 1
```
## Key files and folders
Folder/File | Purpose
---|---
[`writeup`](writeup/) | Summary paper and additional supplementary information as `Rmarkdown` documents.
[`_targets.R`](_targets.R) | Analysis workflow. Combines separate sections from[`_targets_r`](_targets_r).
[`R`](R/) | R functions used in the analysis and for evaluation.
[`data`](data/) | Input data and summarised output generated by steps in the analysis.
[`analyses`](analyses/) | Ad-hoc analyses not part of the overarching workflow.
[`.devcontainer`](.devcontainer/) | Resources for reproducibility using `vscode` and `docker`.
## Dependencies
All dependencies can be installed using the following,
```{r}
remotes::install_dev_deps()
```
If `cmdstanr` has not been installed previously then stan may need to be installed. This can be done using the following,
```r
cmdstanr::install_cmdstan()
```
Alternatively a docker [container](https://github.com/epiforecasts/eval-omicron-for-case-forecasting/blob/main/.devcontainer/Dockerfile) and [image](https://github.com/epiforecasts/eval-omicron-for-case-forecasting/pkgs/container/eval-omicron-for-case-forecasting) is provided. An easy way to make use of this is using the Remote development extension of `vscode`.
## Analyses
This analysis in this repository has been implemented using the [`targets`](https://docs.ropensci.org/targets/) package and associated packages. The workflow is defined in [`_targets.md`](https://github.com/epiforecasts/eval-omicron-for-case-forecasting/blob/main/_targets.md) and can be explored interactively using [`_targets.Rmd`](https://github.com/epiforecasts/eval-omicron-for-case-forecasting/blob/main/_targets.Rmd) `Rmarkdown` document. The workflow can be visualised as the following graph.
![](figures/targets-graph.png)
This complete analysis can be recreated using the following (note this may take quite some time even with a fairly large amount of available compute),
```{bash}
bash bin/update-targets.sh
```
Alternative the following `targets` functions may be used to interactively explore the workflow:
- Run the workflow sequentially.
```{r}
targets::tar_make()
```
- Run the workflow using all available workers.
```{r}
targets::tar_make_future(workers = future::availableCores())
```
- Explore a graph of the workflow.
```{r}
targets::tar_visnetwork(targets_only = TRUE)
```
Watch the workflow as it runs in a `shiny` app.
```{r}
targets::tar_watch(targets_only = TRUE)
```
Objects from the workflow can be loaded into an interactive session using the following,
```{r}
targets::tar_load("<target>")
```
To use our archived version of the interim results (and so avoid long run times) use the following to download it. Note that this process has not been rigorously tested across environments and so may not work seamlessly).
```{r}
source(here::here("R", "targets-archive.R"))
get_targets_archive()
```