'Maximum likelihood with bins generated by Poisson distribudion
I try to use maximum likelihood and happen' to have problems. Let me start from the beginning - I am doing this the first time, so I found the code of how somebody did it and tried to modify it to meet my needs (here is the link to the page that I used: https://analyticsindiamag.com/maximum-likelihood-estimation-python-guide/). Everything worked perfectly fine until I tried to change the distribution used in the code from normal to Poisson. The program doesn't see it as an error, but it is not counted well and it gives me a response: "success: False". Have anybody have any idea what is going wrong? All answers appreciated. Here is my modified code:
def max_likehood(parameters):
a,b,c = parameters
prediction = a*x+b*y+c*z
#calculate log-likelihood for Poisson distribution
likelihood=np.sum(stats.poisson.logpmf(some_data, prediction, loc=0))
neg_likelihood=-1*likelihood
return neg_likelihood
mlm=minimize(max_likelihood, np.array[2,2,2], method='L-BFGS-B')
({x,y,z} are known data packs)
Sources
This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.
Source: Stack Overflow
| Solution | Source |
|---|
