probcomp / cgpm

Library of composable generative population models which serve as the modeling and inference backend of BayesDB.
Apache License 2.0
25 stars 11 forks source link

Investigate suspicious implementation of Poisson.logpdf #251

Open fsaad opened 4 years ago

fsaad commented 4 years ago

Specifically the following lines https://github.com/probcomp/cgpm/blob/46e1d8d931fa81b2f4c3b4ff4575d9f8da1ef635/src/primitives/poisson.py#L146-L170

The posterior predictive distribution should be a negative binomial with n = a' and p = 1 / (1 + b'), or possibly p = 1 - 1/(1+b'), depending on the parameterization. From a cursory test the values returned by Poisson.calc_predictive_logp do not correspond to the negative binomial probabilities from scipy.stats.nbinom.