Bookmark and Share

Notice: On March 31, it was announced that Statalist is moving from an email list to a forum. The old list will shut down on April 23, and its replacement, statalist.org is already up and running.


[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

st: Default Seed of Stata 12


From   <S.Jenkins@lse.ac.uk>
To   <statalist@hsphsun2.harvard.edu>
Subject   st: Default Seed of Stata 12
Date   Fri, 26 Oct 2012 19:25:33 +0100

Bill Gould wrote a very informative post about Stata's seed on Wed 24
Oct.

In part, he wrote:
==========================
Think of the random-number generator as producing an infinitely long
sequence of states:
 
------------------------------------------------------------------------
-
    state0 -> state1 -> state2 -> ... -> state{2^124} -> state0 ->
state1 ...

    where, 

       state0 = X075bcd151f123bb5159a55e50022865700043e55, 

       state1 = X5b15215854f24767556efaba82801d9b0004330a, 

    and so on, 

    and where the i-th pseudo random number is given by g(state{i}). 
 
------------------------------------------------------------------------
-

The sequence may be infinitely long, but it repeats.  The period is
approximately 2^124 in the case of KISS.

The easy-to-type 32-bit seed provides 2^32 entry points into this
sequence

   ---------------------------------------------------------------------
    state0 -> state1 -> ... -> state{2^96) -> ... -> state{2^124) -> ...
      |                             |                     |
  123456789                     ????????               ??????
   ---------------------------------------------------------------------
========================

Given the "infinitely long" sequence which repeats, and Bill's reference
to "entry points", does it ever matter what number one chooses to be the
initial seed and hence enters the sequence?

I note that the default Stata 32-bit seed is "123456789", which is 9
digits and an odd number. Are there potentially adverse consequences of
setting a 32-bit seed using an even number? Or using a seed that is less
than some critical number of digits in length?  E.g. is "1" or "20" as
good as "123456789" or "987654321"?

Many people, including me, appear to use a number with -set seed- that
has a relatively large number of digits and is an odd number -- but I
wonder if this is simply custom and practice, or whether there is a
rationale. Or is any number as good as another as an entry point to the
sequence?  I searched the web for answers a while ago and did not find
answers.


Stephen
------------------
Professor Stephen P. Jenkins <s.jenkins@lse.ac.uk>
Department of Social Policy and STICERD
London School of Economics and Political Science
Houghton Street, London WC2A 2AE, UK
Tel: +44(0)20 7955 6527
Changing Fortunes: Income Mobility and Poverty Dynamics in Britain, OUP
2011, http://ukcatalogue.oup.com/product/9780199226436.do
Survival Analysis Using Stata:
http://www.iser.essex.ac.uk/survival-analysis
Downloadable papers and software: http://ideas.repec.org/e/pje7.html



Please access the attached hyperlink for an important electronic communications disclaimer: http://lse.ac.uk/emailDisclaimer

<<winmail.dat>>



© Copyright 1996–2014 StataCorp LP   |   Terms of use   |   Privacy   |   Contact us   |   Site index