Skip to content

Commit

Permalink
update / recompile vignettes
Browse files Browse the repository at this point in the history
  • Loading branch information
sbfnk committed Nov 27, 2023
1 parent acf4770 commit 7673d3a
Show file tree
Hide file tree
Showing 17 changed files with 210 additions and 190 deletions.
99 changes: 48 additions & 51 deletions vignettes/epinow.Rmd
Original file line number Diff line number Diff line change
Expand Up @@ -30,10 +30,7 @@ This should be replaced with parameters relevant to the system that is being stu
library("EpiNow2")
options(mc.cores = 4)
reported_cases <- example_confirmed[1:60]
reporting_delay <- dist_spec(
mean = convert_to_logmean(2, 1), mean_sd = 0,
sd = convert_to_logsd(2, 1), sd_sd = 0, max = 10
)
reporting_delay <- lognormal(mean = 2, sd = 1, max = 10)
delay <- example_incubation_period + reporting_delay
rt_prior <- list(mean = 2, sd = 0.1)
```
Expand All @@ -49,13 +46,13 @@ res <- epinow(reported_cases,
target_folder = "results"
)
#> Logging threshold set at INFO for the EpiNow2 logger
#> Writing EpiNow2 logs to the console and: /tmp/RtmprzMMcb/regional-epinow/2020-04-21.log
#> Writing EpiNow2 logs to the console and: /tmp/RtmpyrNOVB/regional-epinow/2020-04-21.log
#> Logging threshold set at INFO for the EpiNow2.epinow logger
#> Writing EpiNow2.epinow logs to the console and: /tmp/RtmprzMMcb/epinow/2020-04-21.log
#> WARN [2023-10-21 09:32:12] epinow: There were 17 divergent transitions after warmup. See
#> Writing EpiNow2.epinow logs to the console and: /tmp/RtmpyrNOVB/epinow/2020-04-21.log
#> WARN [2023-11-26 21:54:03] 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 [2023-10-21 09:32:12] epinow: Examine the pairs() plot to diagnose sampling problems
#> WARN [2023-11-26 21:54:03] epinow: Examine the pairs() plot to diagnose sampling problems
#> -
res$plots$R
#> NULL
Expand Down Expand Up @@ -89,41 +86,41 @@ region_rt <- regional_epinow(
delays = delay_opts(delay),
rt = rt_opts(prior = rt_prior),
)
#> INFO [2023-10-21 09:32:19] Producing following optional outputs: regions, summary, samples, plots, latest
#> INFO [2023-11-26 21:54:10] Producing following optional outputs: regions, summary, samples, plots, latest
#> Logging threshold set at INFO for the EpiNow2 logger
#> Writing EpiNow2 logs to the console and: /tmp/RtmprzMMcb/regional-epinow/2020-04-21.log
#> Writing EpiNow2 logs to the console and: /tmp/RtmpyrNOVB/regional-epinow/2020-04-21.log
#> Logging threshold set at INFO for the EpiNow2.epinow logger
#> Writing EpiNow2.epinow logs to: /tmp/RtmprzMMcb/epinow/2020-04-21.log
#> INFO [2023-10-21 09:32:19] Reporting estimates using data up to: 2020-04-21
#> INFO [2023-10-21 09:32:19] No target directory specified so returning output
#> INFO [2023-10-21 09:32:19] Producing estimates for: testland, realland
#> INFO [2023-10-21 09:32:19] Regions excluded: none
#> INFO [2023-10-21 09:33:56] Completed estimates for: testland
#> INFO [2023-10-21 09:35:26] Completed estimates for: realland
#> INFO [2023-10-21 09:35:26] Completed regional estimates
#> INFO [2023-10-21 09:35:26] Regions with estimates: 2
#> INFO [2023-10-21 09:35:26] Regions with runtime errors: 0
#> INFO [2023-10-21 09:35:26] Producing summary
#> INFO [2023-10-21 09:35:26] No summary directory specified so returning summary output
#> INFO [2023-10-21 09:35:26] No target directory specified so returning timings
#> Writing EpiNow2.epinow logs to: /tmp/RtmpyrNOVB/epinow/2020-04-21.log
#> INFO [2023-11-26 21:54:10] Reporting estimates using data up to: 2020-04-21
#> INFO [2023-11-26 21:54:10] No target directory specified so returning output
#> INFO [2023-11-26 21:54:10] Producing estimates for: testland, realland
#> INFO [2023-11-26 21:54:10] Regions excluded: none
#> INFO [2023-11-26 21:59:54] Completed estimates for: testland
#> INFO [2023-11-26 22:33:35] Completed estimates for: realland
#> INFO [2023-11-26 22:33:35] Completed regional estimates
#> INFO [2023-11-26 22:33:35] Regions with estimates: 2
#> INFO [2023-11-26 22:33:35] Regions with runtime errors: 0
#> INFO [2023-11-26 22:33:35] Producing summary
#> INFO [2023-11-26 22:33:35] No summary directory specified so returning summary output
#> INFO [2023-11-26 22:33:36] No target directory specified so returning timings
## summary
region_rt$summary$summarised_results$table
#> Region New confirmed cases by infection date
#> 1: realland 2119 (876 -- 4309)
#> 2: testland 2082 (823 -- 4219)
#> 1: realland 2512 (968 -- 18904)
#> 2: testland 2027 (817 -- 4043)
#> Expected change in daily cases Effective reproduction no.
#> 1: Likely decreasing 0.89 (0.61 -- 1.2)
#> 2: Likely decreasing 0.88 (0.6 -- 1.2)
#> 1: Stable 0.95 (0.63 -- 1.5)
#> 2: Likely decreasing 0.87 (0.6 -- 1.1)
#> Rate of growth Doubling/halving time (days)
#> 1: -0.033 (-0.14 -- 0.041) -21 (17 -- -5.1)
#> 2: -0.035 (-0.14 -- 0.04) -20 (17 -- -5)
#> 1: -0.016 (-0.12 -- 0.042) -44 (17 -- -5.6)
#> 2: -0.038 (-0.14 -- 0.036) -18 (19 -- -4.9)
## plot
region_rt$summary$plots$R
```

