I want to determine the quantile of a probability density function (PDF). I do not know the distribution, but I have a sample that was generated from it.

I estimate the quantile of the distribution as the quantile of the sample. How can I give an uncertainty that tells me how much the quantile of the sample fluctuates around the quantile of the PDF?

  • $\begingroup$ If you want a one-sided confidence interval, this is exactly the same as a one-sided tolerance interval. But I'm talking about the case of a parametric model. $\endgroup$ Commented Sep 28, 2015 at 11:55
  • $\begingroup$ It is pointed out in the duplicate thread that the techniques to answer this question for the median apply to the quantiles, too. $\endgroup$
    – whuber
    Commented Sep 28, 2015 at 16:35

1 Answer 1


Here is a simple yet powerful approach that you might find of great interest:

  • generate a lot of synthetic values from your distribution. You don't need to know the underlying distribution, you can use your sample (the empirical distribution) to simulate, using for example the smoothed bootstrap with variance correction, which is equivalent to simulating from a Kernel Density Estimator.
  • once you have simulated many values, you can simply get the corresponding empirical CDF, along with its inverse, which is nothing else than the quantile function you're looking for. This is called a Monte Carlo approach to evaluating a quantile function. The link here uses values generated via rejection sampling, but of course it also works for values generated via smoothed bootstrap (or any other method, like Metropolis-Hastings, etc.). As explained by Xi'an in the first comment, you can get confidence bands around your curve of the empirical CDF which you can convert into quantile estimation error.

All these steps are implemented easily in R as shown in the links I provided.

  • 1
    $\begingroup$ There are simple analytical, closed-form results for this approach, so there is no need to generate any samples at all. $\endgroup$
    – whuber
    Commented Sep 28, 2015 at 16:36
  • $\begingroup$ I do not know the true PDF. Your suggestion gives the uncertainty of the quantile if the boostrapped PDF approximates the true PDF well enough. I fear that might not be the case for me. $\endgroup$ Commented Sep 28, 2015 at 19:15
  • $\begingroup$ the bootstrapping approach is precisely used when the true underlying distribution is unknown. The bootstrapped PDF will always be faithful to the empirical PDF. Rather, the real question is whether your empirical PDF approximates the true PDF well enough. Only you have the answer for that. It comes down to how many observations you have, how these observations were taken, etc. $\endgroup$
    – Antoine
    Commented Sep 28, 2015 at 19:28

Not the answer you're looking for? Browse other questions tagged or ask your own question.