diff --git a/README.md b/README.md index 0452c9784..4f39df5ec 100644 --- a/README.md +++ b/README.md @@ -183,9 +183,9 @@ case*. ``` r reporting_delay <- dist_spec( mean = convert_to_logmean(2, 1), - mean_sd = 1, + mean_sd = 0.1, sd = convert_to_logsd(2, 1), - sd_sd = 1, + sd_sd = 0.1, max = 10, dist = "lognormal" ) @@ -193,7 +193,7 @@ reporting_delay <- dist_spec( #> This warning is displayed once every 8 hours. reporting_delay #> -#> Uncertain lognormal distribution with (untruncated) logmean 0.58 (SD 1) and logSD 0.47 (SD 1) +#> Uncertain lognormal distribution with (untruncated) logmean 0.58 (SD 0.1) and logSD 0.47 (SD 0.1) ``` We use example literature estimates for the incubation period and @@ -253,10 +253,10 @@ estimates <- epinow( stan = stan_opts(cores = 4, control = list(adapt_delta = 0.99)), verbose = interactive() ) -#> WARN [2023-10-23 15:25:44] epinow: There were 94 divergent transitions after warmup. See +#> WARN [2023-10-23 15:48:57] epinow: There were 4 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 [2023-10-23 15:25:44] epinow: Examine the pairs() plot to diagnose sampling problems +#> WARN [2023-10-23 15:48:57] epinow: Examine the pairs() plot to diagnose sampling problems #> - names(estimates) #> [1] "estimates" "estimated_reported_cases" @@ -275,11 +275,11 @@ knitr::kable(summary(estimates)) | measure | estimate | |:--------------------------------------|:------------------------| -| New confirmed cases by infection date | 2280 (1133 – 4426) | +| New confirmed cases by infection date | 2252 (1149 – 4344) | | Expected change in daily cases | Likely decreasing | | Effective reproduction no. | 0.88 (0.61 – 1.2) | -| Rate of growth | -0.026 (-0.099 – 0.037) | -| Doubling/halving time (days) | -26 (19 – -7) | +| Rate of growth | -0.028 (-0.097 – 0.037) | +| Doubling/halving time (days) | -25 (19 – -7.2) | Summarised parameter estimates can also easily be returned, either filtered for a single parameter or for all parameters. @@ -287,19 +287,19 @@ 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 estimate 2.210129 2.211761 0.14910486 1.979834 -#> 2: 2020-02-23 R estimate 2.176867 2.180979 0.12396389 1.985529 -#> 3: 2020-02-24 R estimate 2.145840 2.147910 0.10346629 1.985943 -#> 4: 2020-02-25 R estimate 2.111952 2.112633 0.08746531 1.973143 -#> 5: 2020-02-26 R estimate 2.074024 2.075317 0.07560421 1.951849 -#> 6: 2020-02-27 R estimate 2.035373 2.036200 0.06731181 1.927648 +#> 1: 2020-02-22 R estimate 2.211701 2.217243 0.14597709 1.988324 +#> 2: 2020-02-23 R estimate 2.181901 2.184682 0.12107578 1.993033 +#> 3: 2020-02-24 R estimate 2.149836 2.150013 0.10092850 1.992176 +#> 4: 2020-02-25 R estimate 2.113283 2.113323 0.08533249 1.976792 +#> 5: 2020-02-26 R estimate 2.074752 2.074784 0.07390672 1.958135 +#> 6: 2020-02-27 R estimate 2.033230 2.034629 0.06602990 1.929502 #> lower_50 lower_20 upper_20 upper_50 upper_90 -#> 1: 2.108234 2.173689 2.245269 2.307258 2.460105 -#> 2: 2.096213 2.150163 2.208539 2.261730 2.390554 -#> 3: 2.076440 2.118961 2.171197 2.217385 2.321605 -#> 4: 2.050793 2.090603 2.134651 2.171913 2.259926 -#> 5: 2.023419 2.056433 2.094532 2.126930 2.203052 -#> 6: 1.993168 2.019440 2.052276 2.081485 2.148915 +#> 1: 2.117796 2.172195 2.253123 2.310431 2.467065 +#> 2: 2.104521 2.148204 2.212394 2.262825 2.392313 +#> 3: 2.082463 2.121549 2.174472 2.216943 2.316859 +#> 4: 2.054536 2.091270 2.134167 2.171521 2.254397 +#> 5: 2.023523 2.056483 2.093294 2.124909 2.194132 +#> 6: 1.988627 2.017829 2.051124 2.079665 2.140766 ``` Reported cases are returned in a separate data frame in order to @@ -308,19 +308,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 66 68.0235 18.59435 41.00 55 62 -#> 2: 2020-02-23 gp_rt 77 78.7080 21.53129 48.00 63 71 -#> 3: 2020-02-24 gp_rt 75 77.2745 21.88597 45.95 62 70 -#> 4: 2020-02-25 gp_rt 73 74.6660 20.14501 44.00 60 69 -#> 5: 2020-02-26 gp_rt 78 79.7365 20.88835 49.00 65 73 -#> 6: 2020-02-27 gp_rt 111 113.8450 30.85604 71.00 93 103 +#> 1: 2020-02-22 gp_rt 66 68.5465 19.07920 41 55 62 +#> 2: 2020-02-23 gp_rt 77 79.5490 21.35089 48 64 72 +#> 3: 2020-02-24 gp_rt 76 78.2090 21.52515 46 64 71 +#> 4: 2020-02-25 gp_rt 73 75.6065 21.16763 45 61 68 +#> 5: 2020-02-26 gp_rt 78 79.9800 21.56129 48 65 73 +#> 6: 2020-02-27 gp_rt 110 112.3640 29.46587 68 92 103 #> upper_20 upper_50 upper_90 -#> 1: 70.0 80 101.00 -#> 2: 82.0 92 117.00 -#> 3: 80.0 89 118.00 -#> 4: 78.4 87 110.00 -#> 5: 83.0 93 116.00 -#> 6: 117.0 130 168.05 +#> 1: 71 80 104 +#> 2: 84 92 117 +#> 3: 81 91 118 +#> 4: 79 89 113 +#> 5: 83 93 119 +#> 6: 117 130 165 ``` A range of plots are returned (with the single summary plot shown @@ -369,19 +369,19 @@ estimates <- regional_epinow( gp = NULL, stan = stan_opts(cores = 4, warmup = 250, samples = 1000) ) -#> INFO [2023-10-23 15:25:50] Producing following optional outputs: regions, summary, samples, plots, latest -#> INFO [2023-10-23 15:25:50] Reporting estimates using data up to: 2020-04-21 -#> INFO [2023-10-23 15:25:50] No target directory specified so returning output -#> INFO [2023-10-23 15:25:50] Producing estimates for: testland, realland -#> INFO [2023-10-23 15:25:50] Regions excluded: none -#> INFO [2023-10-23 15:26:26] Completed estimates for: testland -#> INFO [2023-10-23 15:27:04] Completed estimates for: realland -#> INFO [2023-10-23 15:27:04] Completed regional estimates -#> INFO [2023-10-23 15:27:04] Regions with estimates: 2 -#> INFO [2023-10-23 15:27:04] Regions with runtime errors: 0 -#> INFO [2023-10-23 15:27:04] Producing summary -#> INFO [2023-10-23 15:27:04] No summary directory specified so returning summary output -#> INFO [2023-10-23 15:27:04] No target directory specified so returning timings +#> INFO [2023-10-23 15:49:03] Producing following optional outputs: regions, summary, samples, plots, latest +#> INFO [2023-10-23 15:49:03] Reporting estimates using data up to: 2020-04-21 +#> INFO [2023-10-23 15:49:03] No target directory specified so returning output +#> INFO [2023-10-23 15:49:03] Producing estimates for: testland, realland +#> INFO [2023-10-23 15:49:03] Regions excluded: none +#> INFO [2023-10-23 15:49:40] Completed estimates for: testland +#> INFO [2023-10-23 15:50:15] Completed estimates for: realland +#> INFO [2023-10-23 15:50:15] Completed regional estimates +#> INFO [2023-10-23 15:50:15] Regions with estimates: 2 +#> INFO [2023-10-23 15:50:15] Regions with runtime errors: 0 +#> INFO [2023-10-23 15:50:15] Producing summary +#> INFO [2023-10-23 15:50:15] No summary directory specified so returning summary output +#> INFO [2023-10-23 15:50:15] No target directory specified so returning timings ``` Results from each region are stored in a `regional` list with across @@ -406,8 +406,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 | 2195 (1148 – 4208) | Likely decreasing | 0.86 (0.62 – 1.2) | -0.031 (-0.096 – 0.035) | -22 (20 – -7.2) | -| testland | 2203 (1122 – 4194) | Likely decreasing | 0.86 (0.62 – 1.2) | -0.031 (-0.096 – 0.033) | -22 (21 – -7.2) | +| realland | 2070 (1106 – 4154) | Likely decreasing | 0.85 (0.62 – 1.2) | -0.033 (-0.095 – 0.033) | -21 (21 – -7.3) | +| testland | 2153 (1124 – 4194) | Likely decreasing | 0.86 (0.62 – 1.2) | -0.032 (-0.094 – 0.035) | -22 (20 – -7.4) | A range of plots are again returned (with the single summary plot shown below). diff --git a/man/figures/unnamed-chunk-15-1.png b/man/figures/unnamed-chunk-15-1.png index e59642051..edfe55085 100644 Binary files a/man/figures/unnamed-chunk-15-1.png and b/man/figures/unnamed-chunk-15-1.png differ diff --git a/man/figures/unnamed-chunk-19-1.png b/man/figures/unnamed-chunk-19-1.png index a18a63ca1..7b650c547 100644 Binary files a/man/figures/unnamed-chunk-19-1.png and b/man/figures/unnamed-chunk-19-1.png differ