0

I have a data like this :

dataframe

I have plotted histogram for each month :

histogram

I can not seem to fig out which probability distribution will fit it the most. I tried to fit in gamma distribution but results are bad :

alpha_mom = precip_mean ** 2 / precip_var
beta_mom = precip_var / precip_mean
from scipy.stats.distributions import gamma

unemployment.Jan.hist(normed=True, bins=20)
plt.plot(np.linspace(0, 10), gamma.pdf(np.linspace(0, 10), alpha_mom[2], 
beta_mom[2]))

Can someone guide me which distribution will fir above data. I could not seem to figure out. here are result for fitting for month of Jan: results

PriyalChaudhari
  • 363
  • 1
  • 7
  • 23
  • Instead of computing histograms it is more appropriate to compute the ECDF for each month. This should give you a better idea what distribution function to use. – KRKirov Jun 10 '18 at 22:27
  • @KRKirov I tried doing it but i could not find a way on how to do it with my dataframe. can you point me out how can i do that – PriyalChaudhari Jun 10 '18 at 22:44
  • In order to compute the ECDF for each month, you need to: 1) Sort the data in each month in ascending order, e.g. np.sort(data). This is the x-data of the ECDF. 2) np.arange(1, n+1)/n where n = len(data). This is the y-data of the ECDF. – KRKirov Jun 11 '18 at 01:00
  • @KRKirov Thank you i will try – PriyalChaudhari Jun 11 '18 at 01:39

0 Answers0