# Dataplot: Random Numbers

Introduction The generation of random numbers in Dataplot is performed via subcommands under the LET command. For example,
LET X = UNIFORM RANDOM NUMBERS FOR I = 1 1 25
LET Y = NORMAL RUNDOM NUMBERS FOR I = 1 1 100

LET GAMMA = 2.5
LET Z = WEIBULL RUNDOM NUMBERS FOR I = 1 1 100

Specify Any Needed Shape Parameters The output from the random number generation is always a variable (never a parameter or function). Random numbers can be generated from a variety of distributions. Some distributions represent a family of distributions. In this case, one or more shape parameters need to be specified (via the LET command) before generating the random numbers.
SEED Command The SEED command is used to specify the seed for the random number generator.
Different Uniform Generators Available Random number generators for non-uniform distributions are ultimately built on a uniform random number generator. Dataplot now supports a number of alternatives for the uniform random number generator. See the SET RANDOM NUMBER GENERATOR for details.
Location and Scale Parameters Random numbers are generated for the standard form of a distribution. If random numbers have been generated in the variable Y for the standard form of a distribution with location parameter M and scale parameter S, the random numbers for the general form of the distribution can be generated with the following command
LET Y2 = M + S*Y
Note that the location and scale parameters do not neccessarily correspond to the mean and standard deviation (they do for the normal distribution, but not in general).

# Available Random Number Generators

Distributions Requiring No Shape Parameters The following table list the distributions for which no shape parameter is required.

 LET Y = NORMAL RANDOM NUMBERS FOR ... generate standard normal (N(0,1)) random numbers LET Y = UNIFORM RANDOM NUMBERS FOR ... generate uniform random numbers in the interval (0,1) LET Y = LOGISTIC RANDOM NUMBERS FOR ... generate logistic random numbers LET Y = DOUBLE EXPONENTIAL RANDOM NUMBERS FOR ... generate double exponential random numbers LET Y = CAUCHY RANDOM NUMBERS FOR ... generate Cauchy random numbers LET Y = SEMI-CIRCULAR RANDOM NUMBERS FOR ... generate semi-circular random numbers LET Y = TRIANGULAR RANDOM NUMBERS FOR ... generate triangular random numbers LET Y = LOGNORMAL RANDOM NUMBERS FOR ... generate lognormal random numbers LET Y = HALFNORMAL RANDOM NUMBERS FOR ... generate halfnormal random numbers LET Y = EXPONENTIAL RANDOM NUMBERS FOR ... generate exponential random numbers LET Y = EXTREME VALUE TYPE 1 RANDOM NUMBERS FOR ... generate extreme value type 1 random numbers LET Y = GUMBEL RANDOM NUMBERS FOR ... generate extreme value type 1 random numbers LET Y = HALF CAUCHY RANDOM NUMBERS FOR ... generate half-Cauchy random numbers LET Y = COSINE RANDOM NUMBERS FOR ... generate cosine random numbers LET Y = ANGLIT RANDOM NUMBERS FOR ... generate anglit random numbers LET Y = ARCSIN RANDOM NUMBERS FOR ... generate arcsin random numbers LET Y = HYPERBOLIC SECANT RANDOM NUMBERS FOR ... generate hyperbolic secant random numbers LET Y = HALF-LOGISTIC RANDOM NUMBERS FOR ... generate half-logistic random numbers

Dataplot  / Dataplot Random Numbers ]

Distributions Requiring the Shape Parameter N The following table lists the distributions requiring the shape parameter N. To specify this shape parameter, enter the following command before generating the random numbers.
LET N = <value>
 LET Y = DISCRETE UNIFORM RANDOM NUMBERS FOR ... generate discrete uniform random numbers
Dataplot  / Dataplot Random Numbers ]

Distributions Requiring the Shape Parameter NU The following table lists the distributions requiring the shape parameter NU. To specify this shape parameter, enter the following command before generating the random numbers.
LET NU = <value>
 LET Y = T RANDOM NUMBERS FOR ... generate t random numbers LET Y = CHI-SQUARE RANDOM NUMBERS FOR ... generate chi-squared random numbers
Dataplot  / Dataplot Random Numbers ]

