Skip to content
Prev 395307 / 398502 Next

[Tagged] Re: Fwd: r-stats: Geometric Distribution

Jeff: I think you might be misdiagnosing the OP's problem; I'm not 
sure that the R parameterization is primarily intended to avoid FP 
problems, but rather is *one* possible sensible choice of definition. 
Note that the Wikipedia page on the geometric distribution: 
https://en.wikipedia.org/wiki/Geometric_distribution (obviously not an 
authoritative reference, but Wikipedia is generally very good for these 
things) gives *both* the starting-from-zero and starting-from-1 definitions.

   Sahil: this is not an error in R, it's simply a different (and 
equally sensible) choice of definition from yours. You can certainly 
write your code to do `dgeom(x-1, p)`: in fact, you could write a wrapper

my_dgeom <- function(x, ...) dgeom(x-1, ...)

so that you never have to think about it again ...

   cheers
     Ben Bolker
On 2023-10-19 3:20 a.m., Jeff Newmiller via R-help wrote: