Newbie question: Misusing mathematical operations, or perhaps observed data for vector variables?

I have a simple example that I think should work, but seems to fail to give the expected answer: https://gist.github.com/ajfriend/e2684d72d6670f842a3e4db7bc8b8691

Each data point, i, consists of two observations: A value from a Poisson random variable with unknown mean U_i, and a value from a Poisson random variable with mean U_i*f, where f is a factor constant across observations, while U_i may vary.

I’d like to recover the factor f, but I seem to be doing something wrong. I’m new to PyMC3, so I’m guessing it’s due to some misunderstanding on my part…

Thanks for any help!

The parameter in exponential for numpy and pymc3 have different, inverted, meanings

print(np.random.exponential(10., size=1000).mean(), pm.Exponential.dist(10.).random(size=1000).mean())
(9.733009852711668, 0.10152234267299028)

So you need to change your prior

1 Like

Yup. That’s totally what it was. Thanks!