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

Full tutorial review day 01 middle-task #11

Merged
merged 4 commits into from
Mar 28, 2024
Merged
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
2 changes: 1 addition & 1 deletion config.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ life_cycle: 'pre-alpha'
license: 'CC-BY 4.0'

# Link to the source repository for this lesson
source: 'https://github.com/epiverse-trace/tutorials'
source: 'https://github.com/epiverse-trace/tutorials-middle'

# Default branch of your lesson
branch: 'main'
Expand Down
22 changes: 15 additions & 7 deletions episodes/quantify-transmissibility.Rmd
Original file line number Diff line number Diff line change
Expand Up @@ -12,8 +12,8 @@ withr::local_options(list(mc.cores = 4))

:::::::::::::::::::::::::::::::::::::: questions

- How can I estimate key transmission metrics from a time series of case data?
- How can I quantify geographical heterogeneity in these metrics?
- How can I estimate the time-varying reproduction number ($Rt$) and growth rate from a time series of case data?
- How can I quantify geographical heterogeneity in these transmission metrics?


::::::::::::::::::::::::::::::::::::::::::::::::
Expand Down Expand Up @@ -68,6 +68,14 @@ In Bayesian inference, we use prior knowledge (prior distributions) with data (i

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

avallecam marked this conversation as resolved.
Show resolved Hide resolved
:::::::::::::::::::::::::::::::::::::::::::::::: instructor

We refer to the Prior probability distribution and the [Posterior probability](https://en.wikipedia.org/wiki/Posterior_probability) distribution.

Lines below, in the "`Expected change in daily cases`" callout, by "the posterior probability that $R_t < 1$", we refer specifically to the [area under the posterior probability distribution curve](https://www.nature.com/articles/nmeth.3368/figures/1).

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


The first step is to load the `{EpiNow2}` package :

Expand Down Expand Up @@ -149,7 +157,7 @@ The number of delays and type of delay is a flexible input that depends on the d

The distribution of incubation period can usually be obtained from the literature. The package `{epiparameter}` contains a library of epidemiological parameters for different diseases obtained from the literature.

We specify a (fixed) gamma distribution with mean $\mu = 4$ and standard deviation $\sigma^2= 2$ (shape = $4$, scale = $1$) using the function `dist_spec()` as follows:
We specify a (fixed) gamma distribution with mean $\mu = 4$ and standard deviation $\sigma= 2$ (shape = $4$, scale = $1$) using the function `dist_spec()` as follows:

```{r}
incubation_period_fixed <- dist_spec(
Expand All @@ -176,15 +184,15 @@ For all types of delay, we will need to use distributions for positive values on

#### Including distribution uncertainty

To specify a **variable** distribution, we include uncertainty around the mean $\mu$ and standard deviation $\sigma^2$ of our gamma distribution. If our incubation period distribution has a mean $\mu$ and standard deviation $\sigma^2$, then we assume the mean ($\mu$) follows a Normal distribution with standard deviation $\sigma_{\mu}^2$:
To specify a **variable** distribution, we include uncertainty around the mean $\mu$ and standard deviation $\sigma$ of our gamma distribution. If our incubation period distribution has a mean $\mu$ and standard deviation $\sigma$, then we assume the mean ($\mu$) follows a Normal distribution with standard deviation $\sigma_{\mu}$:

$$\mbox{Normal}(\mu,\sigma_{\mu}^2)$$

and a standard deviation ($\sigma^2$) follows a Normal distribution with standard deviation $\sigma_{\sigma^2}^2$:
and a standard deviation ($\sigma$) follows a Normal distribution with standard deviation $\sigma_{\sigma}$:

$$\mbox{Normal}(\sigma^2,\sigma_{\sigma^2}^2).$$
$$\mbox{Normal}(\sigma,\sigma_{\sigma}^2).$$

We specify this using `dist_spec` with the additional arguments `mean_sd` ($\sigma_{\mu}^2$) and `sd_sd` ($\sigma_{\sigma^2}^2$).
We specify this using `dist_spec` with the additional arguments `mean_sd` ($\sigma_{\mu}$) and `sd_sd` ($\sigma_{\sigma}$).

```{r}
incubation_period_variable <- dist_spec(
Expand Down
Loading