Python - Test if my data follow a Poisson/Exponential distribution My question is very similar to a question on stackoverflow and this one on crossvalidated but I would like to have more details.
I have some data and I want to check the amount of error I would have if I assume that these data follow an exponential/Poisson distribution (I'd like to have the parameters estimate if possible).
On the X axis I have a measure of probability (it is often close to 0 and rarely close to 1).

Could you help me?
 A: One way to do what you're trying to do, is to compare your data with the hypothesized distribution (Exponential, Poisson, ..) and see if you can make any conclusions based on that comparison.
Here is one approach:


*

*Figure out which distribution you want to compare against.

*For that distribution, identify what the relevant parameters are that completely describe that distribution. 


*

*Usually it's the mean and variance. In the case of Poisson, the mean equals the variance so you only have 1 parameter to estimate, $\lambda$.


*Use your own data to estimate that parameter. 


*

*For the Poisson, take the mean of your data. That will be the mean ($\lambda$) of the Poisson that you generate.


*Compare the generated values of the Poisson distribution to the values of your actual data. 


*

*Usually compare means find the distance between the distribution. You can look up Kullback-Leiber divergence. 

*A potentially simpler method would be to compare the distance between each point generated by your data and the corresponding point on the Poisson distribution. 

*To see if the difference is large enough to be statistically significant (and therefore you can make some determination on the distribution of your data) you can run a significant test, as was mentioned in the comments. Look up KS-test for more information. This method has flaws so make sure you understand what it's doing.

*If you don't understand significance testing, I recommend searching this forum for more information. There. Is. A lot.


*Check out scipy.stats.kstest for implementation details in Python.

A: seems like this is what you were looking for
https://nolanbconaway.github.io/blog/2019/poisson-etest
https://github.com/nolanbconaway/poisson-etest
