Skip to content

Commit

Permalink
differences for PR #138
Browse files Browse the repository at this point in the history
  • Loading branch information
actions-user committed May 7, 2024
1 parent 7034c07 commit 26294df
Show file tree
Hide file tree
Showing 26 changed files with 299 additions and 2,562 deletions.
14 changes: 5 additions & 9 deletions compare-interventions.md
Original file line number Diff line number Diff line change
Expand Up @@ -128,11 +128,7 @@ contact_data <- socialmixr::contact_matrix(
)
```

```{.output}
Using POLYMOD social contact data. To cite this in a publication, use the 'get_citation()' function
```

```{.output}
```output
Removing participants that have contacts without age information. To change this behaviour, set the 'missing.contact.age' option
```

Expand Down Expand Up @@ -171,15 +167,15 @@ uk_population <- population(
)
```

```{.error}
```error
Error in population(name = "UK", contact_matrix = contact_matrix, demography_vector = demography_vector, : could not find function "population"
```

```r
no_vaccination <- no_vaccination(population = uk_population, doses = 2)
```

```{.error}
```error
Error in no_vaccination(population = uk_population, doses = 2): could not find function "no_vaccination"
```

Expand All @@ -192,7 +188,7 @@ output <- model_vacamole_cpp(
)
```

```{.error}
```error
Error in model_vacamole_cpp(population = uk_population, vaccination = no_vaccination, : could not find function "model_vacamole_cpp"
```

Expand Down Expand Up @@ -225,7 +221,7 @@ ggplot(output[output$compartment == "dead", ]) +
)
```

```{.error}
```error
Error in ggplot(output[output$compartment == "dead", ]): could not find function "ggplot"
```

Expand Down
87 changes: 0 additions & 87 deletions config.yaml

This file was deleted.

56 changes: 20 additions & 36 deletions create-forecast.md
Original file line number Diff line number Diff line change
Expand Up @@ -60,15 +60,12 @@ estimates <- epinow(
)
```

```{.output}
WARN [2024-03-22 13:04:53] epinow: There were 6 divergent transitions after warmup. See
```output
WARN [2024-05-07 02:06:31] epinow: There were 3 divergent transitions after warmup. See
https://mc-stan.org/misc/warnings.html#divergent-transitions-after-warmup
to find out why this is a problem and how to eliminate them. -
WARN [2024-03-22 13:04:53] epinow: Examine the pairs() plot to diagnose sampling problems
WARN [2024-05-07 02:06:31] epinow: Examine the pairs() plot to diagnose sampling problems
-
WARN [2024-03-22 13:04:55] epinow: Bulk Effective Samples Size (ESS) is too low, indicating posterior means and medians may be unreliable.
Running the chains for more iterations may help. See
https://mc-stan.org/misc/warnings.html#bulk-ess -
```


Expand Down Expand Up @@ -136,26 +133,26 @@ estimates <- epinow(
)
```

```{.output}
WARN [2024-03-22 13:12:06] epinow: There were 3 divergent transitions after warmup. See
```output
WARN [2024-05-07 02:13:27] epinow: There were 2 divergent transitions after warmup. See
https://mc-stan.org/misc/warnings.html#divergent-transitions-after-warmup
to find out why this is a problem and how to eliminate them. -
WARN [2024-03-22 13:12:06] epinow: Examine the pairs() plot to diagnose sampling problems
WARN [2024-05-07 02:13:27] epinow: Examine the pairs() plot to diagnose sampling problems
-
```

```r
summary(estimates)
```

```{.output}
```output
measure estimate
<char> <char>
1: New confirmed cases by infection date 17867 (9893 -- 30108)
1: New confirmed cases by infection date 17945 (10150 -- 31476)
2: Expected change in daily cases Likely decreasing
3: Effective reproduction no. 0.88 (0.56 -- 1.3)
4: Rate of growth -0.016 (-0.065 -- 0.034)
5: Doubling/halving time (days) -44 (20 -- -11)
3: Effective reproduction no. 0.89 (0.57 -- 1.3)
4: Rate of growth -0.015 (-0.064 -- 0.039)
5: Doubling/halving time (days) -46 (18 -- -11)
```


Expand Down Expand Up @@ -249,10 +246,6 @@ deaths_forecast <- forecast_secondary(
plot(deaths_forecast)
```

```{.warning}
Warning: Removed 30 rows containing missing values (`position_stack()`).
```

<img src="fig/create-forecast-rendered-unnamed-chunk-11-1.png" style="display: block; margin: auto;" />

The plot shows the forecast secondary observations (deaths) over the dates which we have recorded cases for.
Expand Down Expand Up @@ -341,38 +334,29 @@ ebola_estimates <- epinow(
)
```

```{.output}
WARN [2024-03-22 13:13:55] epinow: There were 442 divergent transitions after warmup. See
```output
WARN [2024-05-07 02:15:30] epinow: There were 22 divergent transitions after warmup. See
https://mc-stan.org/misc/warnings.html#divergent-transitions-after-warmup
to find out why this is a problem and how to eliminate them. -
WARN [2024-03-22 13:13:55] epinow: Examine the pairs() plot to diagnose sampling problems
WARN [2024-05-07 02:15:30] epinow: Examine the pairs() plot to diagnose sampling problems
-
WARN [2024-03-22 13:13:57] epinow: The largest R-hat is NA, indicating chains have not mixed.
Running the chains for more iterations may help. See
https://mc-stan.org/misc/warnings.html#r-hat -
WARN [2024-03-22 13:13:59] epinow: Bulk Effective Samples Size (ESS) is too low, indicating posterior means and medians may be unreliable.
Running the chains for more iterations may help. See
https://mc-stan.org/misc/warnings.html#bulk-ess -
WARN [2024-03-22 13:14:00] epinow: Tail Effective Samples Size (ESS) is too low, indicating posterior variances and tail quantiles may be unreliable.
Running the chains for more iterations may help. See
https://mc-stan.org/misc/warnings.html#tail-ess -
```

```r
summary(ebola_estimates)
```

```{.output}
```output
measure estimate
<char> <char>
1: New confirmed cases by infection date 123 (49 -- 429)
1: New confirmed cases by infection date 101 (47 -- 274)
2: Expected change in daily cases Increasing
3: Effective reproduction no. 1.9 (1.1 -- 4.3)
4: Rate of growth 0.052 (0.0086 -- 0.13)
5: Doubling/halving time (days) 13 (5.3 -- 81)
3: Effective reproduction no. 1.7 (1 -- 3.1)
4: Rate of growth 0.043 (0.003 -- 0.096)
5: Doubling/halving time (days) 16 (7.2 -- 230)
```

The effective reproduction number $R_t$ estimate (on the last date of the data) is 1.9 (1.1 -- 4.3). The exponential growth rate of case numbers is 0.052 (0.0086 -- 0.13).
The effective reproduction number $R_t$ estimate (on the last date of the data) is 1.7 (1 -- 3.1). The exponential growth rate of case numbers is 0.043 (0.003 -- 0.096).

Visualize the estimates:

Expand Down
Binary file modified fig/create-forecast-rendered-unnamed-chunk-11-1.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified fig/create-forecast-rendered-unnamed-chunk-3-1.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified fig/create-forecast-rendered-unnamed-chunk-9-1.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified fig/introduction-rendered-unnamed-chunk-5-1.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file removed fig/model-choices-rendered-unnamed-chunk-3-1.png
Binary file not shown.
Binary file removed fig/model-choices-rendered-unnamed-chunk-4-1.png
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file modified fig/quantify-transmissibility-rendered-unnamed-chunk-15-1.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified fig/quantify-transmissibility-rendered-unnamed-chunk-16-1.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified fig/quantify-transmissibility-rendered-unnamed-chunk-19-1.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file removed fig/simulating-transmission-rendered-plot-1.png
Binary file not shown.
Binary file removed fig/simulating-transmission-rendered-traj-1.png
Binary file not shown.
Binary file removed fig/simulating-transmission-rendered-visualise-1.png
Binary file not shown.
8 changes: 7 additions & 1 deletion introduction.md
Original file line number Diff line number Diff line change
Expand Up @@ -81,7 +81,7 @@ Case incidence data must be stored in a data frame with the observed number of c
example_confirmed
```

```{.output}
```output
date confirm
<Date> <num>
1: 2020-02-22 14
Expand Down Expand Up @@ -134,6 +134,12 @@ epinow_estimates <- epinow(
)
```

```output
WARN [2024-05-07 01:08:57] epinow: Bulk Effective Samples Size (ESS) is too low, indicating posterior means and medians may be unreliable.
Running the chains for more iterations may help. See
https://mc-stan.org/misc/warnings.html#bulk-ess -
```

As an output, we get the time-varying (or [effective](../learners/reference.md#effectiverepro)) reproduction number, as well as the cases by date of report and date of infection:


Expand Down
36 changes: 18 additions & 18 deletions md5sum.txt
Original file line number Diff line number Diff line change
@@ -1,19 +1,19 @@
"file" "checksum" "built" "date"
"CODE_OF_CONDUCT.md" "549f00b0992a7743c2bc16ea6ce3db57" "site/built/CODE_OF_CONDUCT.md" "2024-03-22"
"LICENSE.md" "14377518ee654005a18cf28549eb30e3" "site/built/LICENSE.md" "2024-03-22"
"config.yaml" "d11647b34aa74192704ce8944e83b0d8" "site/built/config.yaml" "2024-03-22"
"index.md" "adfca1a79e0106ee8b3f7731d0678b59" "site/built/index.md" "2024-03-22"
"links.md" "8184cf4149eafbf03ce8da8ff0778c14" "site/built/links.md" "2024-03-22"
"episodes/introduction.Rmd" "1861ec911e99b7feab3b65e0dbd91d41" "site/built/introduction.md" "2024-03-22"
"episodes/read-delays.Rmd" "2c7422e552f8e16c28449877182c0704" "site/built/read-delays.md" "2024-03-22"
"episodes/quantify-transmissibility.Rmd" "f507b32d4af315d95acc3f3f5a60c202" "site/built/quantify-transmissibility.md" "2024-03-22"
"episodes/create-forecast.Rmd" "3fdb0f4223f220d061431f18846bf1f4" "site/built/create-forecast.md" "2024-03-22"
"episodes/simulating-transmission.Rmd" "3f006aa142099aaeaa4688c064bd5d4a" "site/built/simulating-transmission.md" "2024-03-22"
"episodes/model-choices.Rmd" "775bfba024103820482bc56907d86f14" "site/built/model-choices.md" "2024-03-22"
"episodes/modelling-interventions.Rmd" "4955dd207b237ad495b601315bb3e8df" "site/built/modelling-interventions.md" "2024-03-22"
"episodes/compare-interventions.Rmd" "1f04f6fa8980d60273755c7faf20e70c" "site/built/compare-interventions.md" "2024-03-22"
"instructors/instructor-notes.md" "ca3834a1b0f9e70c4702aa7a367a6bb5" "site/built/instructor-notes.md" "2024-03-22"
"learners/reference.md" "3c3b0a87a98f91231d47f5a2e24ad27d" "site/built/reference.md" "2024-03-22"
"learners/setup.md" "9030a5d0d8e636cb89ee8d48e864469e" "site/built/setup.md" "2024-03-22"
"profiles/learner-profiles.md" "31b503c4b5bd1f0960ada730eca4a25e" "site/built/learner-profiles.md" "2024-03-22"
"renv/profiles/lesson-requirements/renv.lock" "dda4545bb8627af07463d0f71122ebe5" "site/built/renv.lock" "2024-03-22"
"CODE_OF_CONDUCT.md" "549f00b0992a7743c2bc16ea6ce3db57" "site/built/CODE_OF_CONDUCT.md" "2024-05-07"
"LICENSE.md" "14377518ee654005a18cf28549eb30e3" "site/built/LICENSE.md" "2024-05-07"
"config.yaml" "d11647b34aa74192704ce8944e83b0d8" "site/built/config.yaml" "2024-05-07"
"index.md" "adfca1a79e0106ee8b3f7731d0678b59" "site/built/index.md" "2024-05-07"
"links.md" "8184cf4149eafbf03ce8da8ff0778c14" "site/built/links.md" "2024-05-07"
"episodes/introduction.Rmd" "1861ec911e99b7feab3b65e0dbd91d41" "site/built/introduction.md" "2024-05-07"
"episodes/read-delays.Rmd" "2c7422e552f8e16c28449877182c0704" "site/built/read-delays.md" "2024-05-07"
"episodes/quantify-transmissibility.Rmd" "f507b32d4af315d95acc3f3f5a60c202" "site/built/quantify-transmissibility.md" "2024-05-07"
"episodes/create-forecast.Rmd" "3fdb0f4223f220d061431f18846bf1f4" "site/built/create-forecast.md" "2024-05-07"
"episodes/simulating-transmission.Rmd" "3f006aa142099aaeaa4688c064bd5d4a" "site/built/simulating-transmission.md" "2024-05-07"
"episodes/model-choices.Rmd" "775bfba024103820482bc56907d86f14" "site/built/model-choices.md" "2024-05-07"
"episodes/modelling-interventions.Rmd" "4955dd207b237ad495b601315bb3e8df" "site/built/modelling-interventions.md" "2024-05-07"
"episodes/compare-interventions.Rmd" "1f04f6fa8980d60273755c7faf20e70c" "site/built/compare-interventions.md" "2024-05-07"
"instructors/instructor-notes.md" "ca3834a1b0f9e70c4702aa7a367a6bb5" "site/built/instructor-notes.md" "2024-05-07"
"learners/reference.md" "3c3b0a87a98f91231d47f5a2e24ad27d" "site/built/reference.md" "2024-05-07"
"learners/setup.md" "9030a5d0d8e636cb89ee8d48e864469e" "site/built/setup.md" "2024-05-07"
"profiles/learner-profiles.md" "31b503c4b5bd1f0960ada730eca4a25e" "site/built/learner-profiles.md" "2024-05-07"
"renv/profiles/lesson-requirements/renv.lock" "0e26bcb2503c6f890ff69acbb37b97c1" "site/built/renv.lock" "2024-05-07"
26 changes: 24 additions & 2 deletions model-choices.md
Original file line number Diff line number Diff line change
Expand Up @@ -267,7 +267,13 @@ output <- model_ebola_r(
funeral_risk = 0.5,
time_end = 100
)
```

```error
Error in model_ebola_r(population = guinea_population, transmissibility = 1.1/12, : could not find function "model_ebola_r"
```

```r
ggplot(output[output$compartment == "infectious", ]) +
geom_line(
aes(time, value),
Expand All @@ -285,7 +291,9 @@ ggplot(output[output$compartment == "infectious", ]) +
)
```

<img src="fig/model-choices-rendered-unnamed-chunk-3-1.png" style="display: block; margin: auto;" />
```error
Error in eval(expr, envir, enclos): object 'output' not found
```

2. Run model 100 times and plot the mean, upper and lower 95% quantiles of the number of infectious individuals through time

Expand All @@ -311,9 +319,21 @@ output_samples <- Map(
output
}
)
```

```error
Error in model_ebola_r(population = guinea_population, transmissibility = 1.1/12, : could not find function "model_ebola_r"
```

```r
output_samples <- bind_rows(output_samples) # requires the dplyr package
```

```error
Error in eval(expr, envir, enclos): object 'output_samples' not found
```

```r
ggplot(
output_samples[output_samples$compartment == "infectious", ],
aes(time, value)
Expand All @@ -338,7 +358,9 @@ ggplot(
)
```

<img src="fig/model-choices-rendered-unnamed-chunk-4-1.png" style="display: block; margin: auto;" />
```error
Error in eval(expr, envir, enclos): object 'output_samples' not found
```

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

Expand Down
Loading

0 comments on commit 26294df

Please sign in to comment.