Skip to content

Commit

Permalink
Automatic readme update
Browse files Browse the repository at this point in the history
  • Loading branch information
actions-user authored and sbfnk committed Oct 11, 2023
1 parent 70dd5f8 commit 08eee77
Show file tree
Hide file tree
Showing 3 changed files with 51 additions and 52 deletions.
103 changes: 51 additions & 52 deletions README.md
Expand Up @@ -170,7 +170,7 @@ as follows (note this is a synthetic example),
``` r
reporting_delay <- estimate_delay(
rlnorm(1000, log(2), 1),
max_value = 15, bootstraps = 1
max_value = 14, bootstraps = 1
)
```

Expand All @@ -184,6 +184,8 @@ reporting_delay <- dist_spec(
mean = convert_to_logmean(2, 1), sd = convert_to_logsd(2, 1), max = 10,
dist = "lognormal"
)
#> Warning: The meaning of the 'max' argument has changed compared to previous versions. It now indicates the maximum of a distribution rather than the length of the probability mass function (including 0) that it represented previously. To replicate previous behaviour reduce max by 1.
#> This warning is displayed once every 8 hours.
```

Here we define the incubation period and generation time based on
Expand Down Expand Up @@ -243,9 +245,6 @@ estimates <- epinow(
stan = stan_opts(cores = 4, control = list(adapt_delta = 0.99)),
verbose = interactive()
)
#> WARN [2023-09-27 14:28:15] 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 -
names(estimates)
#> [1] "estimates" "estimated_reported_cases"
#> [3] "summary" "plots"
Expand All @@ -261,33 +260,33 @@ parameters at the latest date partially supported by data.
knitr::kable(summary(estimates))
```

| measure | estimate |
|:--------------------------------------|:-----------------------|
| New confirmed cases by infection date | 2279 (11184301) |
| Expected change in daily cases | Likely decreasing |
| Effective reproduction no. | 0.89 (0.62 – 1.2) |
| Rate of growth | -0.027 (-0.11 – 0.038) |
| Doubling/halving time (days) | -25 (18 – -6.6) |
| measure | estimate |
|:--------------------------------------|:----------------------|
| New confirmed cases by infection date | 2297 (11344496) |
| Expected change in daily cases | Likely decreasing |
| Effective reproduction no. | 0.89 (0.62 – 1.2) |
| Rate of growth | -0.027 (-0.1 – 0.039) |
| Doubling/halving time (days) | -26 (18 – -6.8) |

Summarised parameter estimates can also easily be returned, either
filtered for a single parameter or for all parameters.

``` r
head(summary(estimates, type = "parameters", params = "R"))
#> date variable strat type median mean sd lower_90
#> 1: 2020-02-22 R NA estimate 2.132829 2.137525 0.13485496 1.922173
#> 2: 2020-02-23 R NA estimate 2.098537 2.101913 0.11121883 1.924287
#> 3: 2020-02-24 R NA estimate 2.064197 2.064871 0.09229141 1.917506
#> 4: 2020-02-25 R NA estimate 2.025665 2.026552 0.07781861 1.900920
#> 5: 2020-02-26 R NA estimate 1.985770 1.987160 0.06736735 1.878103
#> 6: 2020-02-27 R NA estimate 1.946217 1.946932 0.06027737 1.849663
#> 1: 2020-02-22 R NA estimate 2.155254 2.161351 0.14517723 1.937754
#> 2: 2020-02-23 R NA estimate 2.121975 2.127980 0.12100600 1.935764
#> 3: 2020-02-24 R NA estimate 2.088968 2.092729 0.10097692 1.928174
#> 4: 2020-02-25 R NA estimate 2.054719 2.055714 0.08483110 1.920837
#> 5: 2020-02-26 R NA estimate 2.016873 2.017134 0.07230558 1.901956
#> 6: 2020-02-27 R NA estimate 1.977156 1.977250 0.06313689 1.875373
#> lower_50 lower_20 upper_20 upper_50 upper_90
#> 1: 2.046920 2.098708 2.166627 2.223948 2.366795
#> 2: 2.027190 2.071652 2.128400 2.174681 2.290964
#> 3: 2.002659 2.040515 2.087058 2.127006 2.220110
#> 4: 1.974456 2.007299 2.044107 2.077997 2.158944
#> 5: 1.942225 1.969654 2.002432 2.030157 2.099359
#> 6: 1.907058 1.930582 1.961116 1.985619 2.045692
#> 1: 2.065064 2.121331 2.191464 2.249999 2.402681
#> 2: 2.046891 2.096318 2.154105 2.204012 2.331598
#> 3: 2.024262 2.065044 2.116088 2.157788 2.260738
#> 4: 1.997118 2.033391 2.076033 2.111222 2.193523
#> 5: 1.967295 1.998732 2.035722 2.064998 2.133431
#> 6: 1.932713 1.961310 1.993938 2.019524 2.079810
```

