The Random Number Generation tool returns a range of independent random numbers drawn from one of several distributions. You can select from seven different probability distributions from which to draw the random values. The choices are:
Uniform – Uniform(a,b) is a flat, bounded distribution with lower bound a and upper bound b. It is used to represent a random variable that is equally likely to take on any value between a lower and upper bound.
Normal - Normal(µ,σ) is an unbounded, symmetric distribution with the familiar bell curve, also called a Gaussian distribution. The Normal distribution is widely used in many different kinds of applications.
Bernoulli – Bernoulli (p) is a discrete distribution that takes on a value of 1 with probability p, and a value of 0 with probability (1-p). A Bernoulli random variable is usually considered as an outcome of an experiment with only two possible outcomes (0 and 1); each experiment is called a ‘Bernoulli Trial’.
Binomial - Binomial (n,p) is a discrete distribution of the number of successes in n independent ‘Bernoulli Trials’ (experiments with exactly two possible outcomes), where p is the success probability in each trial. The Binomial distribution can be used to model the number of winning trades in a trading system, or the number of defective items in a batch.
Poisson - Poisson (λ) is a discrete distribution of the number of events that occur in an interval of time, when the events occur at a known average rate, and each occurrence is independent of the time of occurrence of the previous event.
Patterned – Specify a value and the associated probability range. This range must include two columns: the first containing values and the second probabilities associated with the corresponding value. The sum of the probabilities must be equal to 1.
Discrete - Discrete ({x1,x2,…,xn}, {p1,p2,…,pn},…) is a custom discrete distribution that takes on values {x1,x2,…,xn} with probabilities {p1,p2,…,pn} respectively.
Note: The Add-on's Random Number Generation function uses the Mersenne Twister algorithm.
To generate the forecast:
- On the XLMiner Analysis ToolPak pane, click Random Number Generation
- Enter an integer to define the number of variables, or columns, in the generated output table. For this example, enter 5.
- Enter an integer to define the size of each sample. This is the number of rows in the generated output table. For this example, enter 6.
- Select the desired distribution. In this example, we will select Normal.
- The parameters will change according to the selected distribution. Since Normal is selected for the distribution, the parameters change to mean and standard deviation. Enter 10 for Mean and 5 for Standard Deviation.
- Setting the random number seed to a nonzero value (any number of your choice is OK) ensures that the same sequence of random numbers is used for each simulation. When the seed is zero, the random number generator is initialized from the system clock, so the sequence of random numbers will be different in each simulation. If you need the results from one simulation to another to be strictly comparable, you should set the seed. In this example, we will leave this option blank.
- Enter A1 for the Output Range.
- Click OK.
The results are below.
These 30 random values have been drawn from the Normal distribution with mean = 10 and standard deviation = 5.