1
$\begingroup$

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 ?

Is there any internal random seed encoded in the pymc module ? Or, this is cause by the assigned "probability α" ? ( See http://en.wikipedia.org/wiki/Metropolis%E2%80%93Hastings_algorithm#Intuition )

Have anyone encountered this problem ? Is this related to the older version of pymc that I'm using ? Currently, I'm using pymc version 2.2 because failed to install version 3 to my computer with windows 7 platform.

$\endgroup$

closed as off-topic by Tim Oct 17 at 8:11

This question appears to be off-topic. The users who voted to close gave this specific reason:

  • "This question appears to be off-topic because EITHER it is not about statistics, machine learning, data analysis, data mining, or data visualization, OR it focuses on programming, debugging, or performing routine operations within a statistical computing platform. If the latter, you could try the support links we maintain." – Tim
If this question can be reworded to fit the rules in the help center, please edit the question.

  • $\begingroup$ Are you sure you're reseting the seed every time you run the sampler? $\endgroup$ – juliohm Apr 28 '14 at 15:49
  • $\begingroup$ @juliohm, I'm not sure of what you meant by re-setting the seed. The see is always set to 0 for every new run. $\endgroup$ – user3460430 Apr 28 '14 at 17:02
  • $\begingroup$ Ok, just to be sure you know the seed must be reset for results to be reproducible. $\endgroup$ – juliohm Apr 28 '14 at 19:40
  • $\begingroup$ @juliohm, Have you encountered cases like mine problem? I mean have you check the trace plots if they are the same in several different runs but with same seed ? $\endgroup$ – user3460430 Apr 30 '14 at 14:37
  • $\begingroup$ I started using PyMC in a project, and then switched gears to another package. I had no opportunity to check reproducibility issues at that time. $\endgroup$ – juliohm Apr 30 '14 at 23:21
1
$\begingroup$

I think this is related to the old version you are using. Setting the numpy random seed should make the PyMC computations reproducible. In my simple example notebook here, this is the case.

I used PyMC 2.3.2 to check this, so it could be that upgrading your version to 2.3 will sort things out. If you upgrade and still get different results, then I think you have discovered a bug, and the PyMC developers would probably appreciate you filing an issue with a minimal example of how to reproduce it in their github repository.

$\endgroup$

Not the answer you're looking for? Browse other questions tagged or ask your own question.