[SciPy-User] gamma distribution fitting: newbie question

Daπid davidmenhur at gmail.com
Mon May 4 06:03:55 EDT 2015


On 3 May 2015 at 19:12, Bala subramanian <bala.biophysics at gmail.com> wrote:

> q3) If i have to estimate the chi2 and p value to see the goodness of fit,
> how can i do it in scipy. Someone please give the code i should use for the
> same. I want to see if my data follows a gamma distribution.


Here you have it:
https://docs.scipy.org/doc/scipy/reference/generated/scipy.stats.chisquare.html#scipy.stats.chisquare

Mind the warning, though. Two thirds of your bins are empty or almost
empty, so the test is not very accurate. You would have to apply an
appropriate transformation, or use a more robust method like:

https://docs.scipy.org/doc/scipy/reference/generated/scipy.stats.kstest.html#scipy.stats.kstest


/David.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.scipy.org/pipermail/scipy-user/attachments/20150504/b3ed9cd3/attachment.html>


More information about the SciPy-User mailing list