Comparing two estimated distributions


New Member
I estimated the density function (adaptive kde) from two samples (one of small size) and the cdf using approxfun() and integrate() in R. Now, I would implement a ks test to know if the two distributions are similar. I guess I have two options: Either, I draw two samples and use the function ks.test but how can I generate samples from my density estimation? Or I calculate the D-statistic (comparing the two cdfs) and the related p-value but how can I calculate the p-value from my estimated cdfs?