# Approximating the inverse of an expensive CDF function

**URL:** <https://discourse.julialang.org/t/approximating-the-inverse-of-an-expensive-cdf-function/114809>\
**Category:** Statistics\
**Created:** [May 27, 2024, 9:49pm UTC](https://discourse.julialang.org/t/approximating-the-inverse-of-an-expensive-cdf-function/114809 "2024-05-27T21:49:50Z")\
**Posts on this page:** 1\
**Showing post:** 2

<div class="post-metadata">

**Author:** ![stevengj](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/stevengj/32/71_2.png) [@stevengj](https://discourse.julialang.org/u/stevengj)\
**Post date:** [May 28, 2024, 1:57am UTC](https://discourse.julialang.org/t/approximating-the-inverse-of-an-expensive-cdf-function/114809/2 "2024-05-28T01:57:53Z")

</div>

There are lots of packages for polynomial interpolation in Julia that can be applied to approximate the inverses of expensive functions. See e.g. [Approximate inverse of a definite integral - #3 by stevengj](https://discourse.julialang.org/t/approximate-inverse-of-a-definite-integral/83181/3)

I’m not sure if there is anything like this that is prepackaged to approximate inverse CDFs from data; presumably you want some kind of fit or spline if you have the numerical CDF (via the `quantile` function in the Statistics standard library, for example) evaluated on a grid. There are lots of packages in Julia for various forms of spline interpolation too, including [monotonic Hermite splines](https://github.com/gerlero/PCHIPInterpolation.jl) — it should be straightforward to apply this to the `quantile` output, no?

PS. I split this post off into a new thread, rather than resurrecting a 3-year-old thread on a loosely related topic.

---

_[View the full topic](https://discourse.julialang.org/t/approximating-the-inverse-of-an-expensive-cdf-function/114809)._