Distributions Requiring the Shape Parameter LAMBDA The following table lists the distributions requiring the shape parameter LAMBDA. To specify this shape parameter, enter the following command before generating the random numbers.
LET LAMBDA = <value>
 LET Y = TUKEY LAMBDA RANDOM NUMBERS FOR ... generate Tukey lambda random numbers LET Y = POISSON RANDOM NUMBERS FOR ... generate Poisson random numbers
Dataplot  / Dataplot Random Numbers ]

Distributions Requiring the Shape Parameters NU1 and NU2 The following table lists the distributions requiring the shape parameters NU1 and NU2. To specify these shape parameter, ese the following commands before generating the random numbers.
LET NU1 = <value>
LET NU2 = <value>
 LET Y = F RANDOM NUMBERS FOR ... generate F random numbers
Dataplot  / Dataplot Random Numbers ]

Distributions Requiring the Shape Parameters and ALPHA and BETA The following table lists the distributions requiring the shape parameters ALPHA and BETA. To specify these shape parameters, enter the following commands before generating the random numbers.
LET ALPHA = <value>
LET BETA = <value>
 LET Y = BETA RANDOM NUMBERS FOR ... generate beta random numbers LET Y = POWER LAW RANDOM NUMBERS FOR ... generate power law random numbers LET Y = ALPHA RANDOM NUMBERS FOR ... generate alpha random numbers LET Y = POWER EXPONENTIAL RANDOM NUMBERS FOR ... generate power exponential random numbers
Dataplot  / Dataplot Random Numbers ]

Distributions Requiring the Shape Parameter GAMMA The following table lists the distributions requiring the shape parameter GAMMA. To specify this shape parameter, enter the following command before generating the random numbers.
LET GAMMA = <value>
 LET Y = GAMMA RANDOM NUMBERS FOR ... generate gamma random numbers LET Y = WEIBULL RANDOM NUMBERS FOR ... generate Weibull random numbers LET Y = FRECHET RANDOM NUMBERS FOR ... generate extreme value type 2 random numbers LET Y = EXTREME VALUE TYPE 2 RANDOM NUMBERS FOR ... generate extreme value type 2 random numbers LET Y = PARETO RANDOM NUMBERS FOR ... generate Pareto random numbers LET Y = INVERSE GAUSSIAN RANDOM NUMBERS FOR ... generate inverse gaussian random numbers LET Y = RECIPROCAL INVERSE GAUSSIAN RANDOM NUMBERS FOR ... generate reverse inverse gaussian random numbers LET Y = FATIGUE LIFE RANDOM NUMBERS FOR ... generate fatigue life random numbers LET Y = WALD RANDOM NUMBERS FOR ... generate Wald random numbers LET Y = DOUBLE GAMMA RANDOM NUMBERS FOR ... generate double gamma random numbers LET Y = INVERTED GAMMA RANDOM NUMBERS FOR ... generate inverted gamma random numbers LET Y = LOG GAMMA RANDOM NUMBERS FOR ... generate log gamma random numbers LET Y = DOUBLE WEIBULL RANDOM NUMBERS FOR ... generate double Weibull random numbers LET Y = GENERALIZED EXTREME VALUE RANDOM NUMBERS FOR ... generate generalized extreme value random numbers LET Y = INVERTED WEIBULL RANDOM NUMBERS FOR ... generate inverted Weibull random numbers LET Y = GENERALIZED PARETO RANDOM NUMBERS FOR ... generate generalized Pareto random numbers LET Y = GEOMETRIC EXTREME EXPONENTIAL RANDOM NUMBERS FOR ... generate geometric extreme exponential random numbers
Dataplot  / Dataplot Random Numbers ]

Distributions Requiring the Shape Parameter C The following table lists the distributions requiring the shape parameter C. To specify this shape parameter, enter the following command before generating the random numbers.
LET C = <value>
 LET Y = POWER FOR ... generate power random numbers
Dataplot  / Dataplot Random Numbers ]

Distributions Requiring the Shape Parameters MU and SD The following table lists the distributions requiring the shape parameters MU and SD. To specify these shape parameter, enter the following commands before generating the random numbers.
LET MU = <value>
LET SD = <value>
 LET Y = FOLDED NORMAL FOR ... generate folded normal random numbers
