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

Redesign interface #57

Closed
Tracked by #92
seabbs opened this issue May 16, 2022 · 2 comments · Fixed by #112
Closed
Tracked by #92

Redesign interface #57

seabbs opened this issue May 16, 2022 · 2 comments · Fixed by #112
Assignees
Labels
enhancement New feature or request help wanted Extra attention is needed high-priority question Further information is requested

Comments

@seabbs
Copy link
Collaborator

seabbs commented May 16, 2022

This is a proposal for a new interface. The basic idea is to build the model up as a series of chunks related to the sub-modules. There are open questions about how much of the data munging process (i.e which formulas use which data) the user should be exposed to.

A possible candidate interface:

epinowcast(
    data, model = enw_model(), reporting = enw_reporting(...), expectation = enw_expectation(...),
    missing = enw_missing(...), observation = enw_obs(...), fit = enw_fit(...)
)

enw_reporting( 
  parametric = ~ 1, | ~ 0 # none
  distribution = "log-normal", # | "none" = no parametric baseline hazard
  non_parametric = ~ 0 # (none) | ~ d (each day i.e discrete) | ~ d + age_group (cox model assuming proportional hazards by age group)
  reporting = ~ rw(week, by = age_group), | ~ 0 (or ~1) #none
  structural = ~ saturdays # (known days reporting cannot happen and hazard to -Inf),
  data = obs
)

enw_expectation(
  ~ rw(date, by = age_group), 
  offset = enw_offset(weights = 1),
  order = 2, #i.e second order = a growth rate model, # third order is difference in growth rate model and so on
  family = "none",  # here could have for example "poisson"
  delay_to_report = 1  # here could have the delay from inf to report as a pmf. Later extend to uncertain dists
  data = obs
)

enw_missing(
   ~ 1, 
   data = obs
)

enw_obs(
  baseline = ~ 1 # we could offfer the ability to model the variance parameter if present by baseline (i.e delay,) report and reference date
  report = ~ 1
  reference = ~ 1
  family = "negbin" #other options could be Poisson etc or even potentially non-count options. 
)

enw_fit(
  init = epinowcast::enw_init,
  fit = epinowcast::enw_sample,
  as_data_list = epinowcast::enw_as_data_list,
  ... # additional parameters passed to fit when called.
)
@seabbs seabbs added enhancement New feature or request help wanted Extra attention is needed question Further information is requested labels May 16, 2022
@seabbs
Copy link
Collaborator Author

seabbs commented Jun 28, 2022

Rejigged this a bit to only have parametric and non_parametric.

@seabbs
Copy link
Collaborator Author

seabbs commented Jul 18, 2022

Closed by #112

@seabbs seabbs closed this as completed Jul 18, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request help wanted Extra attention is needed high-priority question Further information is requested
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant