I know about PIT, but this works only when you know the distribution, or at least have a strong hint. What I am trying to achieve is to transform a given sample into an equivalent sample with continuous standard uniform distribution.
I have a sample of size $n$. I choose arbitrary a value $m$, and estimate $m+1$ quantiles (for example, if $m=4$, I compute quantiles for $\{0, .25, .5, .75, 1\}$). The procedure is described in Wikipedia.
Using quantiles I transform each $x_i$. If $x_i$ happens to be exactly a computed quantile, than I know precisely its equivalent value, otherwise I interpolate the equivalent value linearly.
I've done a small simulation. I build a random sample from standard normal with $10^6$ values. I applied the described transformation and make KS test for some values of $m$. The results looks like:
m D p-value
100 0.006090 0.000000000000 ***
200 0.003151 0.000000004733 ***
300 0.001991 0.000720875707 ***
400 0.001484 0.024403417075 *
500 0.001057 0.213437843144
It looks like I can do a PIT on sample with only 500 interpolation points.
The question is: can I use Kolmogorov-Smirnov one sample goodness-of-fit to find a proper value for $m$ (the number computed quantiles)?