ASTM D5124-96
(Practice)Standard Practice for Testing and Use of a Random Number Generator in Lumber and Wood Products Simulation
Standard Practice for Testing and Use of a Random Number Generator in Lumber and Wood Products Simulation
SCOPE
1.1 This practice gives a minimum testing procedure of computer generation routines for the standard uniform distribution. Random observations from the standard uniform distribution, R U, range from zero to one with every value between zero and one having an equal chance of occurrence.
1.2 The tests described in this practice only support the basic use of random number generators, not their use in complex or extremely precise simulations.
1.3 Simulation details for the normal, lognormal, 2-parameter Weibull and 3-parameter Weibull probability distributions are presented.
1.4 This standard does not purport to address all of the safety concerns, if any, associated with its use. It is the responsibility of the user of this standard to establish appropriate safety and health practices and determine the applicability of regulatory limitations prior to use. See specific warning statement in 5.5.3.
General Information
Relations
Standards Content (Sample)
NOTICE: This standard has either been superseded and replaced by a new version or discontinued.
Contact ASTM International (www.astm.org) for the latest information.
Designation: D 5124 – 96
Standard Practice for
Testing and Use of a Random Number Generator in Lumber
and Wood Products Simulation
This standard is issued under the fixed designation D 5124; the number immediately following the designation indicates the year of
original adoption or, in the case of revision, the year of last revision. A number in parentheses indicates the year of last reapproval. A
superscript epsilon (e) indicates an editorial change since the last revision or reapproval.
1. Scope from the standard uniform distribution.
3.1.6 standard uniform distribution—the probability distri-
1.1 This practice gives a minimum testing procedure of
bution defined on the interval 0 to 1, with every value between
computer generation routines for the standard uniform distri-
0 and 1 having an equal chance of occurrence.
bution. Random observations from the standard uniform dis-
3.1.7 trial—a computer experiment, and in this standard the
tribution, R , range from zero to one with every value between
U
generation and statistical test of one set of random numbers.
zero and one having an equal chance of occurrence.
1.2 The tests described in this practice only support the
4. Significance and Use
basic use of random number generators, not their use in
4.1 Computer simulation is known to be a very powerful
complex or extremely precise simulations.
analytical tool for both practitioners and researchers in the area
1.3 Simulation details for the normal, lognormal,
of wood products and their applications in structural engineer-
2-parameter Weibull and 3-parameter Weibull probability dis-
ing. Complex structural systems can be analyzed by computer
tributions are presented.
with the computer generating the system components, given
1.4 This standard does not purport to address all of the
the probability distribution of each component. Frequently the
safety concerns, if any, associated with its use. It is the
components are single boards for which a compatible set of
responsibility of the user of this standard to establish appro-
strength and stiffness properties are needed. However, the
priate safety and health practices and determine the applica-
entire structural simulation process is dependent upon the
bility of regulatory limitations prior to use. See specific
adequacy of the standard uniform number generator required to
warning statement in 5.5.3.
generate random observations from prescribed probability
2. Referenced Documents distribution functions.
4.2 The technological capabilities and wide availability of
2.1 ASTM Standards:
microcomputers has encouraged their increased use for simu-
E 456 Terminology Relating to Quality and Statistics
lation studies. Tests of random number generators in com-
3. Terminology
monly available microcomputers have disclosed serious defi-
ciencies (1). Adequacy may be a function of intended end-use.
3.1 Definitions:
This practice is concerned with generation of sets of random
3.1.1 period—the number of R deviates the computer
U
numbers, as may be required for simulations of large popula-
generates before the sequence is repeated.
tions of material properties for simulation of complex struc-
3.1.2 seed value—a number required to start the computer
tures. For more demanding applications, the use of packaged
generation of random numbers. Depending upon the computer
and pretested random number generators is encouraged.
system, the seed value is internally provided or it must be user
specified. Consult the documentation for the specific random
5. Uniformity of Generated Numbers
number generator used.
5.1 Test of the Mean—The mean of the standard uniform
3.1.3 serial correlation—the statistical correlation between
distribution is ⁄2. Generate 100 sets of 1000 random uniform
ordered observations. See 5.2.2.
numbers and conduct the following statistical test on each set.
3.1.4 standard normal deviate, R —a computer generated
N
random observation from the normal probability distribution ¯
X 2 0.50
Z 5 (1)
having a mean equal to zero and standard deviation equal to
0.009129
one.
where:
3.1.5 standard uniform deviate, R —a random observation
U
Z 5 test statistic,
This practice is under the jurisdiction of ASTM Committee D-7 on Wood and
is the direct responsibility of Subcommittee D07.05 on Wood Assemblies.
Current edition approved April 10, 1996. Published June 1996. Originally
published as D 5124 – 91. Last previous edition D 5124 – 91. The boldface numbers in parentheses refer to the list of references at the end of
Annual Book of ASTM Standards, Vol 14.02. this standard.
Copyright © ASTM, 100 Barr Harbor Drive, West Conshohocken, PA 19428-2959, United States.
D 5124
¯
X 5(R /1000,
U
the standard deviation is assumed to be 1 12 , and
=
/
the summation over 1000 values is implied.
If the absolute value of Z exceeds 1.28 for more than 10 %
and less than 30 % of the trials, the random number generator
passes. If the random number generator fails the test using 100
sets, then the number of sets can be increased or the random
number generator can be rejected.
NOTE 1—The assumption of standard deviation being equal to
=1 12 may be examined with a Chi-Square test where
/
2 2
¯
~(R 2 1000 X !
U
s 5˛ (2)
where:
¯
X 5 estimated mean
s 5 estimated standard deviation of the 1000 R values,
NOTE 1—The plot resulted from using the shuffling technique on the
U
and generator which produced Fig. 1.
FIG. 2 Plotted Pairs of Random Numbers with no Detectable
the summation over 1000 values is implied.
Patterns
A significant difference between s and 1 12, suggests a
=
/
non-random generator.
5.2.2 Unless the R generator is extensively tested by
5.2 Test for Patterns in Pairs—The purpose of this visual U
stringent tests (4, 5, 6) a shuffling procedure comparable to that
test is to evaluate the tendency of pairs of deviates to form
described in 5.2.5 should be used.
patterns when plotted. Generate 2000 pairs of standard uniform
5.3 Visual Test for Uniform Distribution Conformance:
deviates. Plot each pair of deviates on an x-y Cartesian
5.3.1 The purpose of the visual test for distribution con-
coordinate system. Inspect the resulting plot for signs of
formance is to detect some odd behavior of the random number
patterns, such as “strips.” Fig. 1 is one example of “stripes”
generator beyond what might be detected by the method in 5.4.
generated by a BASIC function on a personal computer. In
It is impossible to predict the various shapes of the histograms
more than two dimensions, all generated random numbers fall
which might indicate a problem with the generator. However,
mainly on parallel hyperplanes, a fact discovered by Marsaglia
a few examples given here may alert the user of the general
(3).
form of a problem.
5.2.1 The following shuffling technique is an effective
5.3.2 Histogram Preparation—Fig. 3 is a histogram of 1000
remedy for the general problem of “stripes” and random
generated standard uniform numbers. The theoretical density
numbers falling on planes. Fill a 100-element array with
function is a horizontal dashed line crossing the ordinate at 1.0.
standard uniform deviates. Select a deviate from the array
The interval width is 0.1. The values of the ordinates for each
using the integer portion of the product of a random deviate
interval were calculated as follows:
and 100. Replace the selected deviate with a new uniform
deviate. Repeat the process until the desired number of
deviates has been generated. The plot of Fig. 2 resulted from
using the shuffling technique on the random number generator
which produced Fig. 1.
FIG. 3 Histogram of Random Numbers with Theoretical Density
FIG. 1 Plotted Pairs of Random Numbers Showing “Stripes” Function Superimposed
D 5124
N
N ) for more than 10 % and less than 30 % of the trials, the
i =
f 5 (3)
i
W 3 T
I random number generator passes. If the generator fails the tests
using 100 sets, then the number of sets can be increased or the
where:
generator can be rejected.
f 5 adjusted relative frequency,
i
5.5 Correlations Among Generated Numbers:
N 5 number observed in interval i,
i
5.5.1 The computer generated values of R must appear to
U
W 5 interval width, and
I
be random and independent. The word “appear” is used since
T 5 total number generated.
the numbers are actually being generated by a mathematical
Since the interval width, W , in this case equalled 0.1 and
I
algorithm and all such algorithms have a cycle. Provided the
1000, values were generated as follows:
numbers have the appropriate distribution function (as tested in
N
i
5.3 and 5.4) and the numbers are not serially correlated, then
f 5 (4)
i
0.1 3 1000
the generated numbers are most useful for simulation purposes.
N
i
Since the generated numbers are not truly random they are
f 5
i
often called “pseudo random.”
NOTE 2—If different sample sizes are used, bias may exist in making 5.5.2 Period—Some personal computer brands have a uni-
visual interpretations from histograms. One way to lessen this bias is to
form number generator with an extremely short period depend-
apply the Sturgess Rule (7) to determine the number of cells for the
ing upon the seed. Some machines repeat the same sequence of
histograms.
numbers after approximately 200 numbers. Depending upon
N 5 1 1 3.3~log N ! (5) the simulation application, the user must determine if the
c 10 g
period of the machine is adequate. Reference (1) is useful for
where:
evaluating the period of various random number generators.
N 5 number of histogram cells, and
c
5.5.3 Test for Lag-1 Serial Correlation—Lag-1 serial corre-
N 5 number of generated numbers.
g
lation is a measure of association between the X observation
i
5.3.3 Histogram Evaluation—The histogram of Fig. 3 has a
and the following X . Lag-2 serial correlation is a measure of
i+1
very typical appearance for a sample as large as 1000. If one
association between X and X or all pairs of observations
i i+2
would increase the sample size, less variation in f
...
Questions, Comments and Discussion
Ask us and Technical Secretary will try to provide an answer. You can facilitate discussion about the standard in here.