ASTM D5124-96(2018)
(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
SIGNIFICANCE AND USE
4.1 Computer simulation is known to be a very powerful analytical tool for both practitioners and researchers in the area of wood products and their applications in structural engineering. Complex structural systems can be analyzed by computer with the computer generating the system components, given the probability distribution of each component. Frequently the components are single boards for which a compatible set of strength and stiffness properties are needed. However, the entire structural simulation process is dependent upon the adequacy of the standard uniform number generator required to generate random observations from prescribed probability distribution functions.
4.2 The technological capabilities and wide availability of microcomputers has encouraged their increased use for simulation studies. Tests of random number generators in commonly available microcomputers have disclosed serious deficiencies (1).3 Adequacy may be a function of intended end-use. This practice is concerned with generation of sets of random numbers, as may be required for simulations of large populations of material properties for simulation of complex structures. For more demanding applications, the use of packaged and pretested random number generators is encouraged.
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, RU, 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, health, and environmental practices and determine the applicability of regulatory limitations prior to use.See specific warning statement in 5.5.3.
1.5 This international standard was developed in accordance with internationally recognized principles on standardization established in the Decision on Principles for the Development of International Standards, Guides and Recommendations issued by the World Trade Organization Technical Barriers to Trade (TBT) Committee.
General Information
Buy Standard
Standards Content (Sample)
NOTICE: This standard has either been superseded and replaced by a new version or withdrawn.
Contact ASTM International (www.astm.org) for the latest information
Designation: D5124 − 96 (Reapproved 2018)
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 D5124; the number immediately following the designation indicates the year of
original adoption or, in the case of revision, the year of last revision.Anumber in parentheses indicates the year of last reapproval.A
superscript epsilon (´) indicates an editorial change since the last revision or reapproval.
1. Scope 3.1.2 seed value—a number required to start the computer
generation of random numbers. Depending upon the computer
1.1 This practice gives a minimum testing procedure of
system, the seed value is internally provided or it must be user
computer generation routines for the standard uniform distri-
specified. Consult the documentation for the specific random
bution. Random observations from the standard uniform
number generator used.
distribution, R , range from zero to one with every value
U
3.1.3 serial correlation—the statistical correlation between
between zero and one having an equal chance of occurrence.
ordered observations. See 5.2.2.
1.2 The tests described in this practice only support the
3.1.4 standard normal deviate, R —a computer generated
basic use of random number generators, not their use in
N
random observation from the normal probability distribution
complex or extremely precise simulations.
having a mean equal to zero and standard deviation equal to
1.3 Simulation details for the normal, lognormal,
one.
2-parameter Weibull and 3-parameter Weibull probability dis-
3.1.5 standard uniform deviate, R —a random observation
U
tributions are presented.
from the standard uniform distribution.
1.4 This standard does not purport to address all of the
3.1.6 standard uniform distribution—the probability distri-
safety concerns, if any, associated with its use. It is the
bution defined on the interval 0 to 1, with every value between
responsibility of the user of this standard to establish appro-
0 and 1 having an equal chance of occurrence.
priate safety, health, and environmental practices and deter-
mine the applicability of regulatory limitations prior to use.See 3.1.7 trial—a computer experiment, and in this standard the
specific warning statement in 5.5.3. generation and statistical test of one set of random numbers.
1.5 This international standard was developed in accor-
4. Significance and Use
dance with internationally recognized principles on standard-
ization established in the Decision on Principles for the
4.1 Computer simulation is known to be a very powerful
Development of International Standards, Guides and Recom-
analyticaltoolforbothpractitionersandresearchersinthearea
mendations issued by the World Trade Organization Technical
of wood products and their applications in structural engineer-
Barriers to Trade (TBT) Committee.
ing. Complex structural systems can be analyzed by computer
with the computer generating the system components, given
2. Referenced Documents
the probability distribution of each component. Frequently the
2.1 ASTM Standards: components are single boards for which a compatible set of
E456Terminology Relating to Quality and Statistics
strength and stiffness properties are needed. However, the
entire structural simulation process is dependent upon the
3. Terminology
adequacyofthestandarduniformnumbergeneratorrequiredto
3.1 Definitions: generate random observations from prescribed probability
3.1.1 period—the number of R deviates the computer distribution functions.
U
generates before the sequence is repeated.
4.2 The technological capabilities and wide availability of
microcomputers has encouraged their increased use for simu-
This practice is under the jurisdiction ofASTM Committee D07 on Wood and
lation studies. Tests of random number generators in com-
is the direct responsibility of Subcommittee D07.05 on Wood Assemblies.
monly available microcomputers have disclosed serious defi-
Current edition approved July 1, 2018. Published August 2018. Originally
ciencies (1). Adequacymaybeafunctionofintendedend-use.
approved in 1991. Last previous edition approved in 2013 as D5124–96(2013).
This practice is concerned with generation of sets of random
DOI: 10.1520/D5124-96R18.
For referenced ASTM standards, visit the ASTM website, www.astm.org, or
contact ASTM Customer Service at service@astm.org. For Annual Book of ASTM
Standards volume information, refer to the standard’s Document Summary page on Theboldfacenumbersinparenthesesrefertothelistofreferencesattheendof
the ASTM website. this standard.
Copyright © ASTM International, 100 Barr Harbor Drive, PO Box C700, West Conshohocken, PA 19428-2959. United States
D5124 − 96 (2018)
numbers, as may be required for simulations of large popula-
tions of material properties for simulation of complex struc-
tures. For more demanding applications, the use of packaged
and pretested random number generators is encouraged.
5. Uniformity of Generated Numbers
5.1 Test of the Mean—The mean of the standard uniform
distribution is ⁄2 . Generate 100 sets of 1000 random uniform
numbers and conduct the following statistical test on each set.
¯
X 20.50
Z 5 (1)
0.009129
where:
Z = test statistic,
¯
X = ∑R /1000,
U
FIG. 1 Plotted Pairs of Random Numbers Showing “Stripes”
the standard deviation is assumed to beŒ , 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
Œ
may be examined with a Chi-Square test where
2 ¯ 2
~ R 21000 X !
( U
s 5Œ (2)
where:
¯
X = estimated mean
s = estimatedstandarddeviationofthe1000R values,and
NOTE 1—The plot resulted from using the shuffling technique on the
U
generator which produced Fig. 1.
the summation over 1000 values is implied.
FIG. 2 Plotted Pairs of Random Numbers with no Detectable Pat-
terns
A significant difference between s and , suggests a
Œ
non-random generator.
5.2 Test for Patterns in Pairs—The purpose of this visual
test is to evaluate the tendency of pairs of deviates to form
5.2.2 Unless the R generator is extensively tested by
U
patternswhenplotted.Generate2000pairsofstandarduniform
stringenttests (3, 4, 5)ashufflingprocedurecomparabletothat
deviates. Plot each pair of deviates on an x-y Cartesian
described in 5.2.5 should be used.
coordinate system. Inspect the resulting plot for signs of
5.3 Visual Test for Uniform Distribution Conformance:
patterns, such as “strips.” Fig. 1 is one example of “stripes”
5.3.1 The purpose of the visual test for distribution confor-
generated by a BASIC function on a personal computer. In
mance is to detect some odd behavior of the random number
more than two dimensions, all generated random numbers fall
generatorbeyondwhatmightbedetectedbythemethodin5.4.
mainlyonparallelhyperplanes,afactdiscoveredbyMarsaglia
It is impossible to predict the various shapes of the histograms
(2).
which might indicate a problem with the generator. However,
5.2.1 The following shuffling technique is an effective
a few examples given here may alert the user of the general
remedy for the general problem of “stripes” and random
form of a problem.
numbers falling on planes. Fill a 100-element array with
5.3.2 Histogram Preparation—Fig.3isahistogramof1000
standard uniform deviates. Select a deviate from the array
generated standard uniform numbers. The theoretical density
using the integer portion of the product of a random deviate
functionisahorizontaldashedlinecrossingtheordinateat1.0.
and 100. Replace the selected deviate with a new uniform
The interval width is 0.1. The values of the ordinates for each
deviate. Repeat the process until the desired number of
interval were calculated as follows:
deviates has been generated. The plot of Fig. 2 resulted from
using the shuffling technique on the random number generator N
i
f 5 (3)
i
which produced Fig. 1. W 3T
I
D5124 − 96 (2018)
random numbers to the standard uniform distribution. The KS
test should be conducted on 100 sets of generated random
number data each containing 1000 observations.
5.4.2 Kolmogorov-Smirnov Test—Generate the R numbers
U
and store in an array. Rank the data from smallest to largest.
Calculate the following:
i
D 5max 2 X i 51, N (6)
F G ~ !
n i
N
i 21
D 5max X 2 i 51, N
F G
n i
N
1 2
D 5max D , D
@ #
n n n
where:
N = sample size, (1000),
th
X =i value of the ranked array, and
I
D = Kolmogorov-Smirnov (K-S) test statistic.
n
Forthetestin5.4, Nequals1000. X isthesmallestvalueof
the ranked array, X is the second smallest and so on. D as
FIG. 3 Histogram of Random Numbers with Theoretical Density
2 n
Function Superimposed calculated is the largest vertical distance between the sample
density function and the hypothesized distribution, in this case
the standard uniform distribution. If D is greater than
n
where:
~1.07/=N!
f = adjusted relative frequency,
I
for more than 10% and less than 30% of the trials, the ran-
N = number observed in interval i,
I
dom number generator passes. If the generator fails the tests
W = interval width, and
I
using 100 sets, then the number of sets can be increased or
T = total number generated.
the generator can be rejected.
Since the interval width, W, in this case equalled 0.1 and
I
5.5 Correlations Among Generated Numbers:
1000, values were generated as follows:
5.5.1 The computer generated values of R must appear to
U
N
i
be random and independent. The word “appear” is used since
f 5 (4)
i
0.1 31000
the numbers are actually being generated by a mathematical
algorithm and all such algorithms have a cycle. Provided the
N
i
f 5 numbershavetheappropriatedistributionfunction(astestedin
i
5.3 and 5.4) and the numbers are not serially correlated, then
NOTE 2—If different sample sizes are used, bias may exist in making
thegeneratednumbersaremostusefulforsimulationpurposes.
visual interpretations from histograms. One way to lessen this bias is to
apply the Sturgess Rule (6)
...
This document is not an ASTM standard and is intended only to provide the user of an ASTM standard an indication of what changes have been made to the previous version. Because
it may not be technically possible to adequately depict all changes accurately, ASTM recommends that users consult prior editions as appropriate. In all cases only the current version
of the standard as published by ASTM is to be considered the official document.
Designation: D5124 − 96 (Reapproved 2013) D5124 − 96 (Reapproved 2018)
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 D5124; 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 (´) indicates an editorial change since the last revision or reapproval.
1. 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 , range from zero to one with every value between zero and one
U
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 safety, health, and healthenvironmental practices and determine the
applicability of regulatory limitations prior to use.See specific warning statement in 5.5.3.
1.5 This international standard was developed in accordance with internationally recognized principles on standardization
established in the Decision on Principles for the Development of International Standards, Guides and Recommendations issued
by the World Trade Organization Technical Barriers to Trade (TBT) Committee.
2. Referenced Documents
2.1 ASTM Standards:
E456 Terminology Relating to Quality and Statistics
3. Terminology
3.1 Definitions:
3.1.1 period—the number of R deviates the computer generates before the sequence is repeated.
U
3.1.2 seed value—a number required to start the computer generation of random numbers. Depending upon the computer
system, the seed value is internally provided or it must be user specified. Consult the documentation for the specific random
number generator used.
3.1.3 serial correlation—the statistical correlation between ordered observations. See 5.2.2.
3.1.4 standard normal deviate, R —a computer generated random observation from the normal probability distribution having
N
a mean equal to zero and standard deviation equal to one.
3.1.5 standard uniform deviate, R —a random observation from the standard uniform distribution.
U
3.1.6 standard uniform distribution—the probability distribution defined on the interval 0 to 1, with every value between 0 and
1 having an equal chance of occurrence.
3.1.7 trial—a computer experiment, and in this standard the generation and statistical test of one set of random numbers.
4. Significance and Use
4.1 Computer simulation is known to be a very powerful analytical tool for both practitioners and researchers in the area of
wood products and their applications in structural engineering. Complex structural systems can be analyzed by computer with the
This practice is under the jurisdiction of ASTM Committee D07 on Wood and is the direct responsibility of Subcommittee D07.05 on Wood Assemblies.
Current edition approved April 1, 2013July 1, 2018. Published April 2013August 2018. Originally approved in 1991. Last previous edition approved in 20072013 as
D5124 – 96 (2007).(2013). DOI: 10.1520/D5124-96R13.10.1520/D5124-96R18.
For referenced ASTM standards, visit the ASTM website, www.astm.org, or contact ASTM Customer Service at service@astm.org. For Annual Book of ASTM Standards
volume information, refer to the standard’s Document Summary page on the ASTM website.
Copyright © ASTM International, 100 Barr Harbor Drive, PO Box C700, West Conshohocken, PA 19428-2959. United States
D5124 − 96 (2018)
computer generating the system components, given the probability distribution of each component. Frequently the components are
single boards for which a compatible set of strength and stiffness properties are needed. However, the entire structural simulation
process is dependent upon the adequacy of the standard uniform number generator required to generate random observations from
prescribed probability distribution functions.
4.2 The technological capabilities and wide availability of microcomputers has encouraged their increased use for simulation
studies. Tests of random number generators in commonly available microcomputers have disclosed serious deficiencies (1).
Adequacy may be a function of intended end-use. This practice is concerned with generation of sets of random numbers, as may
be required for simulations of large populations of material properties for simulation of complex structures. For more demanding
applications, the use of packaged and pretested random number generators is encouraged.
5. Uniformity of Generated Numbers
5.1 Test of the Mean—The mean of the standard uniform distribution is ⁄2 . Generate 100 sets of 1000 random uniform numbers
and conduct the following statistical test on each set.
¯
X 2 0.50
Z 5 (1)
0.009129
where:
Z = test statistic,
X¯ = ∑R /1000,
U
the standard deviation is assumed to be , 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 may be examined with a Chi-Square test where
Œ
2 ¯ 2
~ R 2 1000 X !
( U
Œ
s 5 (2)
where:
X¯ = estimated mean
s = estimated standard deviation of the 1000 R values, and
U
the summation over 1000 values is implied.
A significant difference between s and , suggests a non-random generator.
Œ
5.2 Test for Patterns in Pairs—The purpose of this visual test is to evaluate the tendency of pairs of deviates to form patterns
when plotted. Generate 2000 pairs of standard uniform deviates. Plot each pair of deviates on an x-y Cartesian coordinate system.
Inspect the resulting plot for signs of patterns, such as “strips.” Fig. 1 is one example of “stripes” generated by a BASIC function
on a personal computer. In more than two dimensions, all generated random numbers fall mainly on parallel hyperplanes, a fact
discovered by Marsaglia (2).
5.2.1 The following shuffling technique is an effective remedy for the general problem of “stripes” and random numbers falling
on planes. Fill a 100-element array with standard uniform deviates. Select a deviate from the array using the integer portion of the
product of a random deviate 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.
5.2.2 Unless the R generator is extensively tested by stringent tests (3, 4, 5) a shuffling procedure comparable to that described
U
in 5.2.5 should be used.
5.3 Visual Test for Uniform Distribution Conformance:
5.3.1 The purpose of the visual test for distribution conformance is to detect some odd behavior of the random number generator
beyond what might be detected by the method in 5.4. It is impossible to predict the various shapes of the histograms which might
indicate a problem with the generator. However, a few examples given here may alert the user of the general form of a problem.
The boldface numbers in parentheses refer to the list of references at the end of this standard.
D5124 − 96 (2018)
FIG. 1 Plotted Pairs of Random Numbers Showing “Stripes”
NOTE 1—The plot resulted from using the shuffling technique on the generator which produced Fig. 1.
FIG. 2 Plotted Pairs of Random Numbers with no Detectable Patterns
5.3.2 Histogram Preparation—Fig. 3 is a histogram of 1000 generated standard uniform numbers. The theoretical density
FIG. 3 Histogram of Random Numbers with Theoretical Density Function Superimposed
D5124 − 96 (2018)
function is a horizontal dashed line crossing the ordinate at 1.0. The interval width is 0.1. The values of the ordinates for each
interval were calculated as follows:
N
i
f 5 (3)
i
W 3T
I
where:
f = adjusted relative frequency,
I
N = number observed in interval i,
I
W = interval width, and
I
T = total number generated.
Since the interval width, W , in this case equalled 0.1 and 1000, values were generated as follows:
I
N
i
f 5 (4)
i
0.1 31000
N
i
f 5
i
NOTE 2—If different sample sizes are used, bias may exist in making visual interpretations from histograms. One way to lessen this bias is to apply
the Sturgess Rule (6) to determine the number of cells for the histograms.
N 5 113.3 log N (5)
~ !
c 10 g
where:
N = number of histogram cells, and
c
N = number of generated numbers.
g
5.3.3 Histogram Evaluation—The histogram of Fig. 3 has a very typical appearance for a sample as large as 1000. If one would
increase the sample size, less variation in f is expected. On the contrary, by decreasing the sample size to perhaps 50, tremendous
i
variation in f can be expected. A problem would be evidenced, if for a sample size of 1000, one of the following occurs: (1) if
i
f equalled zero or near zero for one class interval, (2) if one class interval had an f value 50 % greater than any other interval,
i i
or (3) if there is any noticeable trend in the f value such as an increase in f from left to right, a decrease, or whatever. The f values
i i i
should vary about 1.0 in a random fashion. The data must span the entire range from 0 to 1.
5.4 Formal Test of Distribution Conformance:
5.4.1 The Kolmogorov-Smirnov (KS) goodness-of-fit test given in Ref (4) should be used to test the conformance of the random
numbers to the standard uniform distribution. The KS test should be conducted on 100 sets of generated random number data each
containing 1000 observations.
5.4.2 Kolmogorov-Smirnov Test—Generate the R numbers and store in an array. Rank the data from smallest to largest.
U
Calculat
...










Questions, Comments and Discussion
Ask us and Technical Secretary will try to provide an answer. You can facilitate discussion about the standard in here.