I have a data set, whose elements (say 1,000 elements) are numeric with values between 0 and 1. It is safe to think the elements are independent from each other, i.e, the order of these elements does not matter at all. Also, from the histogram of the data set, I can tell it does not follow any parametric distribution (normal or others).
I used a modeling tool (not in R) to simulate 100 realizations of this data set given a set of parameters. In each realization, the number of elements is not necessarily equal to 1,000.
My goal is simple: Does the model fit the data well?
I plotted the histograms of the simulated data against the empirical data one (using both counts and probability density) and was sort of able to tell the quality of the fit, but would like to have a solid statistical way to quantitatively reach my goal (say showing the p-value of this fit is > 10% or so).
Is there a good way in R or Python I can do so? I looked up the standard R fitting methods, such as lm() and glm() in R, but they are for fitting a line to the data, not doing something I would like to have. I believe that this is simply because I am not familiar with R and statistics given this question does not seem to be weird and difficult.
Thanks, Ben
?ks.test
in R (Kolmogorov-Smirnov) $\endgroup$ – Ben Bolker Feb 24 '12 at 20:39