bambinos / bambi

BAyesian Model-Building Interface (Bambi) in Python.
https://bambinos.github.io/bambi/
MIT License
1.08k stars 124 forks source link

Add support for weighted responses #761

Closed tomicapretto closed 11 months ago

tomicapretto commented 11 months ago

With this PR Bambi supports weighted responses via the syntax weighted(values, weights) ~ 1 + x + y + ....

Weights in statistics can mean many things. In this case, the weights multiply the contribution of the observation to the log-likelihood. Thus, if an observation has a weight of 3 it is as if there were three records like that one.

Closes #639. Closes #561.

codecov-commenter commented 11 months ago

Codecov Report

Attention: 3 lines in your changes are missing coverage. Please review.

Comparison is base (8dd25b1) 89.60% compared to head (219353b) 89.83%.

Files Patch % Lines
bambi/backend/utils.py 93.93% 2 Missing :warning:
bambi/terms/utils.py 85.71% 1 Missing :warning:
Additional details and impacted files ```diff @@ Coverage Diff @@ ## main #761 +/- ## ========================================== + Coverage 89.60% 89.83% +0.23% ========================================== Files 45 45 Lines 3713 3768 +55 ========================================== + Hits 3327 3385 +58 + Misses 386 383 -3 ```

:umbrella: View full report in Codecov by Sentry.
:loudspeaker: Have feedback on the report? Share it here.

tomicapretto commented 11 months ago

Found room for improvement so I'm converting to draft

False alarm