MONTE CARLO SIMULATION (MCS), Introduction,
MCARLO, a MYSYS workspace

A rigid mathematical model will reproduce results given the same inputs. A stochastic model will give random results given random inputs. Stochastic models are used to describe processes that produce variable output patterns.

Some techniques used to model stochastic (random) processes are:

Monte Carlo Simulation generates a number of outcomes of a process model. Random and fixed variable inputs provide the model with the range of conditions simulated. The outcomes are distributions.

In MCS the MODEL outputs are analyzed statistically or by other means to discover patterns or other information that may or may not have been evident from the prior known information.

The MODEL may include waiting lines, capacity, resource, and/or service limits; internal or external constraints; time related, feedback and/or other structures which will portray the modeled process.

The input conditions can be varied to study their effects on the outcomes. The Monte Carlo technique allows simulation of situations that are difficult or impossible to derive analytical solutions. The method uses extensive computing to provide a sample of possible results that can be analyzed to predict probable outcomes. Examples of simulation models are given TVX, ROADS, and MCARLO workspaces. Examples are listed below:

TECHNIQUES: The elements of a Monte Carlo Simulator which are not common features of other mathematical models are the 'random variable generators'. Several techniques are employed to create representative random variable values, but repeated sampling of distribution functions by chosen random variable or parameter values. This process relies on a random number generator as the selector. Most contemporary computer languages have built in random number generators of one sort or another. If these are not adequate then a more elegant one can be installed.  In APL the primitive ? (roll) provides this facility.

The quality of distribution function depends as usual on the ability of the function selected to model the process; the quality of the calibrating information, and the calibration. The usual distribution functions are cumulative probability relationships. The simplest functions are tables of actual measurements. A table can then be sampled repeatedly by selecting index numbers at random. The utility functions file (f) contains versions of the random variable functions NNORMAL, NUNIFORM, NPOISSON, NEXPONENTIAL from the VSAPL public library. These can be used to produce random variable inputs.

The functions demonstrate various ways and means of using random variables for input and summarizing output. Key: Enter on the line below for more. Links:

  1. MCARLO, A MYNET version of the MYSYS simulation workspace description
  2. Waiting Lines, QUEUE
  3. Mathematical Models
  4. TOPICS included in MYSYS
  5. Introductions to various TOPICS included in MYSYS
  6. Time Value and Engineering Economy Topics
  7. General List of Transportation Topics
The following are best viewed in MYSYS. The LESSON file addresses are as shown. The function LESSON is on [Ctrl F9].
Links to MYNET versions:
  1. LESSON'x55', Introduction to Monte Carlo Simulation
  2. LESSON'x56', HARBOUR SIMULATION EXAMPLE, AMS
  3. LESSON'x58', Intro to Monte Carlo method, includes distribution models in APL
  4. LESSON'x59', MONTE CARLO Simulation, compound interest functions
  5. LESSON'u28', HAUL, backhaul transport system simulator, AMS
  6. LESSON 'x9', on fitting functions to data.
The following is from: LESSON'x55'. The text part of the lesson is included in the notes above:
 An example of this technique is shown below:
 (Data is a vector of information such as survey measurements)

 data 15 19 15 17 17 18 19 18 17 15 16 20 16 17 18 18 16 18 19 17

 ûdata ¦ number of items in the data

 ôdata[?10ûûdata] ¦ select 10 items at random from data.


  For aesthetic or other purposes the data list can be sorted.

 ôdatadata[data]  data[?10ûûdata]  ‘k  ‘0 ¦ sort then select.

 Plot' Sorted Data Distribution'  ‘vs data  ‘0

 Data can be fitted to one of the standard distribution
functions such as the NORMAL, EXPONENTIAL, or a function can be
assumed such as the POISSON.  Versions of these are included in
the Utility function (f) file.

  The fn. RISK and SDD make use of distribution fn. based on
estimated probabilities of limiting amounts. These are expressed
as a 2 row array of amounts in row 1 and probability in in row 2.
RISK uses % and SDD uses decimals.

  E.g.. From p 494 of Riggs: P(N=1)=0.2, P(N=2)=0.3, P(n=3)=0.4,
P(n=4)=0.1  a selection of 20 values can be made using SDD as
follows:
 20 SDD 2 4û1 2 3 4 .2 .3 .4 .1

  The fn RISK uses DISTTBLS which uses the fn ‘when which provides
a straight line interpolation between points rather than the
discrete selection used by SDD.

  E.g.. It is estimated that there is 0 probability of going below
100, only a 20= chance of being below 135, a 50% chance of being at
150 and a 65% of getting to 165 and a 100% chance of being below
200.

  [Enter] on the line below to select 10 values at random from the
above information:
 (2 5û100 135 150 165 200 0 20 50 65 100) ‘when ?10û100
Various MYSYS and MYS2 workspaces include examples of simulators for financial and transport system analysis.

SIMSCRIPT, GPSS, and other specialized simulation languages are available. Most situations where simple simulators would assist analysis can be coded in familiar standard languages. The examples shown are in APL.

End to date, ams 990709