Skip to content

Commit

Permalink
Update package and function notation
Browse files Browse the repository at this point in the history
Fixes #25 for current tutorials
  • Loading branch information
amanda-minter committed Sep 21, 2023
1 parent 169cc91 commit 4051ff8
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 7 deletions.
2 changes: 1 addition & 1 deletion episodes/compare_interventions.Rmd
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,7 @@ In mathematical modelling, we must make assumptions about how NPIs will affect t
#### Effect of school closures on COVID-19 spread
We want to investigate the effect of school closures on reducing the number of infected and infectious with COVID-19 through time.

Using an SEIR model (`epidemic_default` in the R package `epidemics`) we set $R_0 = 2.7$, preinfectious_period $= 3$ and the infectious_period $= 7$ (parameters adapted from [Davies et al. (2020)](https://doi.org/10.1016/S2468-2667(20)30133-X)). We load a contact matrix with 5 yearly age bins using `socialmixr` and assume that one in every 1 million in each 5 year age group is infectious.
Using an SEIR model (`epidemic_default()` in the R package `{epidemics}`) we set $R_0 = 2.7$, preinfectious_period $= 3$ and the infectious_period $= 7$ (parameters adapted from [Davies et al. (2020)](https://doi.org/10.1016/S2468-2667(20)30133-X)). We load a contact matrix with 5 yearly age bins using `{socialmixr}` and assume that one in every 1 million in each 5 year age group is infectious.

We assume that school closure will reduce the contact rates between school aged children (aged 0-15) and individuals aged 15 and over, and will cause a small reduction in the contact rate between adults (aged 15 and over).

Expand Down
12 changes: 6 additions & 6 deletions episodes/simulating_transmission.Rmd
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@ Using the R package `epidemics`, learn how to:

Mathematical models are useful tools for generating future trajectories of disease spread. Models can be used to evaluate the implementation of non-pharmaceutical and pharmaceutical interventions while accounting for factors such as age.

In this tutorial, we will use the R package [`epidemics`](https://github.com/epiverse-trace/epidemics) to generate trajectories of influenza spread. By the end of this tutorial, you will be able to generate the trajectory below showing the number of infectious individuals in different age categories through time.
In this tutorial, we will use the R package `{epidemics}` to generate trajectories of influenza spread. By the end of this tutorial, you will be able to generate the trajectory below showing the number of infectious individuals in different age categories through time.

```{r traj, echo = FALSE, message= FALSE}
# load contact and population data from socialmixr::polymod
Expand Down Expand Up @@ -142,7 +142,7 @@ To generate predictions of infectious disease trajectories, we must first select

In `epidemics` models are defined as either *epidemic* models or *outbreak* models. *Epidemic* models focus on directly transmitted diseases with pandemic potential (such as influenza and Covid), and *outbreak* models, focus on diseases that are not expected to have pandemic potential (such as Ebola).

There is a library of epidemic and outbreak models to choose from in `epidemics`. Models are prefixed with either epidemic or outbreak, and suffixed by the infection name. In this tutorial, we will use the default epidemic model, `epidemic_default` which is described in the next section.
There is a library of epidemic and outbreak models to choose from in `epidemics`. Models are prefixed with either epidemic or outbreak, and suffixed by the infection name. In this tutorial, we will use the default epidemic model, `epidemic_default()` which is described in the next section.


::::::::::::::::::::::::::::::::::::: callout
Expand Down Expand Up @@ -205,7 +205,7 @@ We will learn how to specify the contact matrix $C$ in the next section.

We will simulate a strain of influenza with pandemic potential with $R_0=1.5$, a preinfectious period of 3 days and infectious period of 7 days.

In `epidemics`, we use the function `infection` to create an infection object containing the values of, $R_0$, the preinfectious period ($1/\alpha$) and the infectious period ($1/\gamma$) as follows.
In `epidemics`, we use the function `infection()` to create an infection object containing the values of, $R_0$, the preinfectious period ($1/\alpha$) and the infectious period ($1/\gamma$) as follows.

```{r, eval = FALSE}
influenza <- infection(
Expand Down Expand Up @@ -240,7 +240,7 @@ The contact matrix is a square matrix consisting of rows/columns equal to the nu

If we believe that transmission of an infection is driven by contact, and that contact rates are very different for different age groups, then specifying a contact matrix allows us to account for age specific rates of transmission.

Contact matrices can be estimated from surveys or contact data, or synthetic ones can be used. We will use the R package [`socialmixr`](https://cran.r-project.org/web/packages/socialmixr/) to load in a contact matrix estimated from POLYMOD survey data [(Mossong et al. 2008)](https://doi.org/10.1371/journal.pmed.0050074).
Contact matrices can be estimated from surveys or contact data, or synthetic ones can be used. We will use the R package `{socialmixr}` to load in a contact matrix estimated from POLYMOD survey data [(Mossong et al. 2008)](https://doi.org/10.1371/journal.pmed.0050074).


::::::::::::::::::::::::::::::::::::: challenge
Expand Down Expand Up @@ -292,7 +292,7 @@ The result is a square matrix with rows and columns for each age group. Contact
::::::::::::::::::::::::::::::::::::: callout
### Why would a contact matrix be non-symmetric?

One of the arguments of the function `contact_matrix` is `symmetric=TRUE`. This means that the total number of contacts of age group 1 with age group 2, should be the same as the total number of contacts of age group 2 and age group 1 (see the `socialmixr` [vignette](https://cran.r-project.org/web/packages/socialmixr/vignettes/socialmixr.html) for more detail). However, when contact matrices are estimated from surveys or other sources, the *reported* number of contacts may differ by age group resulting in a non-symmetric contact matrix [(Prem et al 2021)](https://doi.org/10.1371/journal.pcbi.1009098).
One of the arguments of the function `contact_matrix()` is `symmetric=TRUE`. This means that the total number of contacts of age group 1 with age group 2, should be the same as the total number of contacts of age group 2 and age group 1 (see the `socialmixr` [vignette](https://cran.r-project.org/web/packages/socialmixr/vignettes/socialmixr.html) for more detail). However, when contact matrices are estimated from surveys or other sources, the *reported* number of contacts may differ by age group resulting in a non-symmetric contact matrix [(Prem et al 2021)](https://doi.org/10.1371/journal.pcbi.1009098).
::::::::::::::::::::::::::::::::::::::::::::::::


Expand Down Expand Up @@ -350,7 +350,7 @@ names(demography_vector) <- rownames(contact_matrix)
demography_vector
```

To create our population object, we call the function `population` specifying a name, the contact matrix, the demography vector and the initial conditions.
To create our population object, we call the function `population()` specifying a name, the contact matrix, the demography vector and the initial conditions.

```{r population}
uk_population <- population(
Expand Down

0 comments on commit 4051ff8

Please sign in to comment.