Random variate generation methods

ISO 28640:2010 specifies methods for generating uniform and non-uniform random variates for Monte Carlo simulation purposes. Cryptographic random number generation methods are not included. ISO 28640:2010 is applicable, inter alia, by
researchers, industrial engineers or experts in operations management, who use statistical simulation,  
statisticians who need randomization related to SQC methods, statistical design of experiments or sample surveys,
applied mathematicians who plan complex optimization procedures that require the use of Monte Carlo methods, and
software engineers who implement algorithms for random variate generation.

Méthodes de génération de nombres pseudo-aléatoires

Metode generiranja naključnih spremenljivk

Ta mednarodni standard opredeljuje metode za generiranje enotnih in neenotnih naključnih spremenljivk za namene Monte Carlo simulacije. Kriptografske metode generiranja naključnih števil niso vključene. Ta mednarodni standard med drugim uporabljajo: – raziskovalci, industrijski inženirji ali strokovnjaki za upravljanje operacij, ki uporabljajo statistično simulacijo, - statistiki, ki potrebujejo doseganje naključnosti, povezano z metodami SQC, statističnim načrtovanjem eksperimentov ali vzorčnih raziskav, - uporabni matematiki, ki načrtujejo kompleksne postopke optimizacije, ki zahtevajo uporabo Monte Carlo metod,in - inženirji programske opreme, ki izvajajo algoritme za generiranje naključnih spremenljivk.

General Information

Status
Published
Publication Date
03-Jun-2010
Technical Committee
Current Stage
6060 - National Implementation/Publication (Adopted Project)
Start Date
31-May-2010
Due Date
05-Aug-2010
Completion Date
04-Jun-2010

Buy Standard

Standard
ISO 28640:2010
English language
59 pages
sale 10% off
Preview
sale 10% off
Preview
e-Library read for
1 day
Standard
ISO 28640:2010 - Random variate generation methods
English language
54 pages
sale 15% off
Preview
sale 15% off
Preview

Standards Content (Sample)


SLOVENSKI STANDARD
01-julij-2010
0HWRGHJHQHULUDQMDQDNOMXþQLKVSUHPHQOMLYN
Random variate generation methods
Méthodes de génération de nombres pseudo-aléatoires
Ta slovenski standard je istoveten z: ISO 28640:2010
ICS:
03.120.30 8SRUDEDVWDWLVWLþQLKPHWRG Application of statistical
methods
2003-01.Slovenski inštitut za standardizacijo. Razmnoževanje celote ali delov tega standarda ni dovoljeno.

INTERNATIONAL ISO
STANDARD 28640
First edition
2010-03-15
Random variate generation methods
Méthodes de génération de nombres pseudo-aléatoires

Reference number
©
ISO 2010
PDF disclaimer
This PDF file may contain embedded typefaces. In accordance with Adobe's licensing policy, this file may be printed or viewed but
shall not be edited unless the typefaces which are embedded are licensed to and installed on the computer performing the editing. In
downloading this file, parties accept therein the responsibility of not infringing Adobe's licensing policy. The ISO Central Secretariat
accepts no liability in this area.
Adobe is a trademark of Adobe Systems Incorporated.
Details of the software products used to create this PDF file can be found in the General Info relative to the file; the PDF-creation
parameters were optimized for printing. Every care has been taken to ensure that the file is suitable for use by ISO member bodies. In
the unlikely event that a problem relating to it is found, please inform the Central Secretariat at the address given below.

©  ISO 2010
All rights reserved. Unless otherwise specified, no part of this publication may be reproduced or utilized in any form or by any means,
electronic or mechanical, including photocopying and microfilm, without permission in writing from either ISO at the address below or
ISO's member body in the country of the requester.
ISO copyright office
Case postale 56 • CH-1211 Geneva 20
Tel. + 41 22 749 01 11
Fax + 41 22 749 09 47
E-mail copyright@iso.org
Web www.iso.org
Published in Switzerland
ii © ISO 2010 – All rights reserved

