Skip to content

Commit 3e4f99e

Browse files
committed
differences for PR #149
1 parent 339d6ff commit 3e4f99e

10 files changed

Lines changed: 5438 additions & 26 deletions

.DS_Store

-6 KB
Binary file not shown.

compare-interventions.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,7 @@ exercises: 30 # exercise time in minutes
2525

2626
+ Complete tutorials [Simulating transmission](../episodes/simulating-transmission.md) and [Modelling interventions](../episodes/modelling-interventions.md)
2727

28-
Learners should familiarise themselves with following concept dependencies before working through this tutorial:
28+
Learners should familiarise themselves with the following concept dependencies before working through this tutorial:
2929

3030
**Outbreak response**: [Intervention types](https://www.cdc.gov/nonpharmaceutical-interventions/).
3131
:::::::::::::::::::::::::::::::::

config.yaml

Lines changed: 86 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,86 @@
1+
#------------------------------------------------------------
2+
# Values for this lesson.
3+
#------------------------------------------------------------
4+
5+
# Which carpentry is this (swc, dc, lc, or cp)?
6+
# swc: Software Carpentry
7+
# dc: Data Carpentry
8+
# lc: Library Carpentry
9+
# cp: Carpentries (to use for instructor training for instance)
10+
# incubator: The Carpentries Incubator
11+
carpentry: 'epiverse-trace'
12+
13+
# Overall title for pages.
14+
title: 'Scenario modelling for outbreak analytics with R'
15+
16+
# Date the lesson was created (YYYY-MM-DD, this is empty by default)
17+
created:
18+
19+
# Comma-separated list of keywords for the lesson
20+
keywords: 'epidemic models, interventions'
21+
22+
# Life cycle stage of the lesson
23+
# possible values: pre-alpha, alpha, beta, stable
24+
life_cycle: 'pre-alpha'
25+
26+
# License of the lesson materials (recommended CC-BY 4.0)
27+
license: 'CC-BY 4.0'
28+
29+
# Link to the source repository for this lesson
30+
source: 'https://github.com/epiverse-trace/tutorials-late'
31+
32+
# Default branch of your lesson
33+
branch: 'main'
34+
35+
# Who to contact if there are any issues
36+
contact: 'andree.valle-campos@lshtm.ac.uk'
37+
38+
# Navigation ------------------------------------------------
39+
#
40+
# Use the following menu items to specify the order of
41+
# individual pages in each dropdown section. Leave blank to
42+
# include all pages in the folder.
43+
#
44+
# Example -------------
45+
#
46+
# episodes:
47+
# - introduction.md
48+
# - first-steps.md
49+
#
50+
# learners:
51+
# - setup.md
52+
#
53+
# instructors:
54+
# - instructor-notes.md
55+
#
56+
# profiles:
57+
# - one-learner.md
58+
# - another-learner.md
59+
60+
# Order of episodes in your lesson
61+
episodes:
62+
- contact-matrices.Rmd
63+
- simulating-transmission.Rmd
64+
- model-choices.Rmd
65+
- modelling-interventions.Rmd
66+
- compare-interventions.Rmd
67+
- vaccine-comparisons.Rmd
68+
- disease-burden.Rmd
69+
70+
# Information for Learners
71+
learners:
72+
73+
# Information for Instructors
74+
instructors:
75+
76+
# Learner Profiles
77+
profiles:
78+
79+
# Customisation ---------------------------------------------
80+
#
81+
# This space below is where custom yaml items (e.g. pinning
82+
# sandpaper and varnish versions) should live
83+
84+
85+
varnish: epiverse-trace/varnish@epiversetheme
86+
sandpaper: epiverse-trace/sandpaper@patch-renv-github-bug

contact-matrices.md

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -155,7 +155,7 @@ However, when contact matrices are estimated from surveys or other sources, the
155155
- Recall bias: Different age groups may have different abilities to remember and report contacts accurately
156156
- Reporting bias: Some groups may systematically over- or under-report their contacts
157157
- Sampling uncertainty: Limited sample sizes can lead to statistical variations
158-
[(Prem et al 2021)](https://doi.org/10.1371/journal.pcbi.1009098)
158+
[(Prem et al. 2021)](https://doi.org/10.1371/journal.pcbi.1009098)
159159

160160
If `symmetric` is set to TRUE, the `contact_matrix()` function will internally use an average of reported contacts to ensure the resulting total number of contacts are symmetric.
161161

@@ -303,7 +303,7 @@ Contact matrices can be used in a wide range of epidemiological analyses, they c
303303
+ to calculate the basic reproduction number while accounting for different rates of contacts between age groups [(Funk et al. 2019)](https://doi.org/10.1186/s12916-019-1413-7),
304304
+ to calculate final size of an epidemic, as in the R package `{finalsize}`,
305305
+ to assess the impact of interventions finding the relative change between pre and post intervention contact matrices to calculate the relative difference in $R_0$ [(Jarvis et al. 2020)](https://doi.org/10.1186/s12916-020-01597-8),
306-
+ and in mathematical models of transmission within a population, to account for group specific contact patterns.
306+
+ and in mathematical models of transmission within a population, to account for group-specific contact patterns.
307307

308308

309309
However, all of these applications require us to perform some additional calculations using the contact matrix. Specifically, there are two main calculations we often need to do:
@@ -354,7 +354,7 @@ When simulating an epidemic, we often want to ensure that the average number of
354354

355355
Rather than just using the raw number of contacts, we can instead normalise the contact matrix to make it easier to work in terms of $R_0$. In particular, we normalise the matrix by scaling it so that if we were to calculate the average number of secondary cases based on this normalised matrix, the result would be 1 (in mathematical terms, we are scaling the matrix so the largest eigenvalue is 1). This transformation scales the entries but preserves their relative values.
356356

357-
In the case of the above model, we want to define $\beta C_{i,j}$ so that the model has a specified valued of $R_0$. If the entry of the contact matrix $C[i,j]$ represents the contacts of population $i$ with $j$, it is equivalent to `contacts_byage$matrix[i,j]`, and the maximum eigenvalue of this matrix represents the typical magnitude of contacts, not typical magnitude of transmission. We must therefore normalise the matrix $C$ so the maximum eigenvalue is one; we call this matrix $C_{normalised}$. Because the rate of recovery is $\gamma$, individuals will be infectious on average for $1/\gamma$ days. So $\beta$ as a model input is calculated from $R_0$, the scaling factor and the value of $\gamma$ (i.e. mathematically we use the fact that the dominant eigenvalue of the matrix $R_0 \times C_{normalised}$ is equal to $\beta / \gamma$).
357+
In the case of the above model, we want to define $\beta C_{i,j}$ so that the model has a specified valued of $R_0$. If the entry of the contact matrix $C[i,j]$ represents the contacts of population $i$ with $j$, it is equivalent to `contacts_byage$matrix[i,j]`, and the maximum eigenvalue of this matrix represents the typical magnitude of contacts, not the typical magnitude of transmission. We must therefore normalise the matrix $C$ so the maximum eigenvalue is one; we call this matrix $C_{normalised}$. Because the rate of recovery is $\gamma$, individuals will be infectious on average for $1/\gamma$ days. So $\beta$ as a model input is calculated from $R_0$, the scaling factor and the value of $\gamma$ (i.e. mathematically we use the fact that the dominant eigenvalue of the matrix $R_0 \times C_{normalised}$ is equal to $\beta / \gamma$).
358358

359359

360360
``` r
@@ -422,15 +422,15 @@ We can use contact matrices from `socialmixr` with mathematical models in the R
422422

423423
### Contact groups
424424

425-
In the example above the dimension of the contact matrix will be the same as the number of age groups i.e. if there are 3 age groups then the contact matrix will have 3 rows and 3 columns. Contact matrices can be used for other groups as long as the dimension of the matrix matches the number of groups.
425+
In the example above the dimension of the contact matrix will be the same as the number of age groups, i.e. if there are 3 age groups then the contact matrix will have 3 rows and 3 columns. Contact matrices can be used for other groups as long as the dimension of the matrix matches the number of groups.
426426

427427
For example, we might have a meta population model with two geographic areas. Then our contact matrix would be a 2 x 2 matrix with entries representing the contact between and within the geographic areas.
428428

429429

430430

431431
## Summary
432432

433-
In this tutorial, we have learnt the definition of the contact matrix, how they are estimated and how to access social contact data from `socialmixr`. In the next tutorial, we will learn how to use the R package `{epidemics}` to generate disease trajectories from mathematical models with contact matrices from `socialmixr`.
433+
In this tutorial, we have learnt the definition of the contact matrix, how they are estimated and how to access social contact data using `{contactsurveys}` and `{socialmixr}`. In the next tutorial, we will learn how to use the R package `{epidemics}` to generate disease trajectories from mathematical models, with contact matrices using `socialmixr`.
434434

435435
::::::::::::::::::::::::::::::::::::: keypoints
436436

md5sum.txt

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -4,16 +4,16 @@
44
"config.yaml" "a0c04c1d43ce0640c3ea333b140e89c8" "site/built/config.yaml" "2026-03-31"
55
"index.md" "32bc80d6f4816435cc0e01540cb2a513" "site/built/index.md" "2026-03-31"
66
"links.md" "8184cf4149eafbf03ce8da8ff0778c14" "site/built/links.md" "2026-03-31"
7-
"episodes/contact-matrices.Rmd" "e59e7693721efa46bcc86816c3a5f0d7" "site/built/contact-matrices.md" "2026-03-31"
8-
"episodes/simulating-transmission.Rmd" "dce9308fbfa74fe44696565aeb4f84dc" "site/built/simulating-transmission.md" "2026-03-31"
7+
"episodes/contact-matrices.Rmd" "4096a9d798657e0133d37334ced4089d" "site/built/contact-matrices.md" "2026-03-31"
8+
"episodes/simulating-transmission.Rmd" "3958176281b56054b988feb0233ee1d5" "site/built/simulating-transmission.md" "2026-03-31"
99
"episodes/model-choices.Rmd" "1d7867d102c815827f30564850561523" "site/built/model-choices.md" "2026-03-31"
10-
"episodes/modelling-interventions.Rmd" "ccf69684551e51fa16127f7a35c47e11" "site/built/modelling-interventions.md" "2026-03-31"
11-
"episodes/compare-interventions.Rmd" "1eeeb57efcbf171daf8f88c0b1fc9a12" "site/built/compare-interventions.md" "2026-03-31"
12-
"episodes/vaccine-comparisons.Rmd" "78365f2fcbb5f29909bdfc39fd718123" "site/built/vaccine-comparisons.md" "2026-03-31"
10+
"episodes/modelling-interventions.Rmd" "7ad77f77e2210ee45b810ac14c55545e" "site/built/modelling-interventions.md" "2026-03-31"
11+
"episodes/compare-interventions.Rmd" "eb0ccc4ab575a1593b0c36d3e7d0b870" "site/built/compare-interventions.md" "2026-03-31"
12+
"episodes/vaccine-comparisons.Rmd" "aa13b19cb340ef16f82994cd2d580126" "site/built/vaccine-comparisons.md" "2026-03-31"
1313
"episodes/disease-burden.Rmd" "9579a4368c9b300a0cc2e02ca170630b" "site/built/disease-burden.md" "2026-03-31"
1414
"instructors/instructor-notes.md" "ca3834a1b0f9e70c4702aa7a367a6bb5" "site/built/instructor-notes.md" "2026-03-31"
1515
"learners/BF_measles.Rmd" "5725a25d664730bbce3736a3243c2182" "site/built/BF_measles.md" "2026-03-31"
1616
"learners/reference.md" "9e836f1ec999f95f55135cdd2c78d2e6" "site/built/reference.md" "2026-03-31"
17-
"learners/setup.md" "ffd5d44669ec7f69d57de7088e6b2773" "site/built/setup.md" "2026-03-31"
17+
"learners/setup.md" "2d643903a0227046ad28221dc37df06b" "site/built/setup.md" "2026-03-31"
1818
"profiles/learner-profiles.md" "31b503c4b5bd1f0960ada730eca4a25e" "site/built/learner-profiles.md" "2026-03-31"
1919
"renv/profiles/lesson-requirements/renv.lock" "143d1859c7b2e4c666f55209ffc1a56c" "site/built/renv.lock" "2026-03-31"

modelling-interventions.md

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@ exercises: 30 # exercise time in minutes
2222

2323
+ Complete tutorial on [Simulating transmission](../episodes/simulating-transmission.md).
2424

25-
Learners should also familiarise themselves with following concept dependencies before working through this tutorial:
25+
Learners should also familiarise themselves with the following concept dependencies before working through this tutorial:
2626

2727
**Outbreak response**: [Intervention types](https://www.cdc.gov/nonpharmaceutical-interventions/).
2828

@@ -394,7 +394,7 @@ Then continue with the livecoding.
394394

395395
## Pharmaceutical interventions
396396

397-
Pharmaceutical interventions (PIs) are measures such as vaccination and mass treatment programs. In the previous section, we integrated the interventions into the model by reducing parameter values during specific period of time window in which these intervention set to take place. In the case of vaccination, we assume that after the intervention, individuals are no longer susceptible and should be classified into a different disease state. Therefore, we specify the rate at which individuals are vaccinated and track the number of vaccinated individuals over time.
397+
Pharmaceutical interventions (PIs) are measures such as vaccination and mass treatment programs. In the previous section, we integrated the interventions into the model by reducing parameter values during a specific time period in which these intervention are set to take place. In the case of vaccination, we assume that after the intervention, some or all individuals are no longer susceptible and should be classified into a different disease state. Therefore, we specify the rate at which individuals are vaccinated and track the number of vaccinated individuals over time.
398398

399399
The diagram below shows the SEIRV model implemented using `model_default()` where susceptible individuals are vaccinated and then move to the $V$ class.
400400

@@ -414,9 +414,9 @@ $$
414414
\end{aligned}
415415
$$
416416

417-
Individuals in age group ($i$) at specific time dependent ($t$) are vaccinated at rate ($\nu_{i,t}$). The other SEIR components of these equations are described in the tutorial [simulating transmission](../episodes/simulating-transmission.md#simulating-disease-spread).
417+
Individuals in age group ($i$) at specific time dependent ($t$) are vaccinated at rate ($\nu_{i,t}$). The other SEIR components of these equations are described in the tutorial [simulating transmission](../episodes/simulating-transmission.md#simulating-disease-spread).
418418

419-
To explore the effect of vaccination we need to create a vaccination object to pass as an input into `model_default()` that includes age groups specific vaccination rate `nu` and age groups specific start and end times of the vaccination program (`time_begin` and `time_end`).
419+
To explore the effect of vaccination we need to create a vaccination object to pass as an input into `model_default()` that includes age-group-specific vaccination rate `nu` and age-group-specific start and end times of the vaccination program (`time_begin` and `time_end`).
420420

421421
Here we will assume all age groups are vaccinated at the same rate 0.01 and that the vaccination program starts on day 40 and continue to be in place for 150 days.
422422

0 commit comments

Comments
 (0)