# Fitting all statistical distributions in R and choose best fit

Is there any function in R that fit all statistical distributions, and choose best fit based on log-likelihood and Kolmogorov-Smirnov D (KSD) statistic?

Like a software named, EasyFit

-
See ?ecdf (a joke, but only in part; I'm sure others will explain...) –  Aaron Jul 14 '12 at 18:33
The R commands fitdistr and ks.test do this for some distributions. Fitting all the distributions is 'pretty much' impossible. –  user10525 Jul 14 '12 at 18:35
Usually, I used EasyFit for this purpose because it do this task pretty well. However, now I am doing simulations so looking some commands in R. –  Bioinformatics Jul 14 '12 at 18:37
I'm not sure what "all statistical distributions" is supposed to include. I'm not aware that there is a fixed, finite list of possible distributions. Certainly there is a relatively small number of distributions that account for >99% of all analyses that are actually run, but even then, this doesn't make sense to me. Typically, people think about which distributions you might consider by thinking about what the data stand for and how they were gathered. That is, most of that work is a priori. Testing against a distribution is usually just a check to see that it's not too unreasonable. –  gung Jul 14 '12 at 18:45
Actually, data is about process capability [CP=(USL-LSL)/(6*sigma)]. I want to see the distribution of CP by simulation under different sample size. –  Bioinformatics Jul 14 '12 at 18:57

For a normal distribution Bill Heavlin has a method for constructing confidence intervals for Cpk. I discuss it in my book and compare it to my bootstrap confidence intervals for my example.

-
This is an answer to a secondary question by the OP. Why isn't it appropriate as an asnwer? –  Michael Chernick Jul 14 '12 at 20:24
Is there any reference of theoretical results/proof about distribution of Cp? –  Bioinformatics Jul 15 '12 at 6:42
I am sure that whatever was published at the time of the Johnson and Kotz book would be covered in there. –  Michael Chernick Jul 15 '12 at 12:43