michael.baudin at contrib.scilab.org
2012-Jun-28 20:49 UTC
[Rd] An extreme quantile of the geometric distribution
Hi, With R version 2.10.0 (2009-10-26) on Windows, I computed the p=1.e-20 quantile of the geometric distribution with parameter prob=0.1.> qgeom(1.e-20,0.1)[1] -1 But this is not possible, since X=0,1,2,... I guess that this might be a bug in the quantile function, which should use the log1p function, instead of the naive formula. Am I correct ? Best regards, Micha?l
peter dalgaard
2012-Jun-29 12:21 UTC
[Rd] An extreme quantile of the geometric distribution
On Jun 28, 2012, at 22:49 , <michael.baudin at contrib.scilab.org> <michael.baudin at contrib.scilab.org> wrote:> Hi, > > With R version 2.10.0 (2009-10-26) on Windows, I computed the p=1.e-20 quantile of the geometric distribution with parameter prob=0.1. > >> qgeom(1.e-20,0.1) > [1] -1 > > But this is not possible, since X=0,1,2,... > > I guess that this might be a bug in the quantile function, which should use the log1p function, instead of the naive formula. > > Am I correct ?Nope. (The source is availably, you know....). The problem is that a slight fuzz is subtracted inside ceil(....), but there's no check that the result is positive. qnbinom(...., size=1) is equivalent and does get right, by the way. -pd> > Best regards, > > Micha?l > > ______________________________________________ > R-devel at r-project.org mailing list > https://stat.ethz.ch/mailman/listinfo/r-devel-- Peter Dalgaard, Professor, Center for Statistics, Copenhagen Business School Solbjerg Plads 3, 2000 Frederiksberg, Denmark Phone: (+45)38153501 Email: pd.mes at cbs.dk Priv: PDalgd at gmail.com