Monte Carlo – Should a New or Same Seed Be Used for Each Simulation Run?

monte carlorandom-generation

I'm running a Monte Carlo simulation with 200+ input variables which I'm varying with a zero mean normal distribution via a random number generator. Does it matter if I set the seed once and then perform 1,000 runs, or do I need to reset the seed on the random number generator before each of the 1,000 runs?

As a quick test, I wrote up a test in Matlab to answer this question —
Are 10,000 random numbers pulled from the same seed nearly statistically equivalent to 10,000 random numbers pulled from 10,000 different seeds?

numCases = 10000;
% Same seed
rng(42056)
Xsame = randn(numCases,1);

% Different Seeds
Xdifferent = zeros(numCases,1);
for ii = 1:10000
    rng('shuffle');
    Xdifferent(ii) = randn();
end

This produced means on the same order of magnitude, but I wasn't sure if that was good enough, or if I was missing some understanding of random number generators and Monte Carlo simulations.

Best Answer

For pseudo-random numbers, the seed is not there to "ensure randomness". In fact, it is quite the opposite: the seed is there to ensure reproducibility. You set the seed if you want to be able to run the same pseudo-random Monte Carlo experiments again and get the exact same results. For example if your scripts will be archived with an eventual publication.

It does not make sense to set the seed 10,000 times. You could set it once at the beginning of each of your 1,000 runs, but if they are quick and all run in a single loop, then setting the seed once at the beginning should be fine.

Related Question