Skip to content

Commit

Permalink
markdown source builds
Browse files Browse the repository at this point in the history
Auto-generated via {sandpaper}
Source  : 5c76e4e
Branch  : main
Author  : Amanda Minter <[email protected]>
Time    : 2023-12-21 14:05:03 +0000
Message : update late tasks from feedback (#85)

* Extend challenge in 'Choosing an appropriate model'

* Edit to accounting for uncertainty example

Store all results and then extract infectious compartment for plotting

* Add detail to Ebola case study challenge

* update glossary entries

* Add callout on ODE solver

* clarify purpose of concept dependencies

* Updates from review

* Remove infection object

* Update simulating-transmission.Rmd

* Update model-choices.Rmd

* Add exercise to `compare_interventions.Rmd`

* update modelling interventions after review

* Update renv.lock

* update plots

* make uncertainty plots consistent across episodes

* fix broken link

* making plots consistent across tutorials

* update summary and key points

* update plots and add challenge

* update introduction

* move contact matrix callout

and clarify reduction is performed within the model functions

* add callout on intervention types

* update introduction and reorder text in other sections

* update PI section

* style code

* spell check

* Update compare-interventions.Rmd

* Apply suggestions from code review

Co-authored-by: Andree Valle Campos <[email protected]>

* Update episodes/modelling-interventions.Rmd

Co-authored-by: Andree Valle Campos <[email protected]>

* add dropdown menus to make section more interactive

* add reminder about transmissibility calculation

* link to latent period

* update model terms

* add note on flow diagram

* add callout on model rates

* Update episodes/simulating-transmission.Rmd

Co-authored-by: Andree Valle Campos <[email protected]>

* Update episodes/simulating-transmission.Rmd

Co-authored-by: Andree Valle Campos <[email protected]>

* Update episodes/simulating-transmission.Rmd

Co-authored-by: Andree Valle Campos <[email protected]>

* Update episodes/simulating-transmission.Rmd

Co-authored-by: Andree Valle Campos <[email protected]>

* Update episodes/simulating-transmission.Rmd

Co-authored-by: Andree Valle Campos <[email protected]>

* update tutorial objectives

* distinguish parameter definitions from process descriptions in flow diagram

* Update model-choices.Rmd

* remove pak call from set up

* Update renv.lock

---------

Co-authored-by: Andree Valle Campos <[email protected]>
  • Loading branch information
actions-user and avallecam committed Dec 21, 2023
1 parent 0766f9d commit 8ba98d6
Show file tree
Hide file tree
Showing 17 changed files with 830 additions and 309 deletions.
166 changes: 149 additions & 17 deletions compare-interventions.md
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ exercises: 30 # exercise time in minutes

::::::::::::::::::::::::::::::::::::: objectives

- Understand how to compare intervention scenarios
- Compare intervention scenarios

::::::::::::::::::::::::::::::::::::::::::::::::

Expand All @@ -25,7 +25,7 @@ exercises: 30 # exercise time in minutes
## Prerequisites
+ Complete tutorials [Simulating transmission](../episodes/simulating-transmission.md) and [Modelling interventions](../episodes/modelling-interventions.md)

This tutorial has the following concept dependencies:
Learners should familiarise themselves with following concept dependencies before working through this tutorial:

**Outbreak response** : [Intervention types](https://www.cdc.gov/nonpharmaceutical-interventions/).
:::::::::::::::::::::::::::::::::
Expand All @@ -50,7 +50,7 @@ In this tutorial we introduce the concept of the counter factual and how to comp

## Vacamole model

The Vacamole model is a deterministic model based on a system of ODEs in [Ainslie et al. 2022]( https://doi.org/10.2807/1560-7917.ES.2022.27.44.2101090). The model consists of 11 compartments, individuals are classed as one of the following:
The Vacamole model is a deterministic model based on a system of ODEs in [Ainslie et al. 2022]( https://doi.org/10.2807/1560-7917.ES.2022.27.44.2101090) to describe the effect of vaccination on COVID-19 dynamics. The model consists of 11 compartments, individuals are classed as one of the following:

+ susceptible, $S$,
+ partial vaccination ($V_1$), fully vaccination ($V_2$),
Expand All @@ -64,42 +64,174 @@ The diagram below describes the flow of individuals through the different compar

<img src="fig/compare-interventions-rendered-unnamed-chunk-1-1.png" style="display: block; margin: auto;" />

See `?epidemics::model_vacamole_cpp` for detail on how to run the model.

## Comparing scenarios
::::::::::::::::::::::::::::::::::::: challenge

*Coming soon*
## Running a counterfactual scenario using the Vacamole model

## Challenge
1. Run the model with the default parameter values for the UK population assuming that :

*Coming soon*
+ 1 in a million individual are infectious (and not vaccinated) at the start of the simulation
+ The contact matrix for the United Kingdom has age bins:
+ age between 0 and 20 years,
+ age between 20 and 40,
+ 40 years and over.
+ There is no vaccination scheme in place

2. Using the output, plot the number of deaths through time


::::::::::::::::: hint

### Vaccination code

To run the model with no vaccination in place we can *either* create two vaccination objects (one for each dose) using `vaccination()` with the time start, time end and vaccination rate all set to 0, or we can use the `no_vaccination()` function to create a vaccination object for two doses with all values set to 0.


```r
no_vaccination <- no_vaccination(population = uk_population, doses = 2)
```
::::::::::::::::::::::

::::::::::::::::: hint

### HINT : Running the model with default parameter values

We can run the Vacamole model with [default parameter values](https://epiverse-trace.github.io/epidemics/articles/vacamole.html#model-epidemic-using-vacamole) by just specifying the population object and number of time steps to run the model for:



```r
output <- model_vacamole_cpp(
population = uk_population,
vaccination = no_vaccination,
time_end = 300
)
```

::::::::::::::::::::::

<!-- ::::::::::::::::::::::::::::::::::::: challenge -->

<!-- ## The effect of vaccination on COVID-19 hospitalisations -->

::::::::::::::::: solution

### SOLUTION

<!-- ::::::::::::::::: hint -->
1. Run the model

<!-- ### HINT -->

```r
polymod <- socialmixr::polymod
contact_data <- socialmixr::contact_matrix(
survey = polymod,
countries = "United Kingdom",
age.limits = c(0, 20, 40),
symmetric = TRUE
)
```

<!-- :::::::::::::::::::::: -->
```{.output}
Using POLYMOD social contact data. To cite this in a publication, use the 'get_citation()' function
```

```{.output}
Removing participants that have contacts without age information. To change this behaviour, set the 'missing.contact.age' option
```

<!-- ::::::::::::::::: solution -->
```r
# prepare contact matrix
contact_matrix <- t(contact_data$matrix)

<!-- ### SOLUTION -->
# extract demography vector
demography_vector <- contact_data$demography$population
names(demography_vector) <- rownames(contact_matrix)

# prepare initial conditions
initial_i <- 1e-6

initial_conditions <- c(
S = 1 - initial_i,
V1 = 0, V2 = 0,
E = 0, EV = 0,
I = initial_i, IV = 0,
H = 0, HV = 0, D = 0, R = 0
)

initial_conditions <- rbind(
initial_conditions,
initial_conditions,
initial_conditions
)
rownames(initial_conditions) <- rownames(contact_matrix)

# prepare population object
uk_population <- population(
name = "UK",
contact_matrix = contact_matrix,
demography_vector = demography_vector,
initial_conditions = initial_conditions
)

<!-- ::::::::::::::::::::::::::: -->
no_vaccination <- no_vaccination(population = uk_population, doses = 2)

# run model
output <- model_vacamole_cpp(
population = uk_population,
vaccination = no_vaccination,
time_end = 300
)
```

2. Plot the number of deaths through time


```r
ggplot(output[output$compartment == "dead", ]) +
geom_line(
aes(time, value, colour = demography_group),
linewidth = 1
) +
scale_colour_brewer(
palette = "Dark2",
labels = rownames(contact_matrix),
name = "Age group"
) +
scale_y_continuous(
labels = scales::comma
) +
labs(
x = "Simulation time (days)",
y = "Individuals"
) +
theme(
legend.position = "top"
) +
theme_bw(
base_size = 15
)
```

<img src="fig/compare-interventions-rendered-unnamed-chunk-5-1.png" style="display: block; margin: auto;" />



:::::::::::::::::::::::::::


::::::::::::::::::::::::::::::::::::::::::::::::



## Comparing scenarios

*Coming soon*



## Challenge : Ebola outbreak analysis

*Coming soon*

<!-- :::::::::::::::::::::::::::::::::::::::::::::::: -->



Expand Down
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 fig/model-choices-rendered-diagram-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 fig/model-choices-rendered-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.
Binary file added fig/model-choices-rendered-unnamed-chunk-3-1.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
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 fig/simulating-transmission-rendered-diagram-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 fig/simulating-transmission-rendered-plot-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 fig/simulating-transmission-rendered-traj-1.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
28 changes: 14 additions & 14 deletions md5sum.txt
Original file line number Diff line number Diff line change
@@ -1,15 +1,15 @@
"file" "checksum" "built" "date"
"CODE_OF_CONDUCT.md" "549f00b0992a7743c2bc16ea6ce3db57" "site/built/CODE_OF_CONDUCT.md" "2023-12-20"
"LICENSE.md" "14377518ee654005a18cf28549eb30e3" "site/built/LICENSE.md" "2023-12-20"
"config.yaml" "46df6477e1ca41a1c87c0bd036c4de8a" "site/built/config.yaml" "2023-12-20"
"index.md" "adfca1a79e0106ee8b3f7731d0678b59" "site/built/index.md" "2023-12-20"
"links.md" "8184cf4149eafbf03ce8da8ff0778c14" "site/built/links.md" "2023-12-20"
"episodes/simulating-transmission.Rmd" "24073c38e72e7759cf1552223940032e" "site/built/simulating-transmission.md" "2023-12-20"
"episodes/model-choices.Rmd" "638cbe36fb15612bc564e5cf9f3c77e5" "site/built/model-choices.md" "2023-12-20"
"episodes/modelling-interventions.Rmd" "ef12f024f60c47a957d364fa60d8b4b3" "site/built/modelling-interventions.md" "2023-12-20"
"episodes/compare-interventions.Rmd" "6155de0722b94f8de3318d726d27f723" "site/built/compare-interventions.md" "2023-12-20"
"instructors/instructor-notes.md" "ca3834a1b0f9e70c4702aa7a367a6bb5" "site/built/instructor-notes.md" "2023-12-20"
"learners/reference.md" "7980e987fc72761f30df53cb3ef246fc" "site/built/reference.md" "2023-12-20"
"learners/setup.md" "b3c6bfa13fd687f926bb1a3e772a2516" "site/built/setup.md" "2023-12-20"
"profiles/learner-profiles.md" "31b503c4b5bd1f0960ada730eca4a25e" "site/built/learner-profiles.md" "2023-12-20"
"renv/profiles/lesson-requirements/renv.lock" "9a76afbb24cadc53e338a9e657e62139" "site/built/renv.lock" "2023-12-20"
"CODE_OF_CONDUCT.md" "549f00b0992a7743c2bc16ea6ce3db57" "site/built/CODE_OF_CONDUCT.md" "2023-12-21"
"LICENSE.md" "14377518ee654005a18cf28549eb30e3" "site/built/LICENSE.md" "2023-12-21"
"config.yaml" "46df6477e1ca41a1c87c0bd036c4de8a" "site/built/config.yaml" "2023-12-21"
"index.md" "adfca1a79e0106ee8b3f7731d0678b59" "site/built/index.md" "2023-12-21"
"links.md" "8184cf4149eafbf03ce8da8ff0778c14" "site/built/links.md" "2023-12-21"
"episodes/simulating-transmission.Rmd" "957e9471afa392a97da1551ce4a3b572" "site/built/simulating-transmission.md" "2023-12-21"
"episodes/model-choices.Rmd" "866aab771a26d00ceed93750cee4b265" "site/built/model-choices.md" "2023-12-21"
"episodes/modelling-interventions.Rmd" "258a8c0cc1fe6fbfabc3f90ca0d41a36" "site/built/modelling-interventions.md" "2023-12-21"
"episodes/compare-interventions.Rmd" "f5ffe39d7728f03fb8cbe5efade69501" "site/built/compare-interventions.md" "2023-12-21"
"instructors/instructor-notes.md" "ca3834a1b0f9e70c4702aa7a367a6bb5" "site/built/instructor-notes.md" "2023-12-21"
"learners/reference.md" "de73c95256f9030b72ac9d56ff91cfe6" "site/built/reference.md" "2023-12-21"
"learners/setup.md" "b3c6bfa13fd687f926bb1a3e772a2516" "site/built/setup.md" "2023-12-21"
"profiles/learner-profiles.md" "31b503c4b5bd1f0960ada730eca4a25e" "site/built/learner-profiles.md" "2023-12-21"
"renv/profiles/lesson-requirements/renv.lock" "c62d98bb51b1182dd5d21c540241976e" "site/built/renv.lock" "2023-12-21"
Loading

0 comments on commit 8ba98d6

Please sign in to comment.