[R] Fwd: r-stats: Geometric Distribution
Ivan Krylov
kry|ov@r00t @end|ng |rom gm@||@com
Tue Oct 17 15:09:34 CEST 2023
В Tue, 17 Oct 2023 12:12:05 +0530
Sahil Sharma <sahilsharmahimalaya using gmail.com> пишет:
> The original formula for Geometric Distribution PDF is
> *((1-p)^x-1)*P*. However, the current r function *dgeom(x, p)* is
> doing this: *((1-p)^x)*P, *it is not reducing 1 from x.
Your definition is valid for integer 'x' starting from 1. ('x'th trial
is the first success.)
The definition in help(dgeom):
>> p(x) = p (1-p)^x
>> for x = 0, 1, 2, ..., 0 < p <= 1.
...is valid for integer x starting from 0. ('x' failures until the
first success.)
They are equivalent, but they use the name 'x' for two subtly different
things.
Thank you for giving attention to this and best of luck in your future
research!
--
Best regards,
Ivan
More information about the R-help
mailing list