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

Discrete valued parameters in Bayesian Tools #206

Open
florianhartig opened this issue Jun 3, 2020 · 2 comments
Open

Discrete valued parameters in Bayesian Tools #206

florianhartig opened this issue Jun 3, 2020 · 2 comments

Comments

@florianhartig
Copy link
Owner

florianhartig commented Jun 3, 2020

From a user:

Thank you for developing the Bayesian Tools package with so many powerful and flexible sampling functions and options. Can I sample a binary parameter (0/1) or a discrete valued parameter (as one of other parameters which are treated as continuous valued) using the functions in this package?

@florianhartig
Copy link
Owner Author

At the moment (version 0.1.7), BT doesn't explicitly support discrete or binary parameters.

If this is only about a small number of parameters, you could probably emulate a discrete parameter by adding a round() argument in your likelihood, and sampling continuously. This should give you the correct posterior (assuming all discrete parameters receice the appropriate prior weight), but I would not guarantee that all the functions in BT (e.g. convergence checks, marginal Likelihoods etc) work appropriately when using this hack. In doubt, check if what you want to do works with an example where the posterior is known to you.

@peterlevy
Copy link

I have a similar issue, with (several) discrete parameters, which can only take the values 1, 2, 3, or 4. Can I somehow force a step size of 1 in the proposal generator, so I only move between these values?

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

2 participants