Dataplot  / Dataplot Random Numbers ]

Distributions Requiring the Shape Parameters MU1, SD1, MU2, SD2, and P The following table lists the distributions requiring the shape parameters MU1, SD1, MU2, SD2, and P. To specify these shape parameter, enter the following commands before generating the random numbers.
LET MU1 = <value>
LET SD1 = <value>
LET MU2 = <value>
LET SD2 = <value>
LET P = <value>
 LET Y = NORMAL MIXTURE FOR ... generate normal mixture random numbers
Dataplot  / Dataplot Random Numbers ]

Distributions Requiring the Shape Parameters NU and LAMBDA The following table lists the distributions requiring the shape parameters NU and LAMBDA. To specify these shape parameters, enter the following commands before generating the random numbers.
LET NU = <value>
LET LAMBDA = <value>
 LET Y = NON-CENTRAL CHI-SQUARE FOR ... generate non-central chi-square random numbers
Dataplot  / Dataplot Random Numbers ]

Distributions Requiring the Shape Parameters NU1, NU2, and LAMBDA The following table lists the distributions requiring the shape parameters NU1, NU2, and LAMBDA. To specify these shape parameters, enter the following commands before generating the random numbers.
LET NU1 = <value>
LET NU2 = <value>
LET LAMBDA = <value>
 LET Y = NON-CENTRAL F FOR ... generate non-central F random numbers
Dataplot  / Dataplot Random Numbers ]

Distributions Requiring the Shape Parameters NU1, NU2, LAMBDA1, and LAMBDA2 The following table lists the distributions requiring the shape parameters NU1, NU2, LAMBDA1, and LAMBDA2. To specify these shape parameters, enter the following commands before generating the random numbers.
LET NU1 = <value>
LET NU2 = <value>
LET LAMBDA1 = <value>
LET LAMBDA2 = <value>
 LET Y = DOUBLY NON-CENTRAL F FOR ... generate doubly non-central F random numbers
Dataplot  / Dataplot Random Numbers ]

Distributions Requiring the Shape Parameter P The following table lists the distributions requiring the shape parameter P. To specify this shape parameter, enter the following command before generating the random numbers.
LET P = <value>
 LET Y = GEOMETRIC RANDOM NUMBERS FOR ... generate geometric random numbers LET Y = POWER NORMAL RANDOM NUMBERS FOR ... generate power normal random numbers
Dataplot  / Dataplot Random Numbers ]

Distributions Requiring the Shape Parameters P and N The following table lists the distributions requiring the shape parameters P and N. To specify these shape parameters, enter the following commands before generating the random numbers.
LET P = <value>
LET N = <value>
 LET Y = BINOMIAL RANDOM NUMBERS FOR ... generate binomial random numbers
Dataplot  / Dataplot Random Numbers ]

Distributions Requiring the Shape Parameters P and K The following table lists the distributions requiring the shape parameters P and K. To specify these shape parameters, enter the following commands before generating the random numbers.
LET P = <value>
LET K = <value>
 LET Y = NEGATIVE BINOMIAL RANDOM NUMBERS FOR ... generate negative binomial random numbers
Dataplot  / Dataplot Random Numbers ]

Distributions Requiring the Shape Parameters L, K, N, and M The following table lists the distributions requiring the shape parameters L, K, N, and M. To specify these shape parameters, enter the following commands before generating the random numbers.
LET L = <value>
LET K = <value>
LET N = <value>
LET M = <value>
 LET Y = NEGATIVE BINOMIAL RANDOM NUMBERS FOR ... generate negative binomial random numbers
Dataplot  / Dataplot Random Numbers ]

Distributions Requiring the Shape Parameter DELTA The following table lists the distributions requiring the shape parameter DELTA. To specify this shape parameter, enter the following command before generating the random numbers.
LET DELTA = <value>
 LET Y = LOG-LOGISTIC RANDOM NUMBERS FOR ... generate log-logistic random numbers
Dataplot  / Dataplot Random Numbers ]

Distributions Requiring the Shape Parameter ALPHA The following table lists the distributions requiring the shape parameter ALPHA. To specify this shape parameter, enter the following command before generating the random numbers.
LET ALPHA = <value>
 LET Y = LOG DOUBLE EXPONENTIAL RANDOM NUMBERS FOR ... generate log double exponential random numbers
