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

Add vignette on generations required to achieve a set outbreak size #77

Draft
wants to merge 4 commits into
base: main
Choose a base branch
from
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
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
1 change: 1 addition & 0 deletions _pkgdown.yml
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@ articles:
- title: Package vignettes
navbar: Package vignettes
contents:
- gens_to_n_cases
- title: Modelling guides and background
navbar: Modelling guides and background
contents:
Expand Down
46 changes: 46 additions & 0 deletions vignettes/gens_to_n_cases.Rmd
Original file line number Diff line number Diff line change
@@ -0,0 +1,46 @@
---
title: "Number of generations to achieve a set outbreak size"
author: "James Azam"
output:
bookdown::html_vignette2:
fig_caption: yes
code_folding: show
pkgdown:
as_is: true
bibliography: references.json
link-citations: true
vignette: >
%\VignetteEncoding{UTF-8}
%\VignetteIndexEntry{Number of generations to achieve a set outbreak size}
%\VignetteEngine{knitr::rmarkdown}
editor_options:
chunk_output_type: console
---

```{r setup, include=FALSE}
knitr::opts_chunk$set(
echo = TRUE,
message = FALSE,
warning = FALSE,
collapse = TRUE,
comment = "#>"
)
```

# Outline

* Question: At what generation does an outbreak reach a size of 100, given that
it was started by a single individual with R0 = 1.5, and individual
transmission, $k$, at levels of 0.01, 0.1, 0.5, 1, 4, and Infinity?
* Method:
* We use a negative binomial model with $mu = 1.5$ and
$size = c(0.01, 0.1, 0.5, 1, 4, Inf)$.
* We run 10, 000 simulations per each combination of $mu$ and $size$
* We aggregate chain sizes by generation and extract the generation
where cumulative chain size = 100.
* We find the percentage of simulations that reached the 100 case size
threshold.
* Outcome: The distribution (boxplot) of the realized generations per value of
$k$. This reproduces Fig 2c of @lloyd-smith2005.

# References