Skip to content
New issue

Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? # to your account

Improve Laplace computation and integration #555

Merged
merged 2 commits into from
Aug 16, 2022

Conversation

aloctavodia
Copy link
Collaborator

  • Perform computations on the unbounded space and return results on the original scale.
  • Return InferenceData object

@codecov-commenter
Copy link

codecov-commenter commented Aug 13, 2022

Codecov Report

Merging #555 (c1baf2f) into main (d84080b) will increase coverage by 0.29%.
The diff coverage is 97.43%.

@@            Coverage Diff             @@
##             main     #555      +/-   ##
==========================================
+ Coverage   85.72%   86.01%   +0.29%     
==========================================
  Files          32       32              
  Lines        2641     2689      +48     
==========================================
+ Hits         2264     2313      +49     
+ Misses        377      376       -1     
Impacted Files Coverage Δ
bambi/models.py 85.25% <ø> (+0.18%) ⬆️
bambi/backend/pymc.py 82.04% <97.29%> (+1.00%) ⬆️
bambi/tests/test_built_models.py 96.14% <100.00%> (+0.46%) ⬆️
bambi/tests/test_data.py 100.00% <0.00%> (ø)
bambi/tests/test_priors.py 100.00% <0.00%> (ø)
bambi/tests/test_predict.py 100.00% <0.00%> (ø)
bambi/tests/test_model_construction.py 98.83% <0.00%> (+0.02%) ⬆️
bambi/backend/terms.py 96.25% <0.00%> (+0.09%) ⬆️
bambi/families/likelihood.py 93.61% <0.00%> (+0.28%) ⬆️
... and 2 more

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

@tomicapretto
Copy link
Collaborator

This also makes the code in _run_laplace() much clearer, that's great.

One extra thing we could have is a docstring in _posterior_to_idata(). Maybe it also needs a better name, like _laplace_posterior_to_idata(), _posterior_samples_to_idata(), or something that is more explicit about the circumstances it's used. The previous name is too general.

@aloctavodia
Copy link
Collaborator Author

This is ready to merge from my side

@tomicapretto tomicapretto merged commit 2287de4 into bambinos:main Aug 16, 2022
@aloctavodia aloctavodia deleted the laplace branch August 17, 2022 16:39
# for free to join this conversation on GitHub. Already have an account? # to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants