I am trying to get the best distributions for my data. The fitting is finished as shown in below figure, but i need a measurement, to choose the best model. I compared goodness of fit with a chi-squared value, and test for significant difference between observed and fitted distribution with a Kolmogorov-Smirnov (KS) test. I searched for some of potential solutions 1,2,3 but I didn't get my answer.From the results in below figure:
If the
p-value
is higher thank-statistic
, does it means we can accept the hypothesis or data fits the distribution well?Alternatively, is it ok to compare
level of significance(a=0.005)
withp-value
and decide the acceptance or rejection of hypothsis ? Ifp-value
is lower thana
, then it is very probable that the two distributions are different.For
Kolmogorov-Smirnov test
, is it essential to standardised the data (-1,1) ?Judging from the KS statistic and P-values, the
exponnorm
fits best in the data. Is that correct?
I calculated the P-value in following way:
for distribution in dist_names:
# Set up distribution and get fitted distribution parameters
dist = getattr(scipy.stats, distribution)
param = dist.fit(y_std)
p = scipy.stats.kstest(y_std, distribution, args=param)[1]
p = np.around(p, 5)
p_values.append(p)