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

add VonMises family #453

Merged
merged 3 commits into from
Feb 18, 2022
Merged

add VonMises family #453

merged 3 commits into from
Feb 18, 2022

Conversation

aloctavodia
Copy link
Collaborator

This allows to perform regression on circular response variables.

@codecov-commenter
Copy link

codecov-commenter commented Feb 17, 2022

Codecov Report

Merging #453 (af41c32) into main (2d90ab3) will decrease coverage by 0.24%.
The diff coverage is 57.89%.

Impacted file tree graph

@@            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     
Impacted Files Coverage Δ
bambi/defaults/defaults.py 80.55% <ø> (ø)
bambi/families/family.py 73.68% <ø> (ø)
bambi/families/likelihood.py 93.33% <ø> (ø)
bambi/families/utils.py 23.07% <ø> (ø)
bambi/tests/test_model_construction.py 100.00% <ø> (ø)
bambi/families/univariate.py 87.96% <33.33%> (-4.97%) ⬇️
bambi/families/link.py 64.06% <50.00%> (-0.94%) ⬇️
bambi/backend/links.py 96.15% <100.00%> (+0.32%) ⬆️
bambi/backend/pymc.py 79.90% <100.00%> (ø)
bambi/tests/test_built_models.py 98.90% <100.00%> (+0.01%) ⬆️

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update 2d90ab3...af41c32. Read the comment docs.

Copy link
Collaborator

@tomicapretto tomicapretto left a 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.

@@ -25,6 +25,7 @@ class PyMC3Model:
"log": tt.exp,
"logit": logit,
"probit": probit,
"tan_2": lambda x: 2 * tt.arctan(x),
Copy link
Collaborator

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.

@@ -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",)},
Copy link
Collaborator

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.

@@ -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

Copy link
Collaborator

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.

Copy link
Collaborator

@tomicapretto tomicapretto left a 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.

@aloctavodia aloctavodia merged commit bf9e372 into bambinos:main Feb 18, 2022
@aloctavodia aloctavodia deleted the vonmises branch February 18, 2022 13:30
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