I have used OpenBUGS for Bayesian inference in the classroom, and I would like to switch to PyMC for practical application.
I am trying out a number of examples from the documentation, and it’s going well so far.
However, it seems like I have to wait a really long time to “initialize” the sampler. This is the simplest example I want to run:
heads = np.array([0, 0, 0, 0, 0])
with pm.Model() as model:
p = pm.Uniform('p',0,1)
likelihood = pm.Bernoulli('y',p=p, observed=heads)
posterior = pm.sample(10000,start={'p': 0.5},tune=2500)
Once I get to the loading bar, the 40K samples run pretty quickly (seconds) but it takes minutes to even get to that point.
Is there something I’m missing? Can I be setting myself up to do this faster or is it always going to be this slow?
Thanks