-
-
Notifications
You must be signed in to change notification settings - Fork 132
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
add VonMises family #453
add VonMises family #453
Conversation
Codecov Report
@@ Coverage Diff @@
## main #453 +/- ##
==========================================
- Coverage 89.43% 89.18% -0.25%
==========================================
Files 31 31
Lines 2442 2460 +18
==========================================
+ Hits 2184 2194 +10
- Misses 258 266 +8
Continue to review full report at Codecov.
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Only minor changes.
It would be good if we add a very simple example in this PR for the record too.
bambi/backend/pymc.py
Outdated
@@ -25,6 +25,7 @@ class PyMC3Model: | |||
"log": tt.exp, | |||
"logit": logit, | |||
"probit": probit, | |||
"tan_2": lambda x: 2 * tt.arctan(x), |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Can we make this a regular function? We're still not using any pickling but this can be an impediment. See #400.
bambi/families/likelihood.py
Outdated
@@ -11,6 +11,7 @@ | |||
"NegativeBinomial": {"params": ("mu", "alpha"), "parent": "mu", "args": ("alpha",)}, | |||
"Poisson": {"params": ("mu",), "parent": "mu", "args": None}, | |||
"StudentT": {"params": ("mu", "sigma"), "args": ("sigma", "nu")}, | |||
"Vonmises": {"params": ("mu", "kappa"), "parent": "mu", "args": ("kappa",)}, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This should be "VonMises"
with capital M, as in the PyMC distribution name.
bambi/backend/terms.py
Outdated
@@ -241,6 +241,7 @@ def build(self, nu, invlinks): | |||
nu = tt.concatenate([np.zeros((data.shape[0], 1)), nu], axis=1) | |||
|
|||
# Add mean parameter and observed data | |||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
was this added on purpose? Otherwise, I would remove it, so the format is the same in all the code.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks good!! Merge if you don't plan to add anything else.
This allows to perform regression on circular response variables.