Contents Page
Foreword .iv
Introduction.v
1 Scope.1
2 Normative references.1
3 Terms and definitions .1
4 Symbols and mathematical binary operations.2
4.1 Symbols.2
4.2 Mathematical binary operations .2
5 Uniformly distributed pseudo-random numbers.3
5.1 General .3
5.2 M-sequence method definition .3
5.3 Pentanomial GFSR method .4
5.4 Combined Tausworthe method.4
5.5 Mersenne Twister method .5
6 Generation of random numbers from various distributions.6
6.1 Introduction.6
6.2 Uniform distribution .6
6.3 Standard beta distribution.7
6.4 Triangular distribution .8
6.5 General exponential distribution with location and scale parameters .8
6.6 Normal distribution .9
6.7 Gamma distribution.9
6.8 Weibull distribution .11
6.9 Lognormal distribution .11
6.10 Logistic distribution .11
6.11 Multivariate normal random variate generation .12
6.12 Binomial distribution.12
6.13 Poisson distribution.14
6.14 Discrete uniform distribution .14
Annex A (informative) Table of physical random numbers .16
A.1 Table of random numbers .16
A.2 Method of physical random number generation.17
Annex B (informative) Algorithm for pseudo-random number generation.18
B.1 Program code for the trinomial GFSR method.18
B.2 Program code for the pentanomial GFSR method.22
B.3 Program code for the combined Tausworthe method.28
B.4 Program code for the Mersenne Twister method .32
B.5 Linear congruential method .38
B.6 Reference examples.52
Bibliography.53

Foreword
ISO (the International Organization for Standardization) is a worldwide federation of national standards bodies
(ISO member bodies). The work of preparing International Standards is normally carried out through ISO
technical committees. Each member body interested in a subject for which a technical committee has been
established has the right to be represented on that committee. International organizations, governmental and
non-governmental, in liaison with ISO, also take part in the work. ISO collaborates closely with the
International Electrotechnical Commission (IEC) on all matters of electrotechnical standardization.
International Standards are drafted in accordance with the rules given in the ISO/IEC Directives, Part 2.
The main task of technical committees is to prepare International Standards. Draft International Standards
adopted by the technical committees are circulated to the member bodies for voting. Publication as an
International Standard requires approval by at least 75 % of the member bodies casting a vote.
Attention is drawn to the possibility that some of the elements of this document may be the subject of patent
rights. ISO shall not be held responsible for identifying any or all such patent rights.
ISO 28640 was prepared by Technical Committee ISO/TC 69, Applications of statistical methods.
This is the first edition.
iv © ISO 2010 – All rights reserved

Introduction
This International Standard specifies typical algorithms by which the users can regard the generated
numerical sequences as if they were real random variates.
Nowadays most statisticians, scientists and engineers have enough computer power at their disposal to carry
out large computer simulations, and it is important that these be based on sound pseudo-random generators.
This International Standard has been developed to help ensure that randomization, where needed, is carried
out correctly and efficiently.
Six uses of randomization can be identified in statistical standardization:
⎯ selection of a random sample;
⎯ analysis of sample data;
⎯ development of standards;
⎯ checking theoretical results;
⎯ demonstrating that a proposed procedure has the properties claimed of it;
⎯ resolving uncertainty in the statistical literature.

INTERNATIONAL STANDARD ISO 28640:2010(E)

