Vanguard Software
Forecasting & Planning Solutions
Home Products Solutions Services Customers Partners Company
 
Applying science to business management

contents.gifindex.gifprev1.gifnext1.gif

Custom Continuous Distributions

If DecisionPro does not include a random number generator with the distribution you want, you can create a custom generator. However, to do this you will need to know an equation for the desired probability density function (PDF).

Suppose you want a random number generator that returns a number between 0 and 10 with a parabolic shape as graphed below.

dph00283.gif

This PDF graph uses the formula

dph00284.gif

To create a generator that has this distribution, click Custom in the Make Stochastic Input dialog box (Tools, Monte Carlo, Make Stochastic Input).

dph00285.gif

This will bring up the Custom Distribution dialog box. Here you enter the equation for the desired distribution plus the necessary limits.

dph00286.gif

If you click the Update Graph button, DecisionPro will display the PDF for the distribution you chose.

When you are satisfied that the distribution is what you want, just click Finish.

Lets consider another example. Suppose you want to create a random number generator with a normal (or Gaussian) distribution. Of course, the easiest way to do this is just to use the built-in generator nrand. However, the custom generator tool will be used here to illustrate a few concepts.

The equation for a Gaussian distribution with mean zero and standard deviation of one is

1/sqrt(2PI)*exp(x^2/-2)

dph00287.gif

One peculiar property of this equation is that x extends from negative infinity to positive infinity. However, you need explicit limits. Since the graph shows that the curve approaches zero at about -4 and 4, these values will be used for the limits.

Another feature of this equation is that it is difficult to know exactly what the maximum value is. To find this automatically, you can just press the Find Maximum button in the Custom Distribution dialog box.

dph00288.gif

You dont need to be exact about the limits in order for the custom generator to work properly. However, if you choose limits that are too tight, the distribution will be distorted. If you choose limits that are too relaxed, the generator will be slow.

How it Works

To generate a custom distribution, DecisionPro uses the rejection method. This is best illustrated by example. Suppose you want to generate Gaussian deviates that fit the distribution below.

dph00289.gif

First, generate two random numbers drawn from uniform distributions. The first number ranges from -4 to 4. The second number ranges from 0 to 0.4. Next, imagine you use these two numbers as x and y coordinates to create a point on the graph above. The point will always lie in the box shown on this graph. If the point lies below the distribution curve, you return the x-value as your random number. If the point lies above the curve, you reject it, generate two new numbers, and see where they lie. Since all points you generate are equally likely to be anywhere in the box, rejecting all points above the curve leaves you with deviates drawn from the desired distribution.

This method is quite robust and it can be used to produce virtually any distribution. However, this method is not very fast. Depending on how you select the limits, DecisionPro might have to reject many pairs before finding a single match. Using the limits illustrated in the graph above, about one third of the pairs is accepted as valid deviates and the remaining two thirds are rejected. Now, imagine if you had set the limits at -10, 10, and a maximum of 0.5:

dph00290.gif

The resulting random number generator will be almost identical to the one generated with the smaller limits. However, you will reject about 9 points for every good one you keep. This makes the generator considerably slower.

  Demand Planning  |  Financial Forecasting
Forecasting Software  |  Strategic Planning Software  |  Decision Tree Software
Decision Support Software  |  Expert System Software  |  Online Surveys

Contact Us  |  Terms of Use  |  Privacy Policy  |  Site Map
Vanguard Software
© 2011 Vanguard Software Corporation
Print this page   Email this page to a friend