question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Missing priors for `family='negativebinomial'`?

See original GitHub issue

Hi, I’m attempting to fit with the negativebinomial family and running into an error, despite it being listed as a valid family in the docs. I browsed around the codebase and looks like this config file might be lacking prior specs for negative binomial? https://github.com/bambinos/bambi/blob/master/bambi/config/priors.json

    283         if self._design.response is not None:
    284             _family = family.name if isinstance(family, Family) else family
--> 285             self._add_response(self._design.response, family=_family, link=link)
    286 
    287         if self._design.common:

/opt/anaconda3/envs/jan/lib/python3.7/site-packages/bambi/models.py in _add_response(self, response, prior, family, link)
    329         """
    330         if isinstance(family, str):
--> 331             family = self.default_priors.get(family=family)
    332         self.family = family
    333 

/opt/anaconda3/envs/jan/lib/python3.7/site-packages/bambi/priors.py in get(self, dist, term, family)
    189         elif family is not None:
    190             if family not in self.families:
--> 191                 raise ValueError(f"{family} is not a valid family name.")
    192             _f = self.families[family]
    193             prior = self._get_prior(_f["dist"])

ValueError: negativebinomial is not a valid family name.

Issue Analytics

  • State:closed
  • Created 2 years ago
  • Comments:7

github_iconTop GitHub Comments

1reaction
canyon289commented, Apr 2, 2021

@No-Stream, @tomicapretto was kind enough to fix this in the PR above. Hopefully things work now if you install from master. I’ll follow up with a test and if you’re able to confirm its working for you I’ll close this.

Also, I forgot my manners earlier. Thank you for opening this issue and making it so detailed!

0reactions
tomicaprettocommented, Apr 6, 2021

Happy to re-open this issue if you still encounter problems with negative binomial family. Again, thanks for reporting the problem 😃

Read more comments on GitHub >

github_iconTop Results From Across the Web

Priors in Negative Binomial Multilevel with random intercept
Hi all! I'm new to the forum and new to rstanarm and need some help. I have searched the web and forum, but...
Read more >
Chapter 12 Poisson & Negative Binomial Regression
Chapter 12 Poisson & Negative Binomial Regression ... wish to simulate the prior, and family = poisson indicates that we're using a Poisson...
Read more >
20 Negative Binomial: Estimating Homicides in Census Tracks
Simon Jackman's Bayesian Model Examples in Stan.
Read more >
Negative binomial not capturing overdispersion in glm model
I got the model to work with the following two steps: Most observations in the long tail was associated with one of the...
Read more >
11 Monsters and Mixtures | Statistical Rethinking with brms ...
McElreath didn't give an example of negative-binomial regression in the text. Here's one with the UCBadmit data. brm(data = d, family = negbinomial,...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found