How to change seed number in Fortran stochastic simulator code

by Angela   Last Updated October 09, 2019 14:19 PM

I'm running a Fortran code which performs a stochastic simulation of a marked Poisson cluster process. In practice, event properties (eg. time of occurrences) are generated by inversion method, i.e. by random sampling of the cumulative distribution function. Because of the Poissonian randomness, I expect each generated sequence to be different, but this is not the case. I guess the reason is that the seed for the pseudorandom number generator is the same at each simulation. I do not know Fortran, so I have no idea how to solve this issue. Here is the part of the code involved with the pseudorandom number generator, any idea?

subroutine pseud0(r)
c     generation of pseudo-random numbers
c     data ir/584287/
      data ir/574289/
      if(ir) 10,20,20
   10 ir=(ir+2147483647)+1
   20 r=float(ir)*0.4656613e-9
      subroutine pseudo(random)
c     wichmann+hill (1982) Appl. Statist 31
      data ix,iy,iz /1992,1111,1151/
      if ( ix=ix+30269
      if ( iy=iy+30307
      if ( iz=iz+30323
     &            float(iz)/30323.0,1.0)

Related Questions

Updated April 08, 2015 18:08 PM

Updated May 15, 2019 19:19 PM

Updated November 17, 2017 08:19 AM

Updated July 14, 2017 22:19 PM