Reported cases are returned in a separate data frame in order to
Expand All @@ -296,19 +295,19 @@ streamline the reporting of forecasts and for model evaluation.
``` r
head(summary(estimates, output = "estimated_reported_cases"))
#> date type median mean sd lower_90 lower_50 lower_20
#> 1: 2020-02-22 gp_rt 61 62.9225 16.90344 39.00 51 57.0
#> 2: 2020-02-23 gp_rt 76 77.0560 20.88159 46.00 62 70.6
#> 3: 2020-02-24 gp_rt 77 79.0875 21.69463 48.95 64 72.0
#> 4: 2020-02-25 gp_rt 75 76.1825 20.03599 46.00 62 70.0
#> 5: 2020-02-26 gp_rt 79 81.1295 22.38634 49.00 65 74.0
#> 6: 2020-02-27 gp_rt 113 115.4200 28.91020 71.00 95 106.0
#> 1: 2020-02-22 gp_rt 64 65.9345 18.66876 40.00 53 60
#> 2: 2020-02-23 gp_rt 77 79.2645 21.46606 48.00 64 72
#> 3: 2020-02-24 gp_rt 76 78.7490 21.98367 48.00 64 71
#> 4: 2020-02-25 gp_rt 74 76.7340 21.21429 45.95 62 69
#> 5: 2020-02-26 gp_rt 79 81.5060 22.30854 50.00 65 74
#> 6: 2020-02-27 gp_rt 113 115.6395 30.70588 70.00 94 105
#> upper_20 upper_50 upper_90
#> 1: 66 73 94.00
#> 2: 81 90 113.00
#> 3: 83 92 118.05
#> 4: 80 89 111.05
#> 5: 85 94 121.00
#> 6: 121 134 167.00
#> 1: 68 76 100.00
#> 2: 83 92 117.05
#> 3: 82 91 120.00
#> 4: 80 89 115.00
#> 5: 85 95 120.00
#> 6: 120 134 171.00
```

A range of plots are returned (with the single summary plot shown
Expand Down Expand Up @@ -357,19 +356,19 @@ estimates <- regional_epinow(
gp = NULL,
stan = stan_opts(cores = 4, warmup = 250, samples = 1000)
)
#> INFO [2023-09-27 14:28:21] Producing following optional outputs: regions, summary, samples, plots, latest
#> INFO [2023-09-27 14:28:21] Reporting estimates using data up to: 2020-04-21
#> INFO [2023-09-27 14:28:21] No target directory specified so returning output
#> INFO [2023-09-27 14:28:21] Producing estimates for: testland, realland
#> INFO [2023-09-27 14:28:21] Regions excluded: none
#> INFO [2023-09-27 14:28:54] Completed estimates for: testland
#> INFO [2023-09-27 14:29:24] Completed estimates for: realland
#> INFO [2023-09-27 14:29:24] Completed regional estimates
#> INFO [2023-09-27 14:29:24] Regions with estimates: 2
#> INFO [2023-09-27 14:29:24] Regions with runtime errors: 0
#> INFO [2023-09-27 14:29:24] Producing summary
#> INFO [2023-09-27 14:29:24] No summary directory specified so returning summary output
#> INFO [2023-09-27 14:29:25] No target directory specified so returning timings
#> INFO [2023-10-11 14:51:31] Producing following optional outputs: regions, summary, samples, plots, latest
#> INFO [2023-10-11 14:51:31] Reporting estimates using data up to: 2020-04-21
#> INFO [2023-10-11 14:51:31] No target directory specified so returning output
#> INFO [2023-10-11 14:51:31] Producing estimates for: testland, realland
#> INFO [2023-10-11 14:51:31] Regions excluded: none
#> INFO [2023-10-11 14:51:54] Completed estimates for: testland
#> INFO [2023-10-11 14:52:19] Completed estimates for: realland
#> INFO [2023-10-11 14:52:19] Completed regional estimates
#> INFO [2023-10-11 14:52:19] Regions with estimates: 2
#> INFO [2023-10-11 14:52:19] Regions with runtime errors: 0
#> INFO [2023-10-11 14:52:19] Producing summary
#> INFO [2023-10-11 14:52:19] No summary directory specified so returning summary output
#> INFO [2023-10-11 14:52:19] No target directory specified so returning timings
```

Results from each region are stored in a `regional` list with across
Expand All @@ -392,10 +391,10 @@ output.
knitr::kable(estimates$summary$summarised_results$table)
```

| Region | New confirmed cases by infection date | Expected change in daily cases | Effective reproduction no. | Rate of growth | Doubling/halving time (days) |
|:---------|:--------------------------------------|:-------------------------------|:---------------------------|:------------------------|:-----------------------------|
| realland | 2150 (11094062) | Likely decreasing | 0.86 (0.64 – 1.1) | -0.033 (-0.098 – 0.029) | -21 (24 – -7.1) |
| testland | 2149 (11824040) | Likely decreasing | 0.87 (0.66 – 1.2) | -0.031 (-0.093 – 0.035) | -22 (20 – -7.4) |
| Region | New confirmed cases by infection date | Expected change in daily cases | Effective reproduction no. | Rate of growth | Doubling/halving time (days) |
|:---------|:--------------------------------------|:-------------------------------|:---------------------------|:-----------------------|:-----------------------------|
| realland | 2199 (11184254) | Likely decreasing | 0.87 (0.63 – 1.2) | -0.03 (-0.098 – 0.038) | -23 (18 – -7.1) |
| testland | 2132 (10794492) | Likely decreasing | 0.86 (0.61 – 1.2) | -0.032 (-0.1 – 0.038) | -21 (18 – -6.6) |

A range of plots are again returned (with the single summary plot shown
below).
Expand Down
Binary file modified man/figures/unnamed-chunk-15-1.png
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified man/figures/unnamed-chunk-19-1.png
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.

0 comments on commit 08eee77

Please sign in to comment.