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

Defaults for all arguments in exported functions #120

Closed
joshwlambert opened this issue May 30, 2024 · 5 comments
Closed

Defaults for all arguments in exported functions #120

joshwlambert opened this issue May 30, 2024 · 5 comments
Milestone

Comments

@joshwlambert
Copy link
Member

Would it be a (reasonable) option to add defaults for all arguments here?

Thinking about reducing barriers to usage, being able to run sim_linelist() and getting a line list returned (even if non-informative) may prove helpful to encourage usage. Now it requires going through additional steps that are not trivial - this can increase the barrier to first use enough to just move on if people are pressed for time.

Vice versa, the more accomplished we can make people feel in starting to use the package, the better from my perspective 😄

Originally posted by @chartgerink in #117 (comment)

@joshwlambert
Copy link
Member Author

Comment from @chartgerink from PR #117 relevant to this discussion:

It would be great if getting started only requires

library(simulist)
sim_linelist()

This will encourage the next steps to specify the distributions. Right now this quick start feels not so quick and may be a barrier for people.

@joshwlambert
Copy link
Member Author

I'm happy to implement this change. There is the risk that users will use the functions inappropriately with the default settings and the current setup provides some desirable difficulty, however, as this package is simulating data and not an analytical method used for estimation or inference then inappropriate use should be less problematic.

Discussion on this topic from Epiverse-TRACE (that I could find) are:

which seems to be in favour of providing sensible defaults over having users specify arguments. @Bisaloo do you agree that {simulist} would be worth adding more argument defaults to; and more generally is it Epiverse policy to use defaults wherever possible?

The arguments that would need defaults adding to achieve the simplest function call sim_linelist() outlined by @chartgerink would be:

For sim_linelist() and sim_outbreak():

  • contact_distribution
  • infectious_period
  • prob_infection
  • onset_to_hosp
  • onset_to_death

For sim_contacts():

  • contact_distribution
  • infectious_period
  • prob_infection

I propose to use the same anonymous functions as are used in the Get Started vignette.

Also tagging @CarmenTamayo and @adamkucharski to get other opinions from those involve in development discussions.

@joshwlambert joshwlambert added this to the v0.4.0 milestone Jun 24, 2024
@Bisaloo
Copy link
Member

Bisaloo commented Jun 24, 2024

@Bisaloo do you agree that {simulist} would be worth adding more argument defaults to; and more generally is it Epiverse policy to use defaults wherever possible?

My opinion is not fully formed on this and may continue evolving but my main intuition at this time, which results in this somewhat vague guidance:

Default are fine with the following rules and caveats:

  • Scientifically valid defaults should be provided when possible (e.g., probably don't default to 100 iterations in a MCMC)
  • If you can't provide scientifically valid defaults, avoid providing defaults at all for "difficult" parameters. I suspect some users start incorrectly relying on the default because they are not always sure what they mean or how to set them to a meaningful value.

@joshwlambert
Copy link
Member Author

Thanks @Bisaloo. Following your suggestions I think the sim_*() functions in {simulist} are good candidates to have default arguments and I'll make this change.

@joshwlambert
Copy link
Member Author

Closing as default arguments added in PR #149.

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

No branches or pull requests

2 participants