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

Automate setting prior in case where there is no model #305

Closed
athowes opened this issue Sep 11, 2024 · 3 comments
Closed

Automate setting prior in case where there is no model #305

athowes opened this issue Sep 11, 2024 · 3 comments
Labels
high Required for next release

Comments

@athowes
Copy link
Collaborator

athowes commented Sep 11, 2024

As of PR #282 we have code like:

  if ("sigma" %in% names(formula$pforms)) {
    # Case with a model on sigma
    sigma_prior <- brms::prior(
      "normal(-0.7, 0.4)", class = "Intercept", dpar = "sigma"
    )
  } else if ("sigma" %in% names(formula$pfix)) {
    # Case with sigma fixed to a constant
    sigma_prior <- NULL
  } else {
    # Case with no model on sigma
    sigma_prior <- brms::prior(
      "lognormal(-0.7, 0.4)", class = "sigma", lb = 0, ub = "NA"
    )
  }

Within epidist_family_prior.lognormal. This is to deal with 3 cases:

  1. Model on the dpar
  2. No model on the dpar
  3. The dpar set to a constant

Ideally we should be automating parts of this. Specifically here, setting the prior in the case that there is no model. Can this be obtained as a tranformation of the case where there is a model? And then it can be done at a higher level e.g. in epidist_prior.

This also flags issues with the priors being connected to link functions, which can be changed by the user, and we don't currently account properly for.

Edit: we have also already discussed another issue which would provide a solution to this #266. Summary: just enforce there is always a model ~ 1. This is mentioned in #307.

@seabbs seabbs added the high Required for next release label Sep 11, 2024
@seabbs
Copy link
Contributor

seabbs commented Sep 11, 2024

one of this and #306 seems like a duplicate. What do you mean by no model? Do you mean no linear model but still a parameter (i.e sigma vs no sigma)? if so can you clarify and add in the already discussed option of enforcing that we always have a linear model (i.e the default is sigma ~ 1.

@athowes
Copy link
Collaborator Author

athowes commented Sep 11, 2024

There are 3 cases:

  1. Model on the dpar: then it'll be called Intercept_sigma
  2. No model on the dpar (Automate setting prior in case where there is no model #305): then it'll just be called sigma
  3. The dpar set to a constant (Generalise handling priors for parameters set to constant #306): then it'll be called sigma but will be set to a constant

I agree it's a bit confusing.

@athowes athowes mentioned this issue Sep 11, 2024
@athowes
Copy link
Collaborator Author

athowes commented Oct 10, 2024

Closing as outdated / not relevant.

@athowes athowes closed this as not planned Won't fix, can't repro, duplicate, stale Oct 10, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
high Required for next release
Projects
None yet
Development

No branches or pull requests

2 participants