Hi I'm wondering if anyone is aware of an R package implementing (i.e., providing a pdf, cdf, and/or quantile function) for the continuous binomial distribution? Specifically the one characterized here: http://www2.math.uni-paderborn.de/fileadmin/Mathematik/AG-Indlekofer/Workshop/Satellite_meeting/ilenko.pdf Figured I would check here first, before attempting to code it up myself. Regards Ben
package implementing continuous binomial?
5 messages · David Winsemius, Benjamin Tyner, Martin Maechler +1 more
On May 6, 2015, at 7:00 PM, Benjamin Tyner wrote:
Hi I'm wondering if anyone is aware of an R package implementing (i.e., providing a pdf, cdf, and/or quantile function) for the continuous binomial distribution? Specifically the one characterized here: http://www2.math.uni-paderborn.de/fileadmin/Mathematik/AG-Indlekofer/Workshop/Satellite_meeting/ilenko.pdf Figured I would check here first, before attempting to code it up myself.
I found that reading the ArXiv version of that material was easier to understand: http://arxiv.org/abs/1303.5990 zipfR package has an implementation of the incomplete beta function that might make some of the coding of the pdf and cdf more simple. Searching done with Graves' very useful utility package: library('sos') findFn("incomplete beta function") (I did't think that doing a search on "continuous Binomial" was likely to be helpful, but I tried it anyway and did not find any functions named "continuous binomial" in their help page titles.)
David Winsemius Alameda, CA, USA
Thanks David! I'll take a look at zipfR. Regards Ben
On 05/07/2015 03:10 PM, David Winsemius wrote:
On May 6, 2015, at 7:00 PM, Benjamin Tyner wrote:
Hi I'm wondering if anyone is aware of an R package implementing (i.e., providing a pdf, cdf, and/or quantile function) for the continuous binomial distribution? Specifically the one characterized here: http://www2.math.uni-paderborn.de/fileadmin/Mathematik/AG-Indlekofer/Workshop/Satellite_meeting/ilenko.pdf Figured I would check here first, before attempting to code it up myself.
I found that reading the ArXiv version of that material was easier to understand: http://arxiv.org/abs/1303.5990 zipfR package has an implementation of the incomplete beta function that might make some of the coding of the pdf and cdf more simple. Searching done with Graves' very useful utility package: library('sos') findFn("incomplete beta function") (I did't think that doing a search on "continuous Binomial" was likely to be helpful, but I tried it anyway and did not find any functions named "continuous binomial" in their help page titles.)
David Winsemius <dwinsemius at comcast.net>
on Thu, 7 May 2015 12:10:25 -0700 writes:
> On May 6, 2015, at 7:00 PM, Benjamin Tyner wrote:
>> Hi
>>
>> I'm wondering if anyone is aware of an R package implementing (i.e.,
>> providing a pdf, cdf, and/or quantile function) for the continuous
>> binomial distribution? Specifically the one characterized here:
>>
>> http://www2.math.uni-paderborn.de/fileadmin/Mathematik/AG-Indlekofer/Workshop/Satellite_meeting/ilenko.pdf
>>
>> Figured I would check here first, before attempting to code it up myself.
> I found that reading the ArXiv version of that material was easier to understand:
> http://arxiv.org/abs/1303.5990
> zipfR package has an implementation of the incomplete beta function that might make some of the coding of the pdf and cdf more simple.
Well.
To: David Winsemius <dwinsemius at comcast.net>
Subject: Re: [R] package implementing continuous binomial?
In-Reply-To: <5425134B-6AA1-4246-BCD4-D4BE4BE2391B at comcast.net>
References: <554AC75A.8070708 at gmail.com>
<5425134B-6AA1-4246-BCD4-D4BE4BE2391B at comcast.net>
X-Mailer: VM 8.2.0b under 24.3.1 (x86_64-redhat-linux-gnu)
Reply-To: Martin Maechler <maechler at stat.math.ethz.ch>
CC: maechler
--text follows this line--
Dear David,
David Winsemius <dwinsemius at comcast.net>
on Thu, 7 May 2015 12:10:25 -0700 writes:
> On May 6, 2015, at 7:00 PM, Benjamin Tyner wrote:
>> Hi
>>
>> I'm wondering if anyone is aware of an R package implementing (i.e.,
>> providing a pdf, cdf, and/or quantile function) for the continuous
>> binomial distribution? Specifically the one characterized here:
>>
>> http://www2.math.uni-paderborn.de/fileadmin/Mathematik/AG-Indlekofer/Workshop/Satellite_meeting/ilenko.pdf
>>
>> Figured I would check here first, before attempting to code it up myself.
> I found that reading the ArXiv version of that material was easier to understand:
> http://arxiv.org/abs/1303.5990
> zipfR package has an implementation of the incomplete beta function that might make some of the coding of the pdf and cdf more simple.
> Searching done with Graves' very useful utility package:
> library('sos')
> findFn("incomplete beta function")
Hmm... R's pbeta() function is a pretty good implementation
of the incomplete beta function ... as is tries to say on its
help page.
If you look closely, these functions (for incomplete gamma,
incomplete beta, and their inverses) are simple wrappers to
pgamma() and qgamma() --- sometimes "regularizing" and sometimes
not -- where regularization is simply a multiplication/division
with gamma() or beta().
I wonder why you did not find R's help page about the beta distribution
{ -> functions dgamma, pgamma, qgamma, rgamma }
which does mention the "incomplete beta function" prominently.
I don't think Benjamin should use the zipfR package just for
these functions [and even the zipfR package help page on these
can be read as saying so .. ]
In the end I wonder if the "continuous Binomial" is not just a
version of the good old Beta distribution... as indeed the
Binomial and the Beta are related in the same way
that the Gamma and the Poisson are.
Martin Maechler
ETH Zurich
> (I did't think that doing a search on "continuous Binomial" was likely to be helpful, but I tried it anyway and did not find any functions named "continuous binomial" in their help page titles.)
> --
> David Winsemius
> Alameda, CA, USA
I don't think Benjamin should use the zipfR package just for these functions [and even the zipfR package help page on these can be read as saying so .. ]
Exactly. They are simply there because it's much easier to write and read code with wrappers that parametrize the incomplete Beta and Gamma functions in the usual way, so the code looks more like the original equations it's based on.
In the end I wonder if the "continuous Binomial" is not just a version of the good old Beta distribution... as indeed the Binomial and the Beta are related in the same way that the Gamma and the Poisson are.
I thought so, too, at first and was about to suggest that. But a closer look at the slides showed that the distribution function of the continuous binomial and Poisson showed that they keep the boundary of the integral fixed (it's one of the parameters of the distribution) and vary one or two of the other parameters of the function with x. It took me a while to figure this out because the slides use an uncommon notation for incomplete Gamma and Beta functions. In particular, qgamma() and qbeta() won't give quantiles for the new distributions and one may have to implement some kind of binary search based on the distribution functions of the continuous binomial and Poisson. In the interest of self-promotion ;-), Evert (2004, Appendix A.4) spells out the connections between the incomplete Beta and Gamma function, the Beta and Gamma distributions, and the binomial and Poisson distributions in what I consider to be an accessible manner. (PDF, now at last with bookmarks: http://purl.org/stefan.evert/PUB/Evert2004phd.pdf) Best, Stefan