I need to calculate the inverse CDF for a probability distribution, however there is no closed form approximation available in the literature.

The distribution I am working with is the Normal Inverse Gaussian distribution, however I would like to make my question more general than this. Of course, mathematical analysis could be used in principle to derive an approximation for any given distribution but I am looking for a more general technique. To give you an idea, the PDF function is

$${\frac {\alpha \delta K_{1}\left(\alpha {\sqrt {\delta ^{2}+(x-\mu )^{2}}}\right)}{\pi {\sqrt {\delta ^{2}+(x-\mu )^{2}}}}}\;e^{\delta \gamma +\beta (x-\mu )}$$

where $K_1$ is the modified Bessel function of the third kind.

The implementations I have seen for this distribution simply

  • Use numerical integration to define the CDF; then
  • Use root finding to define the inverse CDF

There must be a better way to calculate the inverse CDF than this. It's not hard to imagine improvements, for example you could pre-evaluate the PDF at a list of points, use quadrature on this list to evaluate the CDF and then use interpolation to approximate the inverse CDF.

Are there any established methods or algorithms for calculating the inverse CDF in this scenario?

  • $\begingroup$ If anyone is aware of an approximation for this distribution then please post a comment, I will then open a new question that you can answer $\endgroup$ – Bob Mortimer Aug 8 '16 at 9:45
  • $\begingroup$ Things I have done, to avoid the root finding, is to compute the CDF at a variety of points and build a model for the inverse CDF based on these points. One approach has been an adaptive sampling of the CDF, to sample in locations with larger curvature, and then do linear interpolation based on a binary search algorithm. Other has been to just do an assortment of CDF evaluations and build an approximate parametric model. Which one I choose depends on how accurate I need it to be and how efficient it needs to be. $\endgroup$ – spektr Aug 8 '16 at 20:34

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Browse other questions tagged or ask your own question.