Analyzing Simulation Data

February 21st, 2010 by Kristopher Reese

This post will discuss various mathematical formulae that are used in Event Based Simulation for very simple analysis of the data from the simulation.  For this post lets assume the following example simulation results:

Customer Inter-arrival Time Arrival Time Service Time Begin Service Wait Time End Service Time in System Server Idle
1 - 0 3.3 0 0 3.3 3.3 0
2 5.1 5.1 4.5 5.1 0 9.5 4.5 1.8
3 3.9 9.0 3.2 9.6 0.6 12.8 3.8 0
4 4.5 13.5 4.8 13.5 0 18.3 4.8 0.7
5 4.4 17.9 4.9 18.3 0.4 23.2 5.3 0
6 5.6 23.5 4.8 23.5 0 28.3 4.8 0.3
7 4.1 27.6 3.1 28.3 0.7 31.4 3.8 0
8 4.2 31.8 3.2 31.8 0 35 3.2 0.4

Since we have this data, we can do a very simple analysis of the resulting data.  For the purposes of this post, I will present the mean service time, the mean inter-arrival time, the mean wait time for all customers and for just those customers who waited, server utilization, and the mean number of customers in the system.

Mean Service Time. The following equation can be used for determining the mean service time of the customers.

\bar{\mathrm{st}} = \frac{\sum \text {Service Times}}{\text {Total Customers}}

For our given example, we get:

\bar{\mathrm{st}} = \frac{31.8}{8} = 3.975

Mean Inter-Arrival Time. The following equation can be used for determining the mean inter-arrival time of the customers.

\bar{\mathrm{ia}} = \frac{\sum \text {Inter-Arrival Time}}{\text {Total Customers}}

For our example, we would get:

\bar{\mathrm{ia}} = \frac{31.8}{7} = 4.54

Mean Wait Time. We have two instances of the mean wait time to consider.  The first is the mean wait time for all of the customers.  In this case, we can find the mean wait time with:

\text {Mean Wait Time for all} = \frac{\sum \text {Waiting Time}}{\text {Total Customers}}

For our example the mean wait time of all customers is:

\text {Mean Wait Time for all} = \frac{1.7}{8} = 0.21

In contrast, the mean wait time for only the customers who waited is:

\text {Mean Wait Time for waiters} = \frac{1.7}{3} = 0.57

Server Utilization. Server utilization is the percent of time in which the server was doing some form of work, or not idle.  For this, we want to find the mean server idle time and subtract this number from 1.  This will give us a value less than 1 which is the percent of utilization of the server.  In otherwords:

\text {Server Utilization} = 1 - \frac{\sum \text {server idle}}{\text {Total Time}}

For our example, we get:

\text {Server Utilization} = 1 - \frac{3.2}{35.0} = 1 - 0.091 = 0.908 \approx 91\%

Mean Number of Customers in System. Unlike the other equations, which are relatively trivial, the Mean number of Customers in the system is slightly trickier.  However, we can still compute this using a relatively simple equation.  First we want to define λ to be the mean interarrival rate and μ to be the mean service rate.  With this, we can find the Traffic Intensity:

\rho = \frac {\lambda}{\mu}

With ρ we can find the Mean number of Customers in the system with the following equation:

E[n]=\frac {\rho}{(1-\rho)}

Therefore for our example, we can define ρ as and then solve the Mean Number of Customers in the System:

\rho = \frac {4.54}{3.98} = 1.14

E[n]=\frac {1.14}{(1-1.14)} = \frac {1.14}{(0.14)} \approx 8

These equations are essential to know for simple statistical analysis of the data received by a simulation.  There are much more complex equations within queuing theory that require the knowledge of these equations.  So these are worthwhile equations to have memorized if you plan to do more complex statistical analysis of data.


Warning: require(wp-includes/theme-compat/comments.php) [function.require]: failed to open stream: No such file or directory in /home/kreese/public_html/wordpress/wp-includes/comment-template.php on line 893

Warning: require(wp-includes/theme-compat/comments.php) [function.require]: failed to open stream: No such file or directory in /home/kreese/public_html/wordpress/wp-includes/comment-template.php on line 893

Fatal error: require() [function.require]: Failed opening required 'wp-includes/theme-compat/comments.php' (include_path='.:/usr/lib/php:/usr/local/lib/php') in /home/kreese/public_html/wordpress/wp-includes/comment-template.php on line 893