Wishlist : inverse CDF functions (or, failing that, a few common special functions).

47 views
Skip to first unread message

Emmanuel Charpentier

unread,
Jan 20, 2017, 8:18:10 AM1/20/17
to Stan users mailing list
For meta-analytic purposes, it would be useful to have access to inverse CDF of the densities supported by Stan (e. g. to use a quantile).

Failing that (one can always make a dichotomic search on a bounded function guaranteed to be non-decreasing...), a few secial functions could be useful : we have beta and incomplete beta, whe also have gamma and log(gamma) ; log(incomplete_gamma) would be useful (e. g. joint density of a vector of quantiles...).

"Rolling our own" user-defined functions isn't very easy : I know enough numerical analysis to know that I know almost nothing of the subject...

What do you think ?

--
Emmanuel Charpentier

Bob Carpenter

unread,
Jan 20, 2017, 12:54:18 PM1/20/17
to stan-...@googlegroups.com
Adding inverse CDFs is on our to-do list. The bottleneck
is that we don't know how to calculate the derivatives. We could
autodiff the numerical algorithms for computing the functions,
but this is often poorly behaved numerically.

We need someone to dive into the numerical analysis specifically
for inverse CDFs to figure out reasonable approximations to
their derivatives.

- Bob
> --
> You received this message because you are subscribed to the Google Groups "Stan users mailing list" group.
> To unsubscribe from this group and stop receiving emails from it, send an email to stan-users+...@googlegroups.com.
> To post to this group, send email to stan-...@googlegroups.com.
> For more options, visit https://groups.google.com/d/optout.

Emmanuel Charpentier

unread,
Jan 20, 2017, 1:04:49 PM1/20/17
to stan-...@googlegroups.com
On 20/01/2017 18:54, Bob Carpenter wrote:
> Adding inverse CDFs is on our to-do list. The bottleneck
> is that we don't know how to calculate the derivatives. We could
> autodiff the numerical algorithms for computing the functions,
> but this is often poorly behaved numerically.
>
> We need someone to dive into the numerical analysis specifically
> for inverse CDFs to figure out reasonable approximations to
> their derivatives.

Indeed. I had a look at related functions in DLMF : Aaaarghhh.... For
most of them, a power series would probably have very poor convergence.
You'd need something like a Padé approximant. Coming by to them is
definitely not my usual turf...

Sincerely,

--
Emmanuel Charpentier

Bob Carpenter

unread,
Jan 20, 2017, 1:34:18 PM1/20/17
to stan-...@googlegroups.com
Us, either, which is why we haven't done it. I
just talked to Michael Betancourt, who said we could
do these using a root finder and the implicit function
theorem. And this is something we want to do, so maybe
we might start adding some of these sooner rather than
later.

- Bob
Reply all
Reply to author
Forward
0 new messages