In [1]:
import numpy as np
import spacepy.plot as spp
import pymc
%matplotlib inline
In [3]:
mu = pymc.Uniform('mu', 0, 1e5)
deaths = pymc.Poisson('deaths', mu = 2.0*mu, observed=True, value=[3])
model = pymc.MCMC((mu, deaths))
In [4]:
model.sample(10000, burn=100, burn_till_tuned=True)
In [6]:
print(model.summary())
In [7]:
pymc.Matplot.plot(model)
This does not match the example very well. The example is centered around 0.9
In [8]:
mu = pymc.Gamma('mu', 3.0, 5.0)
deaths = pymc.Poisson('deaths', mu = 2.0*mu, observed=True, value=[3])
model = pymc.MCMC((mu, deaths))
model.sample(10000, burn=100, burn_till_tuned=True)
print(model.summary())
pymc.Matplot.plot(model)
This matches the example quite well, figure 2.5, page 46.
In [ ]: