Hi all,
I am just starting to explore using PyMC, and love it so far.
I have a question regarding the geometric distribution used in PyMC
vs. numpy. Am I correct in thinking that both of these are shifted
geometric distributions, i.e., with support {1, 2, ...} and a PMF of:
Pr(k|p) = (1-p)^(k-1) p
and an expectation of:
E[k] = 1/p
?
The documentation for PyMC (
http://pymc.googlecode.com/svn/doc/
distributions.html) says that its geometric likelihood (which I assume
underlies its Geometric stochastic class) is also shifted with support
{1,2,...}.
The reason that I ask is that this post describing calculation of
Bayes Factors of a geometric vs. poisson model:
http://stronginference.com/post/bayes-factors-pymc
calculates the probability parameter `p` from the mean `mu` as if the
distribution was unshifted (i.e., with support {0, 1, 2,...}; Pr(k|p)
= (1-p)^(k-1) p; E[k] = E[k] = (1 - p) / p):
p = Lambda('p', lambda mu=mu: 1/(1+mu))
I am trying to replicate this example in a slight different context,
with observed data simulated using `numpy.random.geometric` and was
wondering if the above is correct or whether or not I should actually
be using:
p = Lambda('p', lambda mu=mu: 1/mu)