Random variate generation methods
1 Scope
This International Standard specifies methods for generating uniform and non-uniform random variates for
Monte Carlo simulation purposes. Cryptographic random number generation methods are not included. This
International Standard is applicable, inter alia, by
⎯ researchers, industrial engineers or experts in operations management, who use statistical simulation,
⎯ statisticians who need randomization related to SQC methods, statistical design of experiments or sample
surveys,
⎯ applied mathematicians who plan complex optimization procedures that require the use of Monte Carlo
methods, and
⎯ software engineers who implement algorithms for random variate generation.
2 Normative references
The following referenced documents are indispensable for the application of this document. For dated
references, only the edition cited applies. For undated references, the latest edition of the referenced
document (including any amendments) applies.
ISO/IEC 2382-1, Information technology — Vocabulary — Part 1: Fundamental terms
ISO 3534-1, Statistics — Vocabulary and symbols — Part 1: General statistical terms and terms used in
probability
ISO 3534-2, Statistics — Vocabulary and symbols — Part 2: Applied statistics
3 Terms and definitions
For the purposes of this document, the terms and definitions given in ISO/IEC 2382-1, ISO 3534-1 and
ISO 3534-2 apply, except where redefined below.
3.1
random variate
random number
number as the realization of a specific random variable
NOTE 1 The term “random number” is often used for uniformly distributed random variate.
NOTE 2 Random numbers provided as a sequence are called a “random number sequence”.
3.2
pseudo-random number
random number (3.1) generated by an algorithm, that appears to be random
NOTE If there is no fear of misunderstanding, a pseudo-random number may simply be called a “random number”.
3.3
physical random number
random number (3.1) generated by a physical mechanism
3.4
binary random number sequence
random number (3.1) sequence consisting of zeros and ones
3.5
seed
initialization value required for pseudo-random number generation
4 Symbols and mathematical binary operations
4.1 Symbols
For the purposes of this document, the symbols given in the normative references as the latest versions of
ISO/IEC 2382-1, ISO 3534-1 and ISO 3534-2 apply, except where redefined below.
The symbols and abbreviations specifically used in this International Standard are as follows:
X integer type uniform random number
U standard uniform random number
Z normal random variate
n suffix of random number sequence
4.2 Mathematical binary operations
The mathematical binary operations specifically used in this International Standard are as follows:
mod(m; k) residue from dividing integer m by k
m ⊕ k bitwise exclusive logical disjunction of binary integers m and k
EXAMPLE 1 1 ⊕ 1 = 0
0 ⊕ 1 = 1
1 ⊕ 0 = 1
0 ⊕ 0 = 0
1010 ⊕ 1100 = 0110
2 © ISO 2010 – All rights reserved

m ∧ k bitwise logical conjunction of binary integers m and k
EXAMPLE 2 1 ∧ 1 = 1
0 ∧ 1 = 0
1 ∧ 0 = 0
0 ∧ 0 = 0
1010 ∧ 1100 = 1000
m := k replaces value m by k
m >> k k-bit right shift of binary integer m
m << k k-bit left shift of binary integer m
5 Uniformly distributed pseudo-random numbers
5.1 General
This clause provides algorithms for generating uniformly distributed pseudo-random numbers based on
M-sequence methods (see 5.2).
Annex A introduces the concept of physically generated random numbers for information.
Annex B includes C and full Basic codes for all the recommended algorithms for information. Althou
...


INTERNATIONAL ISO
STANDARD 28640
First edition
2010-03-15
Random variate generation methods
Méthodes de génération de nombres pseudo-aléatoires

Reference number
©
ISO 2010
PDF disclaimer
This PDF file may contain embedded typefaces. In accordance with Adobe's licensing policy, this file may be printed or viewed but
shall not be edited unless the typefaces which are embedded are licensed to and installed on the computer performing the editing. In
downloading this file, parties accept therein the responsibility of not infringing Adobe's licensing policy. The ISO Central Secretariat
accepts no liability in this area.
Adobe is a trademark of Adobe Systems Incorporated.
Details of the software products used to create this PDF file can be found in the General Info relative to the file; the PDF-creation
parameters were optimized for printing. Every care has been taken to ensure that the file is suitable for use by ISO member bodies. In
the unlikely event that a problem relating to it is found, please inform the Central Secretariat at the address given below.

