diff --git a/touchstone/script.R b/touchstone/script.R index 7dd57b6d9..a494695bd 100644 --- a/touchstone/script.R +++ b/touchstone/script.R @@ -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, @@ -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, @@ -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, @@ -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, @@ -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( diff --git a/touchstone/setup.R b/touchstone/setup.R index 370b36674..edda5c8bf 100644 --- a/touchstone/setup.R +++ b/touchstone/setup.R @@ -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)