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 Sep 26, 2023
1 parent 3ca9245 commit 912cdd5
Show file tree
Hide file tree
Showing 3 changed files with 74 additions and 42 deletions.
116 changes: 74 additions & 42 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -243,6 +243,16 @@ estimates <- epinow(
stan = stan_opts(cores = 4, adapt_delta = 0.99),
verbose = interactive()
)
#> Running MCMC with 4 parallel chains...
#>
#> Chain 3 finished in 121.6 seconds.
#> Chain 1 finished in 123.2 seconds.
#> Chain 2 finished in 126.0 seconds.
#> Chain 4 finished in 158.8 seconds.
#>
#> All 4 chains finished successfully.
#> Mean chain execution time: 132.4 seconds.
#> Total execution time: 159.1 seconds.
names(estimates)
#> [1] "estimates" "estimated_reported_cases"
#> [3] "summary" "plots"
Expand All @@ -260,31 +270,31 @@ knitr::kable(summary(estimates))

| measure | estimate |
|:--------------------------------------|:----------------------|
| New confirmed cases by infection date | 2313 (11594345) |
| New confirmed cases by infection date | 2257 (11154343) |
| Expected change in daily cases | Likely decreasing |
| Effective reproduction no. | 0.89 (0.62 – 1.2) |
| Rate of growth | -0.026 (-0.1 – 0.038) |
| Doubling/halving time (days) | -26 (18 – -6.7) |
| Rate of growth | -0.027 (-0.1 – 0.037) |
| Doubling/halving time (days) | -26 (19 – -6.7) |

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.140044 2.142893 0.13818099 1.937615
#> 2: 2020-02-23 R NA estimate 2.105628 2.106892 0.11415164 1.936612
#> 3: 2020-02-24 R NA estimate 2.068985 2.069442 0.09420757 1.921287
#> 4: 2020-02-25 R NA estimate 2.031434 2.030725 0.07830576 1.907767
#> 5: 2020-02-26 R NA estimate 1.991226 1.990969 0.06634858 1.884688
#> 6: 2020-02-27 R NA estimate 1.950962 1.950427 0.05807390 1.856440
#> 1: 2020-02-22 R NA estimate 2.144065 2.150311 0.14200369 1.926628
#> 2: 2020-02-23 R NA estimate 2.110835 2.114022 0.11862463 1.925737
#> 3: 2020-02-24 R NA estimate 2.073500 2.076118 0.09925902 1.916715
#> 4: 2020-02-25 R NA estimate 2.035335 2.036801 0.08358997 1.902666
#> 5: 2020-02-26 R NA estimate 1.995900 1.996326 0.07134497 1.879814
#> 6: 2020-02-27 R NA estimate 1.954405 1.954974 0.06227336 1.854877
#> lower_50 lower_20 upper_20 upper_50 upper_90
#> 1: 2.046299 2.104219 2.174057 2.232616 2.370781
#> 2: 2.025782 2.075403 2.132810 2.182697 2.294095
#> 3: 2.003747 2.044222 2.090967 2.131610 2.225019
#> 4: 1.977390 2.010528 2.048636 2.082264 2.163819
#> 5: 1.944677 1.974170 2.008207 2.035011 2.103163
#> 6: 1.910567 1.935790 1.965265 1.988672 2.046538
#> 1: 2.053705 2.109524 2.181408 2.242055 2.387933
#> 2: 2.034240 2.081736 2.140902 2.190930 2.309637
#> 3: 2.011347 2.051200 2.101260 2.141868 2.239970
#> 4: 1.981015 2.017212 2.057854 2.091475 2.173812
#> 5: 1.948853 1.979834 2.013624 2.042758 2.112442
#> 6: 1.914860 1.939740 1.970580 1.996107 2.058693
```

Reported cases are returned in a separate data frame in order to
Expand All @@ -293,19 +303,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 65.5 67.2870 18.83096 40 54 61
#> 2: 2020-02-23 gp_rt 78.0 78.8395 21.73755 47 63 72
#> 3: 2020-02-24 gp_rt 77.0 78.8920 21.59142 47 64 72
#> 4: 2020-02-25 gp_rt 73.0 75.0705 20.82804 45 61 68
#> 5: 2020-02-26 gp_rt 78.0 79.8325 22.03166 47 65 73
#> 6: 2020-02-27 gp_rt 110.0 112.9160 28.92359 71 92 103
#> 1: 2020-02-22 gp_rt 65.5 67.5025 18.65130 40 55 61.0
#> 2: 2020-02-23 gp_rt 77.0 79.1075 21.69441 49 64 71.6
#> 3: 2020-02-24 gp_rt 78.0 79.7185 22.19003 47 64 73.0
#> 4: 2020-02-25 gp_rt 75.0 76.6580 20.87558 46 62 70.0
#> 5: 2020-02-26 gp_rt 79.0 81.2695 22.79736 48 65 74.0
#> 6: 2020-02-27 gp_rt 111.0 114.0765 30.10736 70 94 104.0
#> upper_20 upper_50 upper_90
#> 1: 70 79.00 101
#> 2: 83 92.00 117
#> 3: 82 92.00 116
#> 4: 78 87.00 115
#> 5: 83 91.25 120
#> 6: 118 130.00 165
#> 1: 70 79 101.00
#> 2: 82 92 119.00
#> 3: 84 94 119.00
#> 4: 80 89 114.00
#> 5: 85 95 122.05
#> 6: 118 131 167.00
```

