In [1]:
!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 ?

In [2]:
import numpy as np, pymc as pm
%matplotlib inline
In [3]:
# what pymc version is this?

pm.__version__
Out[3]:
'2.3.2'
In [4]:
np.random.seed(123456)
a = pm.Normal('a', 0, 1)
pm.MCMC([a]).sample(1000)
 [-----------------100%-----------------] 1000 of 1000 complete in 0.1 sec
In [5]:
np.random.seed(123456)
b = pm.Normal('b', 0, 1)
pm.MCMC([b]).sample(1000)
 [-----------------100%-----------------] 1000 of 1000 complete in 0.1 sec
In [6]:
np.sum((a.trace() - b.trace())**2)
Out[6]:
0.0