Title
truernd -- Generate true random numbers
Syntax
Display information about the program
truernd
Fill the specified matrix with random values
truernd , matrix(matrixname)
Generate dataset (variables) with random values
truernd , count(integer) [n(integer) min(integer) max(integer) clear]
Recheck quota limits after you purchase an additional quota
truernd recheck
Description
truernd provides an interface to the true random number service provided by the random.org website created by Mads Haahr. The random.org web service samples atmospheric noise via radio tuned to an unused broadcasting frequency together with a skew correction algorithm due to John von Neumann. For details see RANDOM.ORG. Use of this command requires internet connection. Requesting random numbers via this command does not affect the random number generator of Stata itself (current seed).
Note that rechecking the quota limits will not reset or extend your quotas. It will resend the query to the service website and react accordingly. At the moment of this writing the quotas are updated according to the following rule: every day, shortly after midnight UTC, all quotas with less than 1,000,000 bits receive a free top-up of 200,000 bits.
Options
options Description ------------------------------------------------------------------------- Matrix
matrix(matrixname) name of an existing matrix to fill-in with random numbers
Dataset
count(#) number of observations in the dataset
n(#) number of variables in the dataset; default is n(1)
min(#) minimum of random values (inclusive); default is min(0)
max(#) maximum of random values (not inclusive); default is n(100)
clear specifies that it is okay to replace the data in memory, even though the current data have not been saved to disk.
Error codes and limits
111 Syntax error
990 Service responded with an error message
991 Failed to retrieve random numbers from the server
992 Quota exhausted
993 Quota exhausted. Must wait before rechecking
994 Matrix too large (rows*cols>10,000)
995 Too many random values requested (count*n>10,000)
996 Inconsistent parameters max and min (max<min)
997 Parameter max is out of range [-1e9,1e9]
998 Parameter min is out of range [-1e9,1e9]
999 Too many random variables requested (n>10,000)
For other codes see Stata manual
Delays
truernd conforms to the guidelines for automated clients as described on the website. Mandatory delays between requests and during the cooling off periods are enforced. It is not recommended for users to attempt to override these protective mechanisms. The website provides possibility to purchase additional quota once the limit is reached: http://www.random.org/quota/
min interval between requests for random numbers: 30 seconds (program waits for remaining time during this mandatory interval)
min interval between requests for quota when quota is negative: 10 minutes (error 993 is issued during this mandatory interval)
Examples
--------------------------------------------------------------------------- Setup: create a 6x8 matrix M of missing values . matrix M=J(6,8,.)
Fill-in matrix M with random numbers . truernd , matrix(M)
Show the content of matrix M . matrix list M
--------------------------------------------------------------------------- Create a dataset with 10 observations of 4 random variables v1..v4 . truernd , count(10) n(4)
Create another dataset with 50 observations of 7 random variables v1..v7 each in the range [50;80) discarding current dataset in memory . truernd , count(50) n(7) min(50) max(80) clear ---------------------------------------------------------------------------
Author
Stata module to interface RANDOM.ORG
Sergiy Radyakin, Economist Research Department The World Bank - Washington DC, USA sradyakin@worldbank.org
Creator of RANDOM.ORG
Mads Haahr School of Computer Science and Statistics Trinity College - Dublin 2, Ireland