A range of plots are returned (with the single summary plot shown
Expand Down Expand Up @@ -354,19 +364,41 @@ estimates <- regional_epinow(
gp = NULL,
stan = stan_opts(cores = 4, warmup = 250, samples = 1000)
)
#> INFO [2023-06-09 13:52:11] Producing following optional outputs: regions, summary, samples, plots, latest
#> INFO [2023-06-09 13:52:11] Reporting estimates using data up to: 2020-04-21
#> INFO [2023-06-09 13:52:11] No target directory specified so returning output
#> INFO [2023-06-09 13:52:11] Producing estimates for: testland, realland
#> INFO [2023-06-09 13:52:11] Regions excluded: none
#> INFO [2023-06-09 13:52:40] Completed estimates for: testland
#> INFO [2023-06-09 13:53:07] Completed estimates for: realland
#> INFO [2023-06-09 13:53:07] Completed regional estimates
#> INFO [2023-06-09 13:53:07] Regions with estimates: 2
#> INFO [2023-06-09 13:53:07] Regions with runtime errors: 0
#> INFO [2023-06-09 13:53:07] Producing summary
#> INFO [2023-06-09 13:53:07] No summary directory specified so returning summary output
#> INFO [2023-06-09 13:53:08] No target directory specified so returning timings
#> INFO [2023-06-28 11:53:52] Producing following optional outputs: regions, summary, samples, plots, latest
#> INFO [2023-06-28 11:53:52] Reporting estimates using data up to: 2020-04-21
#> INFO [2023-06-28 11:53:52] No target directory specified so returning output
#> INFO [2023-06-28 11:53:52] Producing estimates for: testland, realland
#> INFO [2023-06-28 11:53:52] Regions excluded: none
#> Running MCMC with 4 parallel chains...
#>
#> Chain 4 finished in 13.1 seconds.
#> Chain 1 finished in 13.3 seconds.
#> Chain 2 finished in 15.6 seconds.
#> Chain 3 finished in 16.3 seconds.
#>
#> All 4 chains finished successfully.
#> Mean chain execution time: 14.6 seconds.
#> Total execution time: 16.5 seconds.
#>
#> INFO [2023-06-28 11:54:11] Completed estimates for: testland
#> Running MCMC with 4 parallel chains...
#>
#> Chain 1 finished in 14.7 seconds.
#> Chain 4 finished in 14.6 seconds.
#> Chain 2 finished in 14.8 seconds.
#> Chain 3 finished in 15.1 seconds.
#>
#> All 4 chains finished successfully.
#> Mean chain execution time: 14.8 seconds.
#> Total execution time: 15.3 seconds.
#>
#> INFO [2023-06-28 11:54:28] Completed estimates for: realland
#> INFO [2023-06-28 11:54:28] Completed regional estimates
#> INFO [2023-06-28 11:54:28] Regions with estimates: 2
#> INFO [2023-06-28 11:54:28] Regions with runtime errors: 0
#> INFO [2023-06-28 11:54:28] Producing summary
#> INFO [2023-06-28 11:54:28] No summary directory specified so returning summary output
#> INFO [2023-06-28 11:54:29] No target directory specified so returning timings
```

Results from each region are stored in a `regional` list with across
Expand All @@ -391,8 +423,8 @@ 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 | 2176 (11924065) | Likely decreasing | 0.87 (0.65 – 1.1) | -0.032 (-0.096 – 0.03) | -22 (23 – -7.2) |
| testland | 2217 (11504155) | Likely decreasing | 0.87 (0.64 – 1.2) | -0.031 (-0.099 – 0.036) | -23 (19 – -7) |
| realland | 2187 (11594112) | Likely decreasing | 0.87 (0.65 – 1.1) | -0.033 (-0.095 – 0.033) | -21 (21 – -7.3) |
| testland | 2153 (12104146) | Likely decreasing | 0.86 (0.66 – 1.1) | -0.034 (-0.093 – 0.032) | -21 (22 – -7.4) |

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
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 man/figures/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.

0 comments on commit 912cdd5

Please sign in to comment.