Dataplot  / Dataplot Random Numbers ]

Distributions Requiring the Shape Parameter BETA The following table lists the distributions requiring the shape parameter BETA. To specify this shape parameter, enter the following command before generating the random numbers.
LET BETA = <value>
 LET Y = BRADFORD RANDOM NUMBERS FOR ... generate Bradford random numbers
Dataplot  / Dataplot Random Numbers ]

Distributions Requiring the Shape Parameter B The following table lists the distributions requiring the shape parameter B. To specify this shape parameter, enter the following command before generating the random numbers.
LET B = <value>
 LET Y = RECIPROCAL RANDOM NUMBERS FOR ... generate reciprocal random numbers
Dataplot  / Dataplot Random Numbers ]

Distributions Requiring the Shape Parameters C and B The following table lists the distributions requiring the shape parameters C and B. To specify these shape parameters, enter the following commands before generating the random numbers.
LET C = <value>
LET B = <value>
 LET Y = GOMPERTZ RANDOM NUMBERS FOR ... generate Gompertz random numbers
Dataplot  / Dataplot Random Numbers ]

Distributions Requiring the Shape Parameter THETA The following table lists the distributions requiring the shape parameter THETA. To specify this shape parameter, enter the following command before generating the random numbers.
LET THETA = <value>
 LET Y = LOGARITHMIC SERIES RANDOM NUMBERS FOR ... generate logarithmic series random numbers
Dataplot  / Dataplot Random Numbers ]

Distributions Requiring the Shape Parameters GAMMA and THETA The following table lists the distributions requiring the shape parameters THETA and GAMMA. To specify these shape parameters, enter the following commands before generating the random numbers.
LET THETA = <value>
LET GAMMA = <value>
 LET Y = EXPONENTIATED WEIBULL RANDOM NUMBERS FOR ... generate exponentiated Weibull random numbers
Dataplot  / Dataplot Random Numbers ]

Distributions Requiring the Shape Parameters N and THETA The following table lists the distributions requiring the shape parameters THETA and N. To specify these shape parameters, enter the following commands before generating the random numbers.
LET THETA = <value>
LET N = <value>
 LET Y = TWO-SIDED POWER RANDOM NUMBERS FOR ... generate two-sided power random numbers
Dataplot  / Dataplot Random Numbers ]

Distributions Requiring the Shape Parameters SCALE1, GAMMA1, LOC2, SCALE2, and GAMMA2 The following table lists the distributions requiring the shape parameters SCALE1, GAMMA1, LOC2, SCALE2, and GAMMA2. To specify these shape parameters, enter the following commands before generating the random numbers.
LET SCALE1 = <value>
LET GAMMA1 = <value>
LET LOC2 = <value>
LET SCALE2 = <value>
LET GAMMA2 = <value>
 LET Y = BIWEIBULL RANDOM NUMBERS FOR ... generate bi-Weibull random numbers
Dataplot  / Dataplot Random Numbers ]

Random Numbers for Multivariate Distributions In addition to the above univariate distributions, Dataplot can generate random numbers for multinomial and multivariate normal random numbers. These multivariate distributions return a matrix, rather than a vector, of random numbers.

To generate multivariate normal random numbers, enter the following commands:

LET MU = DATA <list of p means>
<pxp set of values>
END OF DATA
LET N = <value>
LET M = MULTIVARIATE NORMAL RANDOM NUMBERS MU SIGMA N
Note that M will be an NxP matrix. N is the number of rows generated for each component and their are P components to the multivariate normal. SIGMA is the pxp variance-covariance matrix of the multivariate normal. SIGMA will be checked to ensure that it is a positive definite matrix. MU is a vector specifying the means of the p components.

To generate multinomial random numbers, enter

LET P = DATA <list of probabilities that sum to 1>
LET NEVENTS = <value>
LET NCAT = SIZE P
LET N = <value>
LET M = MULTINOMIAL RANDOM NUMBERS P NEVENTS NCAT N
Dataplot  / Dataplot Random Numbers ]

NIST is an agency of the U.S. Commerce Department.

Date created: 06/05/2001
Last updated: 09/20/2016