On Fri, 27 Sep 2019, Alecos Papadopoulos wrote:
Are we sure that the invcdf function works correctly for the case
of discrete distributions?
Thanks to Alecos for raising this question (and also to Frank
Benford for contributing to offlist discussion on the topic).
It turns out we were misinterpreting what the cephes functions pdtri
(Poisson) and bdtri (Binomial) are doing. They do "invert" the
respective CDFs, but with respect to a parameter (the Poisson rate
lambda, the Binomial success probability), not the value of the r.v.
That is, they solve for the parameter value that makes the CDF take
on a specified value given a value for the r.v.
The back-end to our invcdf() function now uses alternative code that
inverts the CDF in the sense that Alecos was expecting -- and that's
stated in the help for the function.
Allin