Closed kyleabeauchamp closed 8 years ago
Tested on OSX + anaconda2.7 + pymc 2.3.6 + numpy 1.10.4
Also notice that the logP isn't even properly normalized in the case of b=0.0
AFAIK I think the relevant code is here:
https://github.com/pymc-devs/pymc/blob/master/pymc/flib.f#L4224
After applying PR #115, I get the following output from the above driver script:
Obviously this is stretching the notation a bit, as most people probably require positive values on the parameters. On the other hand, extending the domain a bit is probably better than silently return a wrong answer.
That's fine. The log-likelihoods were primarily intended to power MCMC, so simply returning -inf for parameters that are zero makes sense most of the time. The fact that negative a
and b
values are being admitted in some circumstances in the new code has me a little worried.
Good catch, see #116
In the limit of b -> 0, we expect (AFAIK) the beta binomial distribution to approach a delta distribution with E(x) = n a / (a + b) -> n. However, I find that the log likelihood of the beta binomial actually gives a discrete uniform when b=0. See driver code below and output figures of the pmf.