Open thekingofkings opened 7 years ago
The log-likelihood function might not be completely wrong, but it is definitely over-simplified.
Follow the NegativeBinomial implementation to improve this function.
One possible explanation is that I did not implement the score
function, which gives the gradient of the log-likelihood function at given parameters.
I followed the implementation of the discrete.NegativeBinomial model.
Now it seems that the original NegativeBinomial
model has issue to fit data. There is a bug report
Wrong log-likelihood function is used
In
python/NegBinStatModel
, the negative binomial distribution likelihood function is used, i.e.nbinom.logpmf
, which is wrong.Refer this link for the correct log-likelihood function.