I'm trying to solve a problem involving a Geometric Distribution with $p = 0.20$ and $x = 5$. I use the formula and R, but I get two different answers:
\begin{eqnarray*}
P(X = x) & = & p(1 – p)^{x – 1} \\
P(X = 5) & = & (0.20)(1 – 0.20)^{5 – 1} \\
& = & (0.20)(0.80)^4 \\
& = & 0.08192
\end{eqnarray*}
$${\tt dgeom(x, p) = dgeom(5, 0.2) = 0.065536}$$
Can anyone explain why this would be the case?
Best Answer
The Wikipedia article on the geometric distribution gives two different distributions
and R uses the second of these while you are using the first. This should be clear from the documentation using
?dgeom
.I have actually seen two other distributions called geometric, essentially where success and failure are swapped round.
You can easily create functions which match your desired distribution, for example with
and then for example you get