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 Apr 2, 2024
1 parent bdfeb52 commit af23d22
Show file tree
Hide file tree
Showing 25 changed files with 241 additions and 2,519 deletions.
87 changes: 0 additions & 87 deletions config.yaml

This file was deleted.

63 changes: 14 additions & 49 deletions create-forecast.md
Original file line number Diff line number Diff line change
Expand Up @@ -60,17 +60,6 @@ estimates <- epinow(
)
```

```{.output}
WARN [2024-03-22 13:04:53] epinow: There were 6 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-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 -
```


We can visualise the estimates of the effective reproduction number and the estimated number of cases using `plot()`. The estimates are split into three categories:

Expand Down Expand Up @@ -134,28 +123,17 @@ estimates <- epinow(
rt = rt_opts(prior = list(mean = rt_log_mean, sd = rt_log_sd)),
obs = obs_opts(scale = obs_scale)
)
```

```{.output}
WARN [2024-03-22 13:12:06] 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:12:06] epinow: Examine the pairs() plot to diagnose sampling problems
-
```

```r
summary(estimates)
```

```{.output}
measure estimate
<char> <char>
1: New confirmed cases by infection date 17867 (9893 -- 30108)
1: New confirmed cases by infection date 17841 (10350 -- 30311)
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.88 (0.58 -- 1.3)
4: Rate of growth -0.016 (-0.062 -- 0.033)
5: Doubling/halving time (days) -44 (21 -- -11)
```


Expand Down Expand Up @@ -249,10 +227,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 @@ -342,37 +316,28 @@ ebola_estimates <- epinow(
```

```{.output}
WARN [2024-03-22 13:13:55] epinow: There were 442 divergent transitions after warmup. See
WARN [2024-04-02 02:15:29] epinow: There were 13 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-04-02 02:15:29] 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}
measure estimate
<char> <char>
1: New confirmed cases by infection date 123 (49 -- 429)
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)
measure estimate
<char> <char>
1: New confirmed cases by infection date 101 (46 -- 249)
2: Expected change in daily cases Increasing
3: Effective reproduction no. 1.7 (1 -- 2.9)
4: Rate of growth 0.043 (0.0026 -- 0.092)
5: Doubling/halving time (days) 16 (7.6 -- 270)
```

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 -- 2.9). The exponential growth rate of case numbers is 0.043 (0.0026 -- 0.092).

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.
6 changes: 6 additions & 0 deletions introduction.md
Original file line number Diff line number Diff line change
Expand Up @@ -134,6 +134,12 @@ epinow_estimates <- epinow(
)
```

```{.output}
WARN [2024-04-02 01:07:38] 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-04-02"
"LICENSE.md" "14377518ee654005a18cf28549eb30e3" "site/built/LICENSE.md" "2024-04-02"
"config.yaml" "d11647b34aa74192704ce8944e83b0d8" "site/built/config.yaml" "2024-04-02"
"index.md" "adfca1a79e0106ee8b3f7731d0678b59" "site/built/index.md" "2024-04-02"
"links.md" "8184cf4149eafbf03ce8da8ff0778c14" "site/built/links.md" "2024-04-02"
"episodes/introduction.Rmd" "1861ec911e99b7feab3b65e0dbd91d41" "site/built/introduction.md" "2024-04-02"
"episodes/read-delays.Rmd" "2c7422e552f8e16c28449877182c0704" "site/built/read-delays.md" "2024-04-02"
"episodes/quantify-transmissibility.Rmd" "f507b32d4af315d95acc3f3f5a60c202" "site/built/quantify-transmissibility.md" "2024-04-02"
"episodes/create-forecast.Rmd" "3fdb0f4223f220d061431f18846bf1f4" "site/built/create-forecast.md" "2024-04-02"
"episodes/simulating-transmission.Rmd" "3f006aa142099aaeaa4688c064bd5d4a" "site/built/simulating-transmission.md" "2024-04-02"
"episodes/model-choices.Rmd" "775bfba024103820482bc56907d86f14" "site/built/model-choices.md" "2024-04-02"
"episodes/modelling-interventions.Rmd" "4955dd207b237ad495b601315bb3e8df" "site/built/modelling-interventions.md" "2024-04-02"
"episodes/compare-interventions.Rmd" "1f04f6fa8980d60273755c7faf20e70c" "site/built/compare-interventions.md" "2024-04-02"
"instructors/instructor-notes.md" "ca3834a1b0f9e70c4702aa7a367a6bb5" "site/built/instructor-notes.md" "2024-04-02"
"learners/reference.md" "3c3b0a87a98f91231d47f5a2e24ad27d" "site/built/reference.md" "2024-04-02"
"learners/setup.md" "9030a5d0d8e636cb89ee8d48e864469e" "site/built/setup.md" "2024-04-02"
"profiles/learner-profiles.md" "31b503c4b5bd1f0960ada730eca4a25e" "site/built/learner-profiles.md" "2024-04-02"
"renv/profiles/lesson-requirements/renv.lock" "3db23d53c5995cde3ebee4c2d02ffd3c" "site/built/renv.lock" "2024-04-02"
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 af23d22

Please sign in to comment.