![]() ![]() Use untplot to plot the data: In : untplot(x, order=k, color='g', alpha=0.5) These are the values in the x: In : k = np.arange(x.max()+1) Generate some data to work with: In : x = poisson.rvs(0.4, size=100) The fitting is actually trivial, because the maximum likelihood estimation for the Poisson distribution is simply the mean of the data.įirst, the imports: In : import numpy as np seaborn is only used for the bar plot, using suggestion to use untplot. The question title is "How to fit a poisson distribution with seaborn?", so for the sake of completeness, here's one way to get a plot of the data and its fit. If that is the case, then even if had a fit method, it would not be an appropriate distribution to pass to distplot. I'm not very familiar with the seaborn.distplot function, but it appears to assume that the data comes from a continuous distribution. The discrete distributions in scipy do not have a fit method. The Poisson distribution (implemented in scipy as ) is a discrete distribution. ![]()
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |