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

documentation on custom prior #656

Merged
merged 3 commits into from
Mar 30, 2023

Conversation

SuryaMudimi
Copy link
Contributor

added how to specify custom prior documentation in getting started under "Specifying priors" section

@review-notebook-app
Copy link

Check out this pull request on  ReviewNB

See visual diffs & provide feedback on Jupyter Notebooks.


Powered by ReviewNB

@@ -662,7 +662,6 @@
]
Copy link
Collaborator

@tomicapretto tomicapretto Mar 23, 2023

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

For the first paragraph I would say

Bambi's priors are a thing layer on top of PyMC distributions. If you want to ask for a prior distribution by name, it must be the name of a PyMC distribution. But sometimes we want to use more complex distributions as priors. For all those cases, Bambi's Prior class allow users to pass a distribution that returns the new prior. See the following example:

Then I would say

The example above is trival because it's just a wrapper of the pm.Normal distribution. But we can use this pattern to construct more complex distributions, such as a Truncated Laplace distribution.

And finally, close with

In summary, custom priors allow for greater flexibility by combining existing PyMC distributions in different ways. If you need to use a distribution that's not implemented in PyMC, please check the following link.

Reply via ReviewNB

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@SuryaMudimi thanks a lot for the contribution! See the suggestions I left :)

@tomicapretto
Copy link
Collaborator

Just minor comments

I suggested "allow users to pass a distribution that returns the new prior" it should be "allow users to pass a function that returns a distribution that will be used as the prior"

Also

in PyMC, Please check the linkfor further details.

Should be

in PyMC, please check the link for further details

note the lowercase in "please" and the space after the link

@codecov-commenter
Copy link

codecov-commenter commented Mar 24, 2023

Codecov Report

Merging #656 (5b33c56) into main (afcabb6) will increase coverage by 0.06%.
The diff coverage is 95.45%.

@@            Coverage Diff             @@
##             main     #656      +/-   ##
==========================================
+ Coverage   87.56%   87.62%   +0.06%     
==========================================
  Files          40       40              
  Lines        2629     2650      +21     
==========================================
+ Hits         2302     2322      +20     
- Misses        327      328       +1     
Impacted Files Coverage Δ
bambi/defaults/distributions.py 100.00% <ø> (ø)
bambi/defaults/families.py 87.50% <ø> (ø)
bambi/defaults/utils.py 87.50% <ø> (ø)
bambi/families/likelihood.py 85.36% <ø> (ø)
bambi/families/univariate.py 90.37% <95.00%> (+0.80%) ⬆️
bambi/families/family.py 93.25% <100.00%> (ø)

... and 1 file with indirect coverage changes

📣 We’re building smart automated test selection to slash your CI/CD build times. Learn more

@SuryaMudimi
Copy link
Contributor Author

made those corrections.

@tomicapretto
Copy link
Collaborator

made those corrections.

Thanks!! I will merge after the checks run.

@tomicapretto tomicapretto merged commit 1523650 into bambinos:main Mar 30, 2023
GStechschulte pushed a commit to GStechschulte/bambi that referenced this pull request Mar 30, 2023
* documentation on custom prior

* changes as suggeted by Tomás

* minor changes
tomicapretto pushed a commit that referenced this pull request Mar 30, 2023
* import bambi as bmb in tests

* documentation on custom prior (#656)

* documentation on custom prior

* changes as suggeted by Tomás

* minor changes

* fixed failed tests b/c of regex match copy and paste mistake

---------

Co-authored-by: Surya Mudimi <surya.mudimi@gmail.com>
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

Successfully merging this pull request may close these issues.

3 participants