-
Notifications
You must be signed in to change notification settings - Fork 123
Description
In Chapter 16:
EDIT: I solved the problem below by deleting the following two lines from the code
with model:
start = mc.find_MAP()
and by editing the third line in the following block to remove the argument start=start from the call to mc.sample()
with model:
step = mc.Metropolis()
trace = mc.sample(100000, step=step)
Original Problem:
The code that appears here produces the following comment after mc.find_MAP()
/Library/Frameworks/Python.framework/Versions/3.6/lib/python3.6/site-packages/pymc3/tuning/starting.py:61: UserWarning: find_MAP should not be used to initialize the NUTS sampler, simply call pymc3.sample() and it will automatically initialize NUTS in a better way.
warnings.warn('find_MAP should not be used to initialize the NUTS sampler, simply call pymc3.sample() and it will automatically initialize NUTS in a better way.')
logp = -2.1562, ||grad|| = 1.6366: 100%|██████████| 8/8 [00:00<00:00, 1525.55it/s]
And the code that appears here produces a mean sigma of 0:
the command start prints
{'mean': array(3.),
'sigma_log__': array(-674.07720733),
'X': array(3.),
'sigma': array(1.78644019e-293)}
and the command trace.get_values('sigma').mean() produces
1.7864401850541627e-293
The code in the book, which is almost identical produces the same result.