©  ISO 2010
All rights reserved. Unless otherwise specified, no part of this publication may be reproduced or utilized in any form or by any means,
electronic or mechanical, including photocopying and microfilm, without permission in writing from either ISO at the address below or
ISO's member body in the country of the requester.
ISO copyright office
Case postale 56 • CH-1211 Geneva 20
Tel. + 41 22 749 01 11
Fax + 41 22 749 09 47
E-mail copyright@iso.org
Web www.iso.org
Published in Switzerland
ii © ISO 2010 – All rights reserved

Contents Page
Foreword .iv
Introduction.v
1 Scope.1
2 Normative references.1
3 Terms and definitions .1
4 Symbols and mathematical binary operations.2
4.1 Symbols.2
4.2 Mathematical binary operations .2
5 Uniformly distributed pseudo-random numbers.3
5.1 General .3
5.2 M-sequence method definition .3
5.3 Pentanomial GFSR method .4
5.4 Combined Tausworthe method.4
5.5 Mersenne Twister method .5
6 Generation of random numbers from various distributions.6
6.1 Introduction.6
6.2 Uniform distribution .6
6.3 Standard beta distribution.7
6.4 Triangular distribution .8
6.5 General exponential distribution with location and scale parameters .8
6.6 Normal distribution .9
6.7 Gamma distribution.9
6.8 Weibull distribution .11
6.9 Lognormal distribution .11
6.10 Logistic distribution .11
6.11 Multivariate normal random variate generation .12
6.12 Binomial distribution.12
6.13 Poisson distribution.14
6.14 Discrete uniform distribution .14
Annex A (informative) Table of physical random numbers .16
A.1 Table of random numbers .16
A.2 Method of physical random number generation.17
Annex B (informative) Algorithm for pseudo-random number generation.18
B.1 Program code for the trinomial GFSR method.18
B.2 Program code for the pentanomial GFSR method.22
B.3 Program code for the combined Tausworthe method.28
B.4 Program code for the Mersenne Twister method .32
B.5 Linear congruential method .38
B.6 Reference examples.52
Bibliography.53

Foreword
ISO (the International Organization for Standardization) is a worldwide federation of national standards bodies
(ISO member bodies). The work of preparing International Standards is normally carried out through ISO
technical committees. Each member body interested in a subject for which a technical committee has been
established has the right to be represented on that committee. International organizations, governmental and
non-governmental, in liaison with ISO, also take part in the work. ISO collaborates closely with the
International Electrotechnical Commission (IEC) on all matters of electrotechnical standardization.
International Standards are drafted in accordance with the rules given in the ISO/IEC Directives, Part 2.
The main task of technical committees is to prepare International Standards. Draft International Standards
adopted by the technical committees are circulated to the member bodies for voting. Publication as an
International Standard requires approval by at least 75 % of the member bodies casting a vote.
Attention is drawn to the possibility that some of the elements of this document may be the subject of patent
rights. ISO shall not be held responsible for identifying any or all such patent rights.
ISO 28640 was prepared by Technical Committee ISO/TC 69, Applications of statistical methods.
This is the first edition.
iv © ISO 2010 – All rights reserved

Introduction
This International Standard specifies typical algorithms by which the users can regard the generated
numerical sequences as if they were real random variates.
Nowadays most statisticians, scientists and engineers have enough computer power at their disposal to carry
out large computer simulations, and it is important that these be based on sound pseudo-random generators.
This International Standard has been developed to help ensure that randomization, where needed, is carried
out correctly and efficiently.
Six uses of randomization can be identified in statistical standardization:
⎯ selection of a random sample;
⎯ analysis of sample data;
⎯ development of standards;
⎯ checking theoretical results;
⎯ demonstrating that a proposed procedure has the properties claimed of it;
⎯ resolving uncertainty in the statistical literature.

INTERNATIONAL STANDARD ISO 28640:2010(E)

