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:

• Analytical techniques for stochastic processes derive output distributions from combinations of input distributions and process models. Examples of this technique are discussed in the note on queuing and waiting lines.
• Monte Carlo techniques utilize repeated executions of numerical rigid models to simulate stochastic processes. Each execution of the model produces a sample output. The output samples can then be examined statistically and distributions determined.
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:

• SSERVER is a single waiting line, single service process using first come first served. It allows the use of defined arrival and service time distributions.
• RISK - is a simulator of the simple business proposition that profit is the difference between the return from sales minus the cost of the product sold. The proposition is described by a simple model and probabilities of costs, prices, volumes, etc. A typical simple model:

• Profit = Revenues - Costs.
• PVIS demonstrates Monte Carlo analysis of the variables involved in an investment such as a piece of equipment. An initial investment is considered at time zero, Vectors of Receipts, Disbursements and Salvage Values with accompanying vectors of Probabilities are allowed for each period up to n. In addition an upset price vector can shorten the series if the Salvage Value equals or exceeds the upset price.
• HAUL is a model of a line haul, backhaul with terminals, cyclical operation using a number of similar vehicles. It includes a variety of random variables including vehicle breakdown, and the number of vehicles.
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:

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: 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.

ôdatadata[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