![plot of chunk regional_epinow](figure/regional_epinow-1.png)

If instead, we wanted to use the Gaussian Process for `testland` and a weekly random walk for `realland` we could specify these separately using the `opts_list()` from the package and `modifyList()` from `R`.
If instead, we wanted to use the Gaussian Process for `testland` and a weekly random walk for `realland` we could specify these separately using the `opts_list()` function from the package and `modifyList()` from `R`.


```r
Expand All @@ -136,34 +133,34 @@ region_separate_rt <- regional_epinow(
delays = delay_opts(delay),
rt = rt, gp = gp,
)
#> INFO [2023-10-21 09:35:27] Producing following optional outputs: regions, summary, samples, plots, latest
#> INFO [2023-11-26 22:33:36] Producing following optional outputs: regions, summary, samples, plots, latest
#> Logging threshold set at INFO for the EpiNow2 logger
#> Writing EpiNow2 logs to the console and: /tmp/RtmprzMMcb/regional-epinow/2020-04-21.log
#> Writing EpiNow2 logs to the console and: /tmp/RtmpyrNOVB/regional-epinow/2020-04-21.log
#> Logging threshold set at INFO for the EpiNow2.epinow logger
#> Writing EpiNow2.epinow logs to: /tmp/RtmprzMMcb/epinow/2020-04-21.log
#> INFO [2023-10-21 09:35:27] Reporting estimates using data up to: 2020-04-21
#> INFO [2023-10-21 09:35:27] No target directory specified so returning output
#> INFO [2023-10-21 09:35:27] Producing estimates for: testland, realland
#> INFO [2023-10-21 09:35:27] Regions excluded: none
#> INFO [2023-10-21 09:37:00] Completed estimates for: testland
#> INFO [2023-10-21 09:37:36] Completed estimates for: realland
#> INFO [2023-10-21 09:37:36] Completed regional estimates
#> INFO [2023-10-21 09:37:36] Regions with estimates: 2
#> INFO [2023-10-21 09:37:36] Regions with runtime errors: 0
#> INFO [2023-10-21 09:37:36] Producing summary
#> INFO [2023-10-21 09:37:36] No summary directory specified so returning summary output
#> INFO [2023-10-21 09:37:36] No target directory specified so returning timings
#> Writing EpiNow2.epinow logs to: /tmp/RtmpyrNOVB/epinow/2020-04-21.log
#> INFO [2023-11-26 22:33:36] Reporting estimates using data up to: 2020-04-21
#> INFO [2023-11-26 22:33:36] No target directory specified so returning output
#> INFO [2023-11-26 22:33:36] Producing estimates for: testland, realland
#> INFO [2023-11-26 22:33:36] Regions excluded: none
#> INFO [2023-11-26 22:39:48] Completed estimates for: testland
#> INFO [2023-11-26 22:40:44] Completed estimates for: realland
#> INFO [2023-11-26 22:40:44] Completed regional estimates
#> INFO [2023-11-26 22:40:44] Regions with estimates: 2
#> INFO [2023-11-26 22:40:44] Regions with runtime errors: 0
#> INFO [2023-11-26 22:40:44] Producing summary
#> INFO [2023-11-26 22:40:44] No summary directory specified so returning summary output
#> INFO [2023-11-26 22:40:45] No target directory specified so returning timings
## summary
region_separate_rt$summary$summarised_results$table
#> Region New confirmed cases by infection date
#> 1: realland 2013 (953 -- 4182)
#> 2: testland 2052 (855 -- 4277)
#> 1: realland 2027 (1002 -- 3958)
#> 2: testland 2100 (841 -- 4030)
#> Expected change in daily cases Effective reproduction no.
#> 1: Likely decreasing 0.88 (0.66 -- 1.2)
#> 2: Likely decreasing 0.88 (0.6 -- 1.2)
#> 1: Likely decreasing 0.89 (0.67 -- 1.1)
#> 2: Likely decreasing 0.88 (0.59 -- 1.1)
#> Rate of growth Doubling/halving time (days)
#> 1: -0.035 (-0.12 -- 0.04) -20 (17 -- -6)
#> 2: -0.036 (-0.14 -- 0.045) -19 (16 -- -5)
#> 1: -0.035 (-0.11 -- 0.035) -20 (20 -- -6.4)
#> 2: -0.034 (-0.14 -- 0.037) -20 (19 -- -4.9)
## plot
region_separate_rt$summary$plots$R
```
Expand Down
Loading

0 comments on commit 7673d3a

Please sign in to comment.