Skip to content

Commit

Permalink
update touchstone
Browse files Browse the repository at this point in the history
  • Loading branch information
sbfnk committed Oct 22, 2023
1 parent 56473c5 commit c52c381
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 23 deletions.
18 changes: 9 additions & 9 deletions touchstone/script.R
Original file line number Diff line number Diff line change
Expand Up @@ -9,8 +9,8 @@ touchstone::benchmark_run(
expr_before_benchmark = { source("touchstone/setup.R") },
default = { epinow(
reported_cases = reported_cases,
generation_time = generation_time,
delays = delays,
generation_time = fixed_generation_time,
delays = fixed_delays,
rt = rt_opts(prior = list(mean = 2, sd = 0.2)),
stan = stan_opts(
cores = 2, samples = 500, chains = 2,
Expand All @@ -25,8 +25,8 @@ touchstone::benchmark_run(
expr_before_benchmark = { source("touchstone/setup.R") },
uncertain = { epinow(
reported_cases = reported_cases,
generation_time = u_generation_time,
delays = u_delays,
generation_time = example_generation_time,
delays = delays,
rt = rt_opts(prior = list(mean = 2, sd = 0.2)),
stan = stan_opts(
cores = 2, samples = 500, chains = 2,
Expand All @@ -41,7 +41,7 @@ touchstone::benchmark_run(
expr_before_benchmark = { source("touchstone/setup.R") },
no_delays = { epinow(
reported_cases = reported_cases,
generation_time = generation_time,
generation_time = fixed_generation_time,
rt = rt_opts(prior = list(mean = 2, sd = 0.2)),
stan = stan_opts(
cores = 2, samples = 500, chains = 2,
Expand All @@ -56,8 +56,8 @@ touchstone::benchmark_run(
expr_before_benchmark = { source("touchstone/setup.R") },
stationary = { epinow(
reported_cases = reported_cases,
generation_time = generation_time,
delays = delays,
generation_time = fixed_generation_time,
delays = fixed_delays,
rt = rt_opts(prior = list(mean = 2, sd = 0.2), gp_on = "R0"),
stan = stan_opts(
cores = 2, samples = 500, chains = 2,
Expand All @@ -72,8 +72,8 @@ touchstone::benchmark_run(
expr_before_benchmark = { source("touchstone/setup.R") },
random_walk = { epinow(
reported_cases = reported_cases,
generation_time = generation_time,
delays = delays,
generation_time = fixed_generation_time,
delays = fixed_delays,
rt = rt_opts(prior = list(mean = 2, sd = 0.2), rw = 7),
gp = NULL,
stan = stan_opts(
Expand Down
19 changes: 5 additions & 14 deletions touchstone/setup.R
Original file line number Diff line number Diff line change
Expand Up @@ -2,18 +2,9 @@ library("EpiNow2")

reported_cases <- example_confirmed[1:60]

# get uncertain example delays
u_generation_time <- example_generation_time
u_incubation_period <- example_incubation_period
# set uncertain reporting delay
u_reporting_delay <- dist_spec(
mean = convert_to_logmean(2, 1), mean_sd = 0.1,
sd = convert_to_logsd(2, 1), sd_sd = 0.1, max = 15
)
fixed_generation_time <- fix_dist(example_generation_time)
fixed_incubation_period <- fix_dist(example_incubation_period)
fixed_reporting_delay <- fix_dist(example_reporting_delay)

generation_time <- fix_dist(u_generation_time)
incubation_period <- fix_dist(u_incubation_period)
reporting_delay <- fix_dist(u_reporting_delay)

u_delays <- delay_opts(u_incubation_period + u_reporting_delay)
delays <- delay_opts(incubation_period + reporting_delay)
delays <- delay_opts(example_incubation_period + example_reporting_delay)
fixed_delays <- delay_opts(fixed_incubation_period + fixed_reporting_delay)

0 comments on commit c52c381

Please sign in to comment.