I am following an example from the book Python for Finance.
It is about Bayesian Regression.
With PyMC 3.0, I can run the following code:
with pm.Model() as model:
alpha = pm.Normal('alpha',mu=0.,sd=20.)
beta = pm.Normal('beta',mu=0.,sd=20.)
sigma = pm.Uniform('sigma',lower=0.,upper=10.)
# define linear regression
y_est = alpha + beta * x
# define likelihood
likehood = pm.Normal('y',mu=y_est,sd=sigma,observed=y)
# inference
start = pm.find_MAP()
# find starting value by optimization
step = pm.NUTS(state=start)
# instantiate MCMC sampling algorithm
trace = pm.sample(100,step,start=start,progressbar=False)
# draw 100 posterior samples using NUTS sampling
However, when i updata to PyMC3.1, there is no such a keyword argument ‘state’ in pm.NUTS.
what do I need to do to modify the code ?
Thanks in advance.