Community
cancel
Showing results for 
Search instead for 
Did you mean: 
JohnNichols
Valued Contributor I
205 Views

Select a good seed for random numbers

Does anybody have an idea as to the best method of picking a random seed so I get different random numbers each time -- 

TYPE (VSL_STREAM_STATE) :: stream

      n=1000000
      nn=10

      brng=VSL_BRNG_MCG31
      method=VSL_RNG_METHOD_GAUSSIAN_ICDF
      seed=777

      a=0.0
      sigma=1.0

!     ***** Initialize *****
      errcode=vslnewstream( stream, brng,  seed )
      call CheckVslError(errcode)

!     ***** Call RNG *****
      errcode=vdrnggaussian( method, stream, n, r, a, sigma)
      call CheckVslError(errcode)
0 Kudos
4 Replies
JohnNichols
Valued Contributor I
201 Views

Capture1.PNG

JohnNichols
Valued Contributor I
200 Views

Re: This is not random from the program -- it has strong patterns - visible by eye

Pavel_D_Intel1
Employee
157 Views

Hi John,

 

Could you please clarify the problem a little bit – am I right that you don’t like a statistics of random numbers produced by MCG31M1 basic random number generator?

Actually this generator is one of the generators of the linear-congruential family that have quite simple algorithm of the state adjustment.

I can recommend to use modern generators form the Mersenne Twister family: MT19937/MT2203 or from the counter-based family: PHILOX4X32X10 / ARS5.

Best regards,
Pavel

Gennady_F_Intel
Moderator
163 Views

ok, we will ask RNG owners to look at this case and they will help to recognize the problem.


Reply