Note that there are some explanatory texts on larger screens.

plurals
  1. POR seed-sedding not "setting", results not reproducing
    text
    copied!<p>I've got a script that looks like this:</p> <pre><code>#This is the master script. It runs all other scripts. rm(list=ls()) #Run data cleaing script source("datacleaning.R") set.seed(413) #Seed pre-selected as lead author's wife's birthday (April 13th) reps=128 #Make imputated datasets source("makeimps.R") #Model selection step 1. source("model_selection.1.R") load("AIC_results.1") AIC_results #best model removed the year interaction #Model selection step 2. removed year interaction source("model_selection.2.R") load("AIC_results.2") AIC_results #all interactions pretty good. keeping this model #Final selected model: source("selectedmodel.R") </code></pre> <p>I send this master script to a supercomputing cluster; it takes about 17 hours of CPU time and 40 minutes of walltime on 32 cores. (Hence my non-reproducible example). But when I run the script, look at the results, then run it again, and look at the results again, they are slightly different. Why? I set the seed! Does the seed get reset somehow? Do I need to specify the seed inside of each script file? </p> <p>I need to increase the number of reps, because its clear that I haven't converged sufficiently. But that's a separate issue. Why are my results here not reproducing themselves and how do I fix?</p> <p>Thanks in advance.</p> <p><strong>EDIT</strong>: I'm doing the parallelization through <code>doMC</code> and <code>plyr</code>. Some light googling based on comments below turns up the fact that one can't really set a "parallel seed" using these packages. I'd need to migrate my code to <code>SNOW</code> somehow. If anyone knows a solution with <code>doMC</code> and <code>plyr</code>, I'd be grateful to learn what it is.</p>
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload