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

Bambi FAQ could be more helpful #644

Open
canyon289 opened this issue Feb 19, 2023 · 7 comments
Open

Bambi FAQ could be more helpful #644

canyon289 opened this issue Feb 19, 2023 · 7 comments
Labels
documentation good first issue If you want to contribute but are not sure where to get started, this issue is for you! help wanted

Comments

@canyon289
Copy link
Collaborator

  1. Remove boilerplate text
  2. Add actual FAQs

https://bambinos.github.io/bambi/faq.html
image

@canyon289 canyon289 added help wanted documentation good first issue If you want to contribute but are not sure where to get started, this issue is for you! labels Feb 19, 2023
@tomicapretto
Copy link
Collaborator

This was created because someone once offered to write content for the FAQ, but that never happened. And we never wrote it either. We could remove it if there's nobody who can write it

@abuzarmahmood
Copy link
Contributor

I'd be happy to contribute if I can get some pointers on what to include @tomicapretto @canyon289

@YuvrajSinghJadon
Copy link

I would like to contribute .

please provide some information.

@canyon289
Copy link
Collaborator Author

@abuzarmahmood and @YuvrajSinghJadon youre both welcome to work on this. My suggeestion is come up with a question or two you think users will have, then add those explanations to the FAQ. Tomas or I can comment on the PR :)

@tomicapretto
Copy link
Collaborator

Thanks @abuzarmahmood and @YuvrajSinghJadon for the initiative! And thanks Ravin for answering!
Following Ravin's comment, I think you could start with a list of questions that you have about the project (how to do X, or is Y supported, or I have Z problem what does it mean?) and we can help with the answers to those questions, while you create the appropriate markdown/notebook file in a PR.

@abuzarmahmood
Copy link
Contributor

Thank you for the pointers @tomicapretto and @canyon289. I've copied below a starter list of Q&A for your feedback. Full disclosure, I have only very recently started using Bambi so I apologize for inaccuracy/naivete in this list.

General

  • Why have a Bayesian regression library?

    • Bayesian modelling allows flexible (read 'bespoke') model specification and also provides an
      estimation of uncertainty in the model parameters. Both of these are wildly useful in
      practice, in particular in a business context where the model is used to make decisions,
      and where a complex model may be needed to capture the underlying relationships. Further,
      Bayesian modelling allows graceful handling of small sample sizes by judicious use of
      prior distributions.
  • I'm not familiar with Bayesian modelling, where can I learn more?

  • What is the difference between Bambi and PyMC3?

    • Bambi is a wrapper around PyMC3, NumPyro, and BlackJax. It provides a simple interface for
      specifying Bayesian models, and allows for easy inference using MCMC or
      variational inference.
    • PyMC3 is a library for Bayesian modelling, and is the backend used by Bambi. It is a very
      powerful library, but can be difficult to use for beginners. Bambi provides a simple
      interface for specifying models, and allows for easy inference using MCMC or variational
      inference.

Inference

  • My sampler through errors/indicating divergences, what should I do?

    • Divergences are a common issue in Bayesian modelling, and are usually not a problem as long as
      they are not prevalent. However, if you are seeing a lot of divergences, you may want
      to try 1) respecifying your model, 2) a different sampler.
    • If the sampler fails, this is likely an issue with model specification. Make sure you are using
      the correct priors for your model, and that you are not specifying a prior that is too
      strong (e.g. a prior that is too narrow), or one that does not match the data (e.g. a
      prior that doesn't cover the domain of the data such as using a HalfNormal prior for a
      parameter that can be negative).
  • What sampling methods are available?

    • The sampler used is automatically selected given the type of variables used in the model.
      For inference, Bambi supports both MCMC and variational inference. MCMC is the default, but you can specify variational inference by passing inference_method='vi' to Model.fit().
      Bambi also supports multiple backends for MCMC, including NumPyro, and BlackJax
      (see API for "fit" method for more details here).
  • My sampler is taking a long time, what should I do?

    • Long sampling times may simply be a result of the model being complex, or the data being
      large. If you are using a sampler that supports parallelization, you can try increasing the
      number of chains and/or cores. If you are using a sampler that does not support parallelization, you can try using a different sampler that does (e.g. NumPyro vs. PyMC3). You can also
      use variational inference, which is much faster than MCMC, but is not as flexible. You can
      also try respecifying your model, or using a different prior.
  • Can infernece in Bambi be sped up using GPUs/TPUs?

    • Yes, Bambi supports inference on GPUs and TPUs using the numpyro and blackjax backends.
      See the API for "fit" method for more details
      here.

Model specification

  • My data has a non-normal distributions, can I still use Bambi?

    • Yes, Bambi supports a wide range of distributions which can be specified using the "family"
      argument to the "Model". You can find examples of how to specify these distributions
      in the Bambi examples.
  • How do I find out what priors are available?

    • You can find a list of available priors in the Bambi Models API under the "family" argument.
  • Does bambi come with pre-specified regression models?

    • To allow building of bespoke models, Bambi does not come with pre-specified regression models.
      However, you can find examples of how to specify models in the
      Bambi examples.

@canyon289
Copy link
Collaborator Author

This looks great. I have some comments but itll be easier to address those in a pull request. Mind opening one of those and we can keep the discussion going there?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
documentation good first issue If you want to contribute but are not sure where to get started, this issue is for you! help wanted
Projects
None yet
Development

No branches or pull requests

4 participants