Random variate generation methods
1 Scope
This International Standard specifies methods for generating uniform and non-uniform random variates for
Monte Carlo simulation purposes. Cryptographic random number generation methods are not included. This
International Standard is applicable, inter alia, by
⎯ researchers, industrial engineers or experts in operations management, who use statistical simulation,
⎯ statisticians who need randomization related to SQC methods, statistical design of experiments or sample
surveys,
⎯ applied mathematicians who plan complex optimization procedures that require the use of Monte Carlo
methods, and
⎯ software engineers who implement algorithms for random variate generation.
2 Normative references
The following referenced documents are indispensable for the application of this document. For dated
references, only the edition cited applies. For undated references, the latest edition of the referenced
document (including any amendments) applies.
ISO/IEC 2382-1, Information technology — Vocabulary — Part 1: Fundamental terms
ISO 3534-1, Statistics — Vocabulary and symbols — Part 1: General statistical terms and terms used in
probability
ISO 3534-2, Statistics — Vocabulary and symbols — Part 2: Applied statistics
3 Terms and definitions
For the purposes of this document, the terms and definitions given in ISO/IEC 2382-1, ISO 3534-1 and
ISO 3534-2 apply, except where redefined below.
3.1
random variate
random number
number as the realization of a specific random variable
NOTE 1 The term “random number” is often used for uniformly distributed random variate.
NOTE 2 Random numbers provided as a sequence are called a “random number sequence”.
3.2
pseudo-random number
random number (3.1) generated by an algorithm, that appears to be random
NOTE If there is no fear of misunderstanding, a pseudo-random number may simply be called a “random number”.
3.3
physical random number
random number (3.1) generated by a physical mechanism
3.4
binary random number sequence
random number (3.1) sequence consisting of zeros and ones
3.5
seed
initialization value required for pseudo-random number generation
4 Symbols and mathematical binary operations
4.1 Symbols
For the purposes of this document, the symbols given in the normative references as the latest versions of
ISO/IEC 2382-1, ISO 3534-1 and ISO 3534-2 apply, except where redefined below.
The symbols and abbreviations specifically used in this International Standard are as follows:
X integer type uniform random number
U standard uniform random number
Z normal random variate
n suffix of random number sequence
4.2 Mathematical binary operations
The mathematical binary operations specifically used in this International Standard are as follows:
mod(m; k) residue from dividing integer m by k
m ⊕ k bitwise exclusive logical disjunction of binary integers m and k
EXAMPLE 1 1 ⊕ 1 = 0
0 ⊕ 1 = 1
1 ⊕ 0 = 1
0 ⊕ 0 = 0
1010 ⊕ 1100 = 0110
2 © ISO 2010 – All rights reserved

m ∧ k bitwise logical conjunction of binary integers m and k
EXAMPLE 2 1 ∧ 1 = 1
0 ∧ 1 = 0
1 ∧ 0 = 0
0 ∧ 0 = 0
1010 ∧ 1100 = 1000
m := k replaces value m by k
m >> k k-bit right shift of binary integer m
m << k k-bit left shift of binary integer m
5 Uniformly distributed pseudo-random numbers
5.1 General
This clause provides algorithms for generating uniformly distributed pseudo-random numbers based on
M-sequence methods (see 5.2).
Annex A introduces the concept of physically generated random numbers for information.
Annex B includes C and full Basic codes for all the recommended algorithms for information. Although the
linear congruential method is not recommended for complex Monte Carlo simulations, it is also included in
Annex B for information.
5.2 M-sequence method definition
a) Let p be a natural number, and c , c , ., c be specified to be 0 or 1, and define the recurrence
1 2 p − 1
formula
x = c x + c x + . + c x + x (mod 2)  (n = 1, 2, 3, .)

n + p p − 1 n + p − 1 p − 2 n + p − 2 1 n + 1 n
b) The least positive integer N such that x = x for all n is called the period of the sequence. This
n + N n
p
sequence is called an M-sequence in cases where its period is 2 − 1.
c) The polynomial
p p − 1
t + c t + . + c t + 1
p − 1 1
is called the characteristic polynomial of the above-mentioned recurrence formula.
NOTE 1 A necessary and sufficient condition for the above-mentioned recurrence formula to gene
...

Questions, Comments and Discussion

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