# Quantile regression vs probability density estimation

If you want to predict a range for a regression problem using a deep network, you can do quantile regression and go with (for example) 5% and 95% quantiles. The other option is predicting a probability density function (using something like tensorflow probability) and use its cdf to get a range. What is the advantage/disadvantage of one versus the other? Are there circumstances that there is a clear choice?

• Isn’t the TensorFlow probability the predicted probability of class membership in a classification problem?
– Dave
Aug 30 '20 at 0:27
• It might be useful for that as well (I don't know tbh) but the context of my question is using tensorflow probability layers (something like this tensorflow.org/probability/api_docs/python/tfp/layers/…) and setting the output as a distribution. Aug 30 '20 at 1:03

Alternatively, you can estimate separate quantiles via quantile regression. If you estimate a large set, say $${0.01, 0.02, .., 0.99}$$ you can approximate the probability distribution function. This is considered a non-parametric approach and it's more flexible, since you avoid making any assumptions about the distribution. However, it might require a different model to be trained for each quantile, which increases the computational burden.
There are also other ways to solve this problem, for example bootstrapping is a popular approach. I believe it depends on the problem at hand; if a known distribution fits your problem well, I would follow the parametric approach. In general, I think the non-parametric is more flexible and popular in practical applications (at least in my domain). I have also seen applications where quantile regression is used to estimate the range from $$5\%-95\%$$ and exponential distributions are used for modelling the tails.