Skip to content

Commit

Permalink
update touchstone setup
Browse files Browse the repository at this point in the history
  • Loading branch information
sbfnk committed Feb 9, 2023
1 parent 48d60d0 commit 0bf9d9c
Show file tree
Hide file tree
Showing 3 changed files with 48 additions and 29 deletions.
1 change: 1 addition & 0 deletions touchstone/.gitignore
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
*
!setup.R
!script.R
!config.json
!.gitignore
Expand Down
58 changes: 29 additions & 29 deletions touchstone/script.R
Original file line number Diff line number Diff line change
Expand Up @@ -9,80 +9,80 @@ touchstone::branch_install()

# benchmnark README example
touchstone::benchmark_run(
expr_before_benchmark = 'source("touchstone/setup.R")',
default = 'epinow(
expr_before_benchmark = { source("touchstone/setup.R") },
default = { epinow(
reported_cases = reported_cases,
generation_time = generation_time_opts(generation_time),
generation_time = generation_time,
delays = delay_opts(incubation_period, reporting_delay),
rt = rt_opts(prior = list(mean = 2, sd = 0.2)),
stan = stan_opts(
cores = 2, samples = 500, chains = 2,
control = list(adapt_delta = 0.95)),
control = list(adapt_delta = 0.95), seed = 5339),
verbose = interactive()
)',
n = 2
) },
n = 1
)

# benchmark readme example with uncertain delays and gt
touchstone::benchmark_run(
expr_before_benchmark = 'source("touchstone/setup.R")',
uncertain = 'epinow(
expr_before_benchmark = { source("touchstone/setup.R") },
uncertain = { epinow(
reported_cases = reported_cases,
generation_time = generation_time_opts(ugeneration_time),
delays = delay_opts(uincubation_period, reporting_delay),
rt = rt_opts(prior = list(mean = 2, sd = 0.2)),
stan = stan_opts(
cores = 2, samples = 500, chains = 2,
control = list(adapt_delta = 0.95)),
control = list(adapt_delta = 0.95), seed = 5339),
verbose = interactive()
)',
n = 2
) },
n = 1
)

# benchmark readme example without delays
touchstone::benchmark_run(
expr_before_benchmark = 'source("setup.R")',
no_delays = 'epinow(
expr_before_benchmark = { source("touchstone/setup.R") },
no_delays = { epinow(
reported_cases = reported_cases,
generation_time = generation_time_opts(generation_time),
generation_time = generation_time,
rt = rt_opts(prior = list(mean = 2, sd = 0.2)),
stan = stan_opts(
cores = 2, samples = 500, chains = 2,
control = list(adapt_delta = 0.95)),
control = list(adapt_delta = 0.95), seed = 5339),
verbose = interactive()
)',
n = 2
) },
n = 1
)

# benchmark readme example with a stationary GP
touchstone::benchmark_run(
expr_before_benchmark = 'source("setup.R")',
stationary = 'epinow(
expr_before_benchmark = { source("touchstone/setup.R") },
stationary = { epinow(
reported_cases = reported_cases,
generation_time = generation_time_opts(generation_time),
generation_time = generation_time,
rt = rt_opts(prior = list(mean = 2, sd = 0.2), gp_on = "R0"),
stan = stan_opts(
cores = 2, samples = 500, chains = 2,
control = list(adapt_delta = 0.95)),
control = list(adapt_delta = 0.95), seed = 5339),
verbose = interactive()
)',
n = 2
) },
n = 1
)

# benchmark readme example with a weekly random walk
touchstone::benchmark_run(
expr_before_benchmark = 'source("touchstone/setup.R")',
random_walk = 'epinow(
expr_before_benchmark = { source("touchstone/setup.R") },
random_walk = { epinow(
reported_cases = reported_cases,
generation_time = generation_time_opts(generation_time),
generation_time = generation_time,
rt = rt_opts(prior = list(mean = 2, sd = 0.2), rw = 7),
gp = NULL,
stan = stan_opts(
cores = 2, samples = 500, chains = 2,
control = list(adapt_delta = 0.95)),
control = list(adapt_delta = 0.95), seed = 5339),
verbose = interactive()
)',
n = 2
) },
n = 1
)

# create artifacts used downstream in the GitHub Action
Expand Down
18 changes: 18 additions & 0 deletions touchstone/setup.R
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
library("EpiNow2")

reported_cases <- example_confirmed[1:60]

# set up example generation time
generation_time <- generation_time_opts(
disease = "SARS-CoV-2", source = "ganyani", fixed = TRUE
)

# set delays between infection and case report
incubation_period <- get_incubation_period(
disease = "SARS-CoV-2", source = "lauer"
)

reporting_delay <- list(
mean = convert_to_logmean(2, 1), mean_sd = 0,
sd = convert_to_logsd(2, 1), sd_sd = 0, max = 10
)

4 comments on commit 0bf9d9c

@seabbs
Copy link
Contributor

@seabbs seabbs commented on 0bf9d9c Feb 10, 2023

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

❤️

@sbfnk
Copy link
Contributor Author

@sbfnk sbfnk commented on 0bf9d9c Feb 10, 2023

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yeah but it still doesn't work (though gets a bit further now).

@seabbs
Copy link
Contributor

@seabbs seabbs commented on 0bf9d9c Feb 10, 2023

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

progress towards working is still progress!

@sbfnk
Copy link
Contributor Author

@sbfnk sbfnk commented on 0bf9d9c Feb 10, 2023

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

more progress #366 (comment)

Please sign in to comment.