I'm new to PyMC and am having a little trouble getting out parameters related to my prior, for example, the mean and standard deviation.
I describe my model in a file called 'model.py' like so:
import pymc
import numpy
#constants
r_div=numpy.loadtxt("r_div", comments="#", unpack=False)
map=numpy.loadtxt("map", comments="#", delimiter=",", unpack=False)
M_star=3*10^6;
#data
n=numpy.loadtxt("n")
#priors
alpha_0=pymc.Uniform('alpha_0end',-10,10, value=0)
logA_0=pymc.Uniform('logA_0end',-10,10,value=-6.1246)
#model
@pymc.deterministic(plot=False)
def r(logA_0=logA_0,alpha_0=alpha_0,M_star=M_star,r_div=r_div):
r=r_div*numpy.exp(logA_0)*((numpy.exp(map[:,1])/M_star)**(alpha_0))
return r
#likelihood
Distribution=pymc.Poisson('Distribution',mu=r,value=n,observed=True)
And then I use the following script in ipython to run the MCMC chain:
import pymc
import model
M=pymc.MCMC(model)
M.sample(100000, burn=10000)
M.summary()
Everything seems to work until the final command M.summary() where I get the error:
AttributeError Traceback (most recent call last) in () ----> 1 M.summary()
AttributeError: 'MCMC' object has no attribute 'summary'
I am confident the chain has run successfully as the command M.trace('alpha_0end')[:] shows there are chain elements there but I can't get out any information out about the prior, such as a mean or standard deviation. I've tried different permutations of the summary command. For example: M.alpha_0end.summary()
It would be helpful to know if there is an easy way to get out the standard deviation and means of the priors.