Entering Random Variables in a Model

Simulation Master Tutorials > Entering Random Variables in a Model

Random variables are inputs to the model whose values are sampled from a probability distribution.  Simulation Master has built-in functions to sample from various distributions and entering these functions into the model is the subject of this tutorial.  There are two types of random variable functions used:

Regular  These functions generate a random number and sample from the appropriate probability distribution.  Regular random variable functions begin with RV.

Copula Marginal  These functions are used in conjunction with a copula.  Copula output is used as the random number input to these functions for sampling.  Copula marginal functions begin with RVC.

Random variables functions can be typed directly in a cell, or they can be added using the random variable tool.  This tutorial will cover using the random variable tool.  For information on entering functions directly, refer to the Simulation Master user manual for the required parameters.

Entering a Regular Random Variable

In the model below, we are going to replace all revenue and expense cells with random variables so we can eventually simulate net present value.  We will demonstrate how to enter a triangular random variable for year 1 expense which is located in cell C5.

Click the Random Variable button on the ribbon.

The Random Variable form will appear.  Leave the Regular button selected in the Variable Type pane.

Variable Cell Address

This is the cell where the function will be placed.  You can enter the address in the box or use the minimize button to select the cell directly.  In our example, we would enter C5.

Distribution Type

Since we are entering a triangular distribution, leave the Continuous button selected.

Distribution Parameters

Select triangular from the drop-down box.  When a distribution is selected, the parameters required for that distribution will appear.  Parameters can be entered as a number, or referenced to a cell containing the parameter value.  We enter the following parameter values:

Minimum: 15,000

Most Likely: 25,000

Maximum: 35,000

Truncation Points

Most distributions can be truncated on one or both tails.  When a distribution is truncated, the function will not return samples below the lower truncation point or above the upper truncation point.  Truncation points can be entered as a number, or referenced to a cell containing the truncation value.  If you don't want to truncate, leave the boxes blank.  In our example, we will leave them blank.

 

The form should look like this:

When ready, click the Add Variable button.  The function should now be in cell C5.

To finish, we would repeat this procedure for each revenue cell (D5:H5) and expense cell (C6:H6).

Entering a Copula Marginal Random Variable

In the model below, we are going to add two copula marginal random variables.  Each bivariate copula has two outputs that feed two random variable (hence bivariate) functions.  For more on how to set up a copula, refer to the copula tutorial.

Click the Random Variable button on the ribbon to open the Random Variable form.  Select the Copula marginal button in the Variable Type pane.

Copula Cell

Enter the cell address for the copula function.  In the example above, this is cell E4.  The address can be typed in the box or selected using the minimize button.

Other Settings

We will add a normally distributed random variable to cell E7.  The mean is 10 and standard deviation is .75.  There is no truncation.

 

The Random Variable form should look like this:

Click the Add Variable button and the function should appear in cell E7.  The process can be repeated to add the second random variable in cell E8.