Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Update of JOSS paper #162

Merged
merged 37 commits into from
Aug 19, 2024
Merged
Show file tree
Hide file tree
Changes from 6 commits
Commits
Show all changes
37 commits
Select commit Hold shift + click to select a range
3211e09
Added ORCID numbers
chitrams May 30, 2024
3be6869
Partial dependency plots, test
chitrams Jun 10, 2024
1b46843
Improved draft
chitrams Jun 13, 2024
faa1744
Improved example section
chitrams Jun 13, 2024
b6c2533
Updated implementation section
chitrams Jun 13, 2024
d1dd0d4
Updated paper
chitrams Jun 13, 2024
fb5153e
Updated paper introduction
chitrams Jun 20, 2024
f5e4fed
Updated paper intro
chitrams Jun 20, 2024
d024b0d
Updated introduction
chitrams Jul 1, 2024
b5f3937
Updated implementation section
chitrams Jul 1, 2024
98b66c0
Updated "model interface" section
chitrams Jul 16, 2024
5d96330
Updated conclusion section
chitrams Jul 16, 2024
5425c35
Added an abstract
chitrams Jul 16, 2024
161a633
Updated abstract
chitrams Jul 16, 2024
026d43b
Updated abstract
chitrams Jul 16, 2024
9192d81
Updated conlcusion
chitrams Jul 16, 2024
f35cb4a
Updated syncomat implementation example
chitrams Jul 16, 2024
4f8e707
Updated implementation section
chitrams Jul 16, 2024
3137c16
Updated abstract
chitrams Jul 17, 2024
e8e7179
Updated motivation / introduction
chitrams Jul 17, 2024
f7ef791
Updated for JOSS format
chitrams Jul 19, 2024
dd4afe9
Updated explanation on partial dependency plots, and how exponentiati…
chitrams Jul 23, 2024
ec1f502
Improved explanation for model fitting
chitrams Jul 23, 2024
09d2c5d
improved wording
chitrams Jul 23, 2024
cf0b8dc
Updated intro and conclusion; improved wording
chitrams Jul 24, 2024
216d9dc
adding some notes from review
njtierney Aug 7, 2024
0e87018
more minor touches
njtierney Aug 8, 2024
eba2797
updates from meeting with Mike
njtierney Aug 8, 2024
b46d21c
various word cutting down from meeting
njtierney Aug 9, 2024
99ac709
Fit more word cleanup
MikeLydeamore Aug 14, 2024
6159f1d
update checking function + plot snapshots
njtierney Aug 14, 2024
988abd7
pushing partial prediction helpers
njtierney Aug 16, 2024
df2b90f
Tweak plot layout
MikeLydeamore Aug 19, 2024
ac32d5f
Finish up text around partial predictives, clean up
MikeLydeamore Aug 19, 2024
4318b4a
use quarto
njtierney Aug 19, 2024
9153481
added a couple of small TODO notes and some small wording changes
njtierney Aug 19, 2024
80b59ee
changes from meeting with Michael
njtierney Aug 19, 2024
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 2 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -11,4 +11,5 @@ README_cache
.pre-commit-config.yaml
tests/README.md
paper/*.html
paper/*.pdf
paper/*.pdf
chitra/
41 changes: 24 additions & 17 deletions paper/paper.Rmd
Original file line number Diff line number Diff line change
@@ -1,21 +1,21 @@
---
title: 'conmat: generate synthetic contact matrices for a given age population'
title: 'conmat: generate synthetic contact matrices for a given age-stratified population'
authors:
- affiliation: 1
name: Nicholas Tierney
orcid: 0000-0003-1460-8722
- affiliation: 1,2
name: Nick Golding
orcid:
orcid: 0000-0001-8916-5570
- affiliation: 1,3
name: Aarathy Babu
orcid:
- affiliation: 4
name: Michael Lydeamore
orcid:
orcid: 0000-0001-6515-827X
- affiliation: 1,3
name: Chitra Saraswati
orcid:
orcid: 0000-0002-8159-0414
date: "03 May 2024"
output:
html_document:
Expand All @@ -37,7 +37,7 @@ affiliations:
name: Monash University
---

```{r}
```{r Document Setup}
#| label: setup
#| echo: false
#| message: false
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This chunk already has the label paramenter on line 41, so you don't need to have "Document Setup" in the chunk header. I'm also fairly sure that you can't have spaced in label names.

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Oops. I'll revert the changes. Thank you!

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Unfortunately removing the label in the chunk header means the code chunks don't show their labels in VS Code's outline viewer (it shows up as "unnamed-chunk" instead). The labels only shows up when I include them in the chunk headers.

Expand All @@ -56,9 +56,9 @@ options(tinytex.clean = FALSE)

# Summary

Epidemiologists and public policy makers need to understand the spread of infectious diseases in a population. Knowing which groups are most vulnerable, and how disease spread will unfold facilitates public health decision-making. Diseases like influenza and coronavirus spread via human-to-human, "social contact". If we can measure the amount of social contact, we can use this to understand how diseases spread.
Epidemiologists and public policy makers need to understand the dynamics of infectious disease transmission in a population. Identifying vulnerable groups and predicting disease transmission dynamics are essential for informed public health decision-making. Infectious diseases such as influenza and coronavirus spread through human-to-human interactions, or in other words, "social contact". Quantifying social contact and its patterns can provide critical insights into how diseases spread.

We can measure social contact through social contact surveys, where people describe the number and type of social contact they have. These surveys provide an empirical estimate of the number of social contacts from one age group to another, as well as the setting of contact. For example, we might learn from a contact survey that homes have higher contact with 25-50 year olds and with 0-15 year olds, whereas workplaces might have high contact within 25-60 year olds.
We can measure social contact through social contact surveys, where people describe the number and type of social contact they have. These surveys provide an empirical estimate of the number of social contacts from one age group to another and the setting of contact. For example, we might learn from a contact survey that homes have higher contact between 25-50 year olds and 0-15 year olds, whereas workplaces might have high contact within 25-60 year olds.

These surveys exist for a variety of countries, for example, @mossong2008 the "POLYMOD" study, covered 8 European countries: Belgium, Germany, Finland, Great Britain, Italy, Luxembourg, The Netherlands and Poland [@mossong2008]. However, what do we do when we want to look at contact rates in different countries that haven’t been measured? We can use this existing data to help us project to countries or places that do not have empirical survey data. These are called "synthetic contact matrices". A very popular approach by Prem et al projected from the POLYMOD study to 152 countries [@prem2017]. This which was later updated to include contact matrices for 177 countries at "urban" and "rural" levels for each country [@prem2021].

Expand All @@ -74,44 +74,51 @@ The `conmat` package was created to fill a specific need for creating synthetic

# Example

As an example, let us generate a contact matrix for a local area using POLYMOD data.
As an example, let us generate a contact matrix for a local government area within Australia, using a model fitted from the POLYMOD data.

Suppose we want to get a contact matrix for a given region in Australia, let's say the city of Perth. We can get that from a helper function, `abs_age_lga`.
Suppose we want to generate a contact matrix for the City of Perth. We can get the age-stratified population data for Perth from the helper function `abs_age_lga`:

```{r}
```{r load conmat}
#| label: load-conmat
library(conmat)
perth <- abs_age_lga("Perth (C)")
perth
```

We can get a contact matrix made for `perth` using the `extrapolate_polymod` function:
We can generate a contact matrix for `perth` using the `extrapolate_polymod` function, where the contact matrix is generated using a model fitted from the POLYMOD data.

```{r}
```{r extrapolate polymod}
#| label: extrapolate-polymod
#| echo: true
perth_contact <- extrapolate_polymod(population = perth)
perth_contact
```

We can plot this with `autoplot`
We can plot the resulting contact matrix for Perth with `autoplot`:

```{r}
```{r autoplot contacts}
#| label: autoplot-contacts
autoplot(perth_contact)
```

# Implementation

Conmat was built to predict at four settings: work, school, home, and other. The model is built to predict four separate models, one for each setting.
The model is a poisson generalised additive model (gam), predicting the count of contacts, with an offset of the log of participants. There are six terms to explain six key features of the relationship between ages, and optional terms for attendance at school or work, depending on which setting the model is predicting to.
`conmat` was built to predict at four settings: work, school, home, and other.
The model is built to predict four separate models, one for each setting. [ #TODO a better way of saying the sentence prior? Predict four separate matrices?]
The model is a Poisson generalised additive model (GAM), predicting the count of contacts, with an offset of the log of participants. There are six terms to explain six key features of the relationship between ages, and optional terms for attendance at school or work, depending on which setting the model is predicting to.

The six terms are

The six key features of the relationship are shown in the figure below
The six key features of the relationship are shown in the figure below.

```{r}
# use DHARMA to show a partial dep plot of the six main terms
```

Each cell in the resulting contact matrix, indexed *i*, *j*, is the predicted number of people in age group *j* that a single individual in age group *i* will have contact with per day. If you sum across all the *j* age groups for each *i* age group, you get the predicted total number of contacts per day for each individual of age group *i*. [ #TODO expected, predicted, or average?]

[ #TODO notes-to-self: the model structure wasn't generated through any particularly robust process, it was just coming up with structures that looked mildly appropriate for our use case.

## Model interfaces

We provide multiple levels for the user to interact with for model fitting, further detail can be seen at: https://idem-lab.github.io/conmat/dev/
Expand Down
Loading