# Getting the best fitting distribution using the p value

I have a set of data points, and I want to get the best theoretical distribution that fits the data. For that I'm using Kolmogorov-Smirnov test for goodness of fit. This test reveals the p value of the two sided test. Can I chose the distribution as the best fitting distribution, which gives the highest p value for the K-S test?

• Well, let's say you would do that. Define the data points to be given by $\{x_n\}_{n=1}^{N}$. The 'best' distribution according to your way of fitting would now be a uniform distribution over $\{x_n\}_{n=1}^{N}$ giving you a $p$-value of $1$. – Stan Tendijck Aug 9 '18 at 11:36