Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Feature request]: new configuration file specification for parameters #437

Open
pearsonca opened this issue Jan 3, 2025 · 3 comments
Open

Comments

@pearsonca
Copy link
Contributor

pearsonca commented Jan 3, 2025

Label

documentation, enhancement, meta/workflow

Priority Label

low priority

Is your feature request related to a problem? Please describe.

Users identified several issues with configuration file specification, and regularizing the approach to parameters seems necessary to support those changes.

Is your feature request related to a new application, scenario round, pathogen? Please describe.

No response

Describe the solution you'd like

There are currently several ways various analysis parameters are approached in the examples:

  • files, either read in or run a file (initial_conditions)
  • as parameters in seir
  • as modifiers in outcomes / scenarios

Ideally, these would be under a unified interface. Thinking roughly from https://github.com/HopkinsIDD/flepiMoP/blob/main/examples/tutorials/config_sample_2pop_vaccine_scenarios.yml:

parameters:
    X0:
      file: # or treating this with a more functional representation, like file(name, opt=, opt=)
        read: model_input/ic_2pop.csv
        allow_missing_subpops: TRUE
        allow_missing_compartments: TRUE
    sigma: 1 / 4
    gamma: 1 / 5
    Ro: ~trunc(norm(mean=2.5, sd=0.1), min=1.1, max=3) # or some unbundling
    omega_pess: 0.02
    omega_opt: 0.01
    nu_pess: 0.01
    nu_opt: 0.03
    detection_probability: ~trunc(norm(mean=0.5, sd=0.05), min=0.3, max=0.7)
    detect_delay: 5
    hosp_probability: 0.05
    hosp_delay: 7
    hosp_duration: 10
    death_prob: 0.2
    death_delay: 14

seir:
  # definition basically identical, but no parameters section
  scenarios: # base = some reference scenario; if not present (including if there is no scenario key at all), automatically defined by no modifiers
    use: [base, no_vax, pess_vax, opt_vax] # default to all scenarios, use this to specify which; base only automatically included when unspecified
    pess_vax_nu:
      description: turn off nu_opt, only nu_pess left
      nu_opt: 0
    pess_vax_wane:
      description: turn off omega_opt, only omega_pess left
      omega_opt: 0
    pess_vax:
      description: turn off all vaccination
      stack: [pess_vax_nu, pess_vax_wane]
    opt_vax_nu:
      description: turn off nu_pess, only nu_opt left
      nu_pess: 0
    opt_vax_wane:
      description: turn off omega_pess, only omega_opt left
      omega_pess: 0
    opt_vax:
      description: turn off all vaccination
      stack: [opt_vax_nu, opt_vax_wane]
    no_vax:
      description: turn off all vaccination
      modifiers: [pess_vax, opt_vax]


outcomes:
  incidCase: delay(sample(incidence(I), detection_probability), detect_delay)
  incidHosp: delay(sample(incidence(I), hosp_probability), hosp_delay)
  prevHosp: accumulate(incidence(incidHosp), window = hosp_duration)
  incidDeath: delay(sample(incidence(incidHosp), death_prob), death_delay)
  scenarios: # base = some reference scenario; otherwise a "base" scenario is automatically defined in terms of no mods, and scenarios is unnecessary
    test_limits:
      incidCase: trunc(incidCase, max = SOMENUMBER) # slightly different model spec than example, but communicates idea
  
@pearsonca
Copy link
Contributor Author

(probably comes after #436 - but possibly do this first, without the initial_conditions change, then build that off this)

@pearsonca
Copy link
Contributor Author

@TimothyWillard this might be productively broken up into some stages.

e.g. being able to parse direct specification

# replace
parameter:
  a:
    value: 5
# with
parameter:
  a: 5

open to thoughts on how to make these a bit more bite-size

@pearsonca
Copy link
Contributor Author

Hmm, also a tough part of this: the general case for distinct populations is that they are different collections of parameter values (e.g. population size). Need to do a bit of thinking about how to approach that.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant