Quote:
Originally Posted by dreamer1 As for the 1-cdf(end) part, I'm not sure you are correct. |
Sorry, this was meant to be a check just on how good the numerical integration approximation was. We are discretely sampling the PDF, and then doing Riemann Sums as the approximation to the integral to get the CDF. If we undersampled the PDF then cdf(end) may not be very close to 1. I wasn't referencing the kstest.
The last part of my post was referring to the fact that maybe you didn't want to have such a finely resolved CDF. If that was the case, then I was showing how you might downsample it.
I assume your Y is the data? I guess the tests that I am familiar with

you don't need to do any kernel smoothing of the data. You would just bin the data and "bin" the PDF (take the difference of the endpoints of the CDF for each bin), and do the

test. It doesn't look like the ksdensity would be necessary.
If Y is the CDF that we just calculated, I'm not sure why any kernel smoothing would be necessary either.
But I should add the disclaimer that I have not done much on this part of statistics. I have used both kstest and

, but I have never done any kernel smoothing. I would think kernel smoothing would be useful for visualization, but not really for trying to perform hypothesis tests comparing empirical data to a given distribution.