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

Facilitate user passing in priors #71

Closed
athowes opened this issue Jun 5, 2024 · 4 comments · Fixed by #95
Closed

Facilitate user passing in priors #71

athowes opened this issue Jun 5, 2024 · 4 comments · Fixed by #95
Assignees
Labels
enhancement New feature or request

Comments

@athowes
Copy link
Collaborator

athowes commented Jun 5, 2024

Goal

As a part of a Bayesian analysis, users of this package should be able to easily pass in prior distributions they would like to use. We should also provide sensible default options.

Context

epidist interfaces via brms making it easy to help users pass in some priors. For other parameters (custom) then it's harder.

Required features

  • Update epidist_priors to document the names of the parameters that users can pass in
  • Update epidist::epidist to accept input of priors
  • Possibly change the default brms priors if we think there is good reason to

Out of scope

  • Likely out of scope to allow for passing in priors for custom parameters (not the brms default ones)

Related documents

@athowes athowes added the enhancement New feature or request label Jun 5, 2024
@athowes athowes self-assigned this Jun 5, 2024
@athowes
Copy link
Collaborator Author

athowes commented Jun 10, 2024

I've been thinking about this and one thing we could do is like:

epidist_priors <- function(data, family, formula, ...) {
  default_prior <- brms::default_prior(
    object = formula,
    data = data,
    family = family
  )
  
  # Now replace parts of the default priors with user provided priors
  priors <- ...
  # Now warn user that "default brms prior used for parameter: ... pass in something to replace it..."
  return(priors)
}

What do you think @seabbs? Am playing with this at the moment.

@seabbs
Copy link
Contributor

seabbs commented Jun 10, 2024

yeah could do it as the output and update the list using ModifyList

@athowes
Copy link
Collaborator Author

athowes commented Jun 10, 2024

What do you mean by "as the output"?

The output of epidist_priors at the moment is being passed into epidist.

I'd imagine that the output is the list of priors, as required by brms.

I think that this should be the output, and then there should be a message about which default priors have been used.

Perhaps there could just be one message at the end to say how to change the priors.

Perhaps the messages could be set to be off by default somehow when passed in as default argument to epidist (don't want to spam user with too many messages, just want them to get this information if they care about changing the priors).

@seabbs
Copy link
Contributor

seabbs commented Jun 10, 2024

epidist(..., priors = ModifyList(epidist_priors(), sigma = blah blah blah))`

could be a pattern

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

Successfully merging a pull request may close this issue.

2 participants