!date
Wed May 14 07:19:24 PDT 2014
If pymc.numpy.random.seed(0) guarantee the same random number sequence to initialize a stochastic variable (say a Uniform distribution), why does its posterior samples (from trace plot) don't have the same values for multiple runs with the same seed=0 ?
import numpy as np, pymc as pm
%matplotlib inline
# what pymc version is this?
pm.__version__
'2.3.2'
np.random.seed(123456)
a = pm.Normal('a', 0, 1)
pm.MCMC([a]).sample(1000)
[-----------------100%-----------------] 1000 of 1000 complete in 0.1 sec
np.random.seed(123456)
b = pm.Normal('b', 0, 1)
pm.MCMC([b]).sample(1000)
[-----------------100%-----------------] 1000 of 1000 complete in 0.1 sec
np.sum((a.trace() - b.trace())**2)
0.0