# Finding probability distribution that describes data

I have tried to fit several distributions to my continuous data (Pareto, Log-normal, Exponential, Gamma). The distribution of data is given below.

I used Kolmogorov-Smirnov test to compare my data to generated distributions using estimated parameters from fitdistr function using the following code:

fit<-fitdistr(mydata,"gamma")\$estimate
gamma.generated = rgamma(length(mydata),fit[1],fit[2])
w = ks.test(mydata,gamma.generated)

Two-sample Kolmogorov-Smirnov test

D = 0.089, p-value < 2.2e-16
alternative hypothesis: two-sided


However, I always get p-value < 0.001 for all distributions and a warning message "p-value will be approximate in the presence of ties". Does this mean that my data are not from any of these distributions or the test is too sensitive to some values? What would be other options (i.e. tests) that I can try? Thanks.

In two-sample KS, the null hypothesis is that the samples are drawn from the same distribution. In this context, p-value <1e-3 means that given the null hypothesis is true, there is a less than one-in-a-thousand probability that the Kolmogorov-Smirnov statistic (D), which calculates the maximum absolute difference between the empirical cdf of distribution 1 and the empirical cdf of distribution 2, will be greater than or equal to the value the test returns.