updating to directly input ACH and infer riskiness. User defined efficacy from delta ACH#142
updating to directly input ACH and infer riskiness. User defined efficacy from delta ACH#142cwhittaker1000 wants to merge 65 commits into
Conversation
|
Aim with this PR is get The aim with doing this is to enable us to calculate efficacy not as a single input value, but as a function of ACH in each location; whilst also retaining the ability to specify riskiness, again in a location specific manner. This is very rough, but based on our convo today, it seems like there are 4 broad pieces of work to be done here (not necessarily in this order):
|
…ose on the riskiness distribution
|
Updates:
|
…r each type of location, etc.)
…etting_specific_ach script
|
Summary of changes:
|
…ific function based on tests
… tests to check that it works
…tions to interventions.R
|
@geethaj1 - quick q as I'm running through the code. Are there any files in |
Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>
cwhittaker1000
left a comment
There was a problem hiding this comment.
Great stuff @geethaj1 - really impressive work here. Everything looks broadly right to me - some minor comments/questions enclosed and I think the big piece is tidying this up and documentation improvements ahead of merge. Congrats!
| volume_per_person_leisure = 8, # 2m^2*4M | ||
| volume_per_person_household = 50, # 20m^2 * 2.5m | ||
|
|
||
| # W-R parameters |
There was a problem hiding this comment.
Let's have a conversation about how much we want to expose these parameters - I think doing so is fine but useful to have a conversation about helper functions vs forcing users to input these directly etc.
| # far_uvc_household_sigmoid_x0 = NULL, | ||
|
|
||
| # Intervention parameters (Wells-Riley ACH-based efficacy): | ||
| intervention_joint_active = FALSE, |
There was a problem hiding this comment.
I don't think any of these parameters are currently documented in the above documentation on inputs or elsewhere? I'm currently having to infer and understand them based on context and reading other parts of the codebase, which is time consuming. Can you make sure all these are documented and described please?
There was a problem hiding this comment.
Added documentation for volume per person parameters, Wells Riley parameters, and intervention parameters
| intervention_household_covered = NULL, | ||
|
|
||
| # Room Size Per Individual Parameters: | ||
| size_per_individual_workplace = 1, |
There was a problem hiding this comment.
Do we still need these if we have the volume parameters above?
There was a problem hiding this comment.
the volumes are used in the W-R calculations, but right now room size per individual is being used in the coverage allocation when coverage_target = "square_footage". We could change it so we change the square-footage option to volume, and then have coverage allocated by volume, which could be good to do
| # calculation runs through the same code path. | ||
| for (s in c("workplace", "school", "leisure")) { | ||
| parameters_list[[paste0("intervention_", s, "_active")]] <- TRUE | ||
| parameters_list[[paste0("intervention_", s, "_list")]] <- parameters_list$intervention_joint_list |
There was a problem hiding this comment.
What is this parameter intervention_joint_list - I can't figure it out and where it's used/what for?
There was a problem hiding this comment.
Is the list of things like what it does to modify ACH etc that we discussed?
There was a problem hiding this comment.
Yes, intervention_joint_list stores the list of interventions (in this branch its just 1 intervention), and describes the characteristics of the intervention. It's used in calculate_efficacy_from_ach to get information about the interventino, and in generate_joint-intervention_switches for coverage allocation.
| variation_function = NULL, | ||
| variation_params = list(), | ||
| coverage = NULL) { | ||
| list( |
There was a problem hiding this comment.
I think we need some checks in here - if affected_by_baseline_ach is set to FALSE, then baseline_ach_function should be NULL right?
Related point is that none of these parameters are documented or particularly clear - I think we need clearer documentation of what they are and what they mean/correspond to.
There was a problem hiding this comment.
ah sorry this is poor naming on my end, I've renamed affected_by_baseline_ach todelta_depends_on_baseline_ach delta_depends_on_baseline_ach , and baseline_ach_function to delta_function, as it is the function to define the delta ACH of an intervention, irrespective of whether it is affected by the baseline .
I've added added roxygen documenting the definitions
| coverage_target, | ||
| coverage_type, | ||
| timestep, | ||
| ...) { |
There was a problem hiding this comment.
Instead of having the ... why not just force the user to pass in the list directly?
There was a problem hiding this comment.
have edited to force user to pass directly, this was leftover from when I was initially attempting multiple interventions on this branch. Has now been cleaned up and documented
| # Efficacy at location i = 1 - p_post[i] / p_pre[i], where the post-intervention | ||
| # alpha is augmented by the sum of intervention deltas (zeroed for uncovered | ||
| # locations via the coverage vector). | ||
| calculate_efficacy_from_ach <- function(ach_values, parameters_list, setting) { |
There was a problem hiding this comment.
this is really nice work Geetha!
|
|
||
|
|
||
| # ============================================================================= | ||
| # Helper functions for ACH / efficacy / UV-C conversions |
There was a problem hiding this comment.
haven't looked at the below in detail as presume they're helper functions not used anywhere much. Let me know if that seems wrong
There was a problem hiding this comment.
this is right, the helper functions are just there to help the user figure out the appropriate inputs, not used anywhere in the actual model
baseline_ach_function -> delta_function baseline_ach_params -> delta_params affected_by_baseline_ach -> delta_depends_on_baseline_ach better represents that they describe the delta the intervention adds (and whether that delta depends on baseline ACH).
…ention parameters
… it with intervention documentation and Roxygen
… riskiness by setting median
| volume_per_person_workplace = 27, #10m^2 *2.7m | ||
| volume_per_person_school = 10, # 3.33m^2 *3m | ||
| volume_per_person_leisure = 8, # 2m^2*4M | ||
| volume_per_person_household = 50, # 20m^2 * 2.5m |
There was a problem hiding this comment.
I think this isn't currently connected to the square footage per person assumed for coverage allocation etc (or at least, it matches only through the defaults, a user could change this and it might not change the square footage used in coverage allocation). Need to make sure they're joined up if they're not already!
There was a problem hiding this comment.
Geetha: maybe just do square footage per person and multiply by heights.
Charlie: yes I like that idea!
…xploring structures of various interventions
As above; this addresses and answers #136 - @geethaj1 will be handling this.