<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:wfw="http://wellformedweb.org/CommentAPI/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	xmlns:atom="http://www.w3.org/2005/Atom"
	xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
	xmlns:slash="http://purl.org/rss/1.0/modules/slash/"
	>

<channel>
	<title>kReese.net</title>
	<atom:link href="http://kreese.net/index.php/feed/" rel="self" type="application/rss+xml" />
	<link>http://kreese.net</link>
	<description>Notebook of a PhD Computer Scientist Student.</description>
	<lastBuildDate>Mon, 22 Feb 2010 08:50:18 +0000</lastBuildDate>
	<generator>http://wordpress.org/?v=2.9.2</generator>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
			<item>
		<title>Discrete Statistical Distributions</title>
		<link>http://kreese.net/index.php/2010/02/discrete-statistical-distributions/</link>
		<comments>http://kreese.net/index.php/2010/02/discrete-statistical-distributions/#comments</comments>
		<pubDate>Mon, 22 Feb 2010 08:50:18 +0000</pubDate>
		<dc:creator>Kristopher Reese</dc:creator>
				<category><![CDATA[Simulations]]></category>
		<category><![CDATA[Statistics]]></category>
		<category><![CDATA[Bernoulli Distribution]]></category>
		<category><![CDATA[Binomial Distribution]]></category>
		<category><![CDATA[Poisson Distribution]]></category>
		<category><![CDATA[Triangular Distribution]]></category>
		<category><![CDATA[Uniform Distribution]]></category>

		<guid isPermaLink="false">http://kreese.net/?p=367</guid>
		<description><![CDATA[Statistical Distributions of data are an important aspect in both analyzing resulting data and in generating random numbers based on a specified distribution.  This post will discuss a handful of Statistical Distributions that are common in Discrete-Event Simulations.  It will discuss the Uniform Distribution, the Triangular Distribution, the Binomial/Bernoulli Distribution, the Poisson Distribution, and the [...]]]></description>
			<content:encoded><![CDATA[<p>Statistical Distributions of data are an important aspect in both analyzing resulting data and in generating random numbers based on a specified distribution.  This post will discuss a handful of Statistical Distributions that are common in Discrete-Event Simulations.  It will discuss the Uniform Distribution, the Triangular Distribution, the Binomial/Bernoulli Distribution, the Poisson Distribution, and the Exponential Distribution.  The two most important aspects of these distributions for the purposes of this discussion are the Probability Mass Function and the Cumulative Distribution Function.  Each distributions PDF and CDF will be discussed further here.</p>
<p>Before getting started, below is a table of equations for each of the distributions for finding the mean, median, mode, and variance of a specific distribution:</p>
<table>
<thead>
<tr>
<th>Distribution</th>
<th>Mean</th>
<th>Median</th>
<th>Mode</th>
<th>Variance</th>
</tr>
</thead>
<tbody>
<tr>
<td style="text-align: center;">Uniform</td>
<td style="text-align: center;"><img src='http://s.wordpress.com/latex.php?latex=%5Cfrac%7Ba%2Bb%7D%7B2%7D&#038;bg=ffffff&#038;fg=000000&#038;s=0' alt='\frac{a+b}{2}' title='\frac{a+b}{2}' class='latex' /></td>
<td style="text-align: center;"><img src='http://s.wordpress.com/latex.php?latex=%5Cfrac%7Ba%2Bb%7D%7B2%7D&#038;bg=ffffff&#038;fg=000000&#038;s=0' alt='\frac{a+b}{2}' title='\frac{a+b}{2}' class='latex' /></td>
<td style="text-align: center;">N/A</td>
<td style="text-align: center;"><img src='http://s.wordpress.com/latex.php?latex=%5Cfrac%7Bn%5E%7B2%7D-1%7D%7B12%7D&#038;bg=ffffff&#038;fg=000000&#038;s=0' alt='\frac{n^{2}-1}{12}' title='\frac{n^{2}-1}{12}' class='latex' /></td>
</tr>
<tr>
<td style="text-align: center;">Triangular</td>
<td style="text-align: center;"><img src='http://s.wordpress.com/latex.php?latex=%5Cfrac%7Ba%2Bb%2Bc%7D%7B3%7D&#038;bg=ffffff&#038;fg=000000&#038;s=0' alt='\frac{a+b+c}{3}' title='\frac{a+b+c}{3}' class='latex' /></td>
<td style="text-align: center;"><img src='http://s.wordpress.com/latex.php?latex=%5Cleft%5C%7B%5Cbegin%7Bmatrix%7D%20a%2B%5Cfrac%7B%5Csqrt%7B%28b-a%29%28c-a%29%7D%7D%7B%5Csqrt%7B2%7D%7D%20%26%20%5Ctext%20%7Bfor%7D%20%5C%3B%20c%20%5Cgeq%20%5Cfrac%7Ba%2Bb%7D%7B2%7D%20%5C%5C%20%5C%5C%20%20b-%5Cfrac%7B%5Csqrt%7B%28b-a%29%28c-a%29%7D%7D%7B%5Csqrt%7B2%7D%7D%20%26%20%5Ctext%20%7Bfor%7D%20%5C%3B%20c%20%5Cleq%20%5Cfrac%7Ba%2Bb%7D%7B2%7D%20%20%5Cend%7Bmatrix%7D%5Cright.&#038;bg=ffffff&#038;fg=000000&#038;s=0' alt='\left\{\begin{matrix} a+\frac{\sqrt{(b-a)(c-a)}}{\sqrt{2}} &amp; \text {for} \; c \geq \frac{a+b}{2} \\ \\  b-\frac{\sqrt{(b-a)(c-a)}}{\sqrt{2}} &amp; \text {for} \; c \leq \frac{a+b}{2}  \end{matrix}\right.' title='\left\{\begin{matrix} a+\frac{\sqrt{(b-a)(c-a)}}{\sqrt{2}} &amp; \text {for} \; c \geq \frac{a+b}{2} \\ \\  b-\frac{\sqrt{(b-a)(c-a)}}{\sqrt{2}} &amp; \text {for} \; c \leq \frac{a+b}{2}  \end{matrix}\right.' class='latex' /></td>
<td style="text-align: center;"><em>c</em></td>
<td style="text-align: center;"><img src='http://s.wordpress.com/latex.php?latex=%5Cfrac%7Ba%5E%7B2%7D%2Bb%5E%7B2%7D%2Bc%5E%7B2%7D-ab-ac-bc%7D%7B18%7D&#038;bg=ffffff&#038;fg=000000&#038;s=0' alt='\frac{a^{2}+b^{2}+c^{2}-ab-ac-bc}{18}' title='\frac{a^{2}+b^{2}+c^{2}-ab-ac-bc}{18}' class='latex' /></td>
</tr>
<tr>
<td style="text-align: center;">Binomial</td>
<td style="text-align: center;">np</td>
<td style="text-align: center;"><img src='http://s.wordpress.com/latex.php?latex=%5Cleft%20%5Clfloor%20np%20%5Cright%20%5Crfloor%20%5Ctext%20%7Bor%7D%20%5Cleft%20%5Clceil%20np%20%5Cright%20%5Crceil&#038;bg=ffffff&#038;fg=000000&#038;s=0' alt='\left \lfloor np \right \rfloor \text {or} \left \lceil np \right \rceil' title='\left \lfloor np \right \rfloor \text {or} \left \lceil np \right \rceil' class='latex' /></td>
<td style="text-align: center;"><img src='http://s.wordpress.com/latex.php?latex=%5Cleft%20%5Clfloor%20%28n%2B1%29p%20%5Cright%20%5Crfloor%20%5Ctext%20%7Bor%7D%20%5Cleft%20%5Clceil%20%28n%2B1%29p%20%5Cright%20%5Crceil-1&#038;bg=ffffff&#038;fg=000000&#038;s=0' alt='\left \lfloor (n+1)p \right \rfloor \text {or} \left \lceil (n+1)p \right \rceil-1' title='\left \lfloor (n+1)p \right \rfloor \text {or} \left \lceil (n+1)p \right \rceil-1' class='latex' /></td>
<td style="text-align: center;"><img src='http://s.wordpress.com/latex.php?latex=np%281-p%29&#038;bg=ffffff&#038;fg=000000&#038;s=0' alt='np(1-p)' title='np(1-p)' class='latex' /></td>
</tr>
<tr>
<td style="text-align: center;">Exponential</td>
<td style="text-align: center;"><img src='http://s.wordpress.com/latex.php?latex=%5Cfrac%7B1%7D%7B%5Clambda%7D&#038;bg=ffffff&#038;fg=000000&#038;s=0' alt='\frac{1}{\lambda}' title='\frac{1}{\lambda}' class='latex' /></td>
<td style="text-align: center;"><img src='http://s.wordpress.com/latex.php?latex=%5Cfrac%7Bln%282%29%7D%7B%5Clambda%7D&#038;bg=ffffff&#038;fg=000000&#038;s=0' alt='\frac{ln(2)}{\lambda}' title='\frac{ln(2)}{\lambda}' class='latex' /></td>
<td style="text-align: center;">0</td>
<td style="text-align: center;"><img src='http://s.wordpress.com/latex.php?latex=%5Cfrac%7B1%7D%7B%5Clambda%5E%7B2%7D%7D&#038;bg=ffffff&#038;fg=000000&#038;s=0' alt='\frac{1}{\lambda^{2}}' title='\frac{1}{\lambda^{2}}' class='latex' /></td>
</tr>
<tr>
<td style="text-align: center;">Poisson</td>
<td style="text-align: center;">λ</td>
<td style="text-align: center;"><img src='http://s.wordpress.com/latex.php?latex=%5Capprox%20%5Cleft%20%5Clfloor%20%5Clambda%2B%5Cfrac%7B1%7D%7B3%7D-%5Cfrac%7B0.02%7D%7B%5Clambda%7D%20%5Cright%20%5Crfloor&#038;bg=ffffff&#038;fg=000000&#038;s=0' alt='\approx \left \lfloor \lambda+\frac{1}{3}-\frac{0.02}{\lambda} \right \rfloor' title='\approx \left \lfloor \lambda+\frac{1}{3}-\frac{0.02}{\lambda} \right \rfloor' class='latex' /></td>
<td style="text-align: center;"><img src='http://s.wordpress.com/latex.php?latex=%5Cleft%5C%7B%5Cbegin%7Bmatrix%7D%20%5Cleft%20%5Clfloor%20%5Clambda%20%5Cright%20%5Crfloor%20%26%20%5Ctext%20%7Bif%7D%5C%3B%20%5Clambda%20%5Cnotin%20%5Cmathbb%7BN%7D%20%5C%5C%20%20%5Clambda-1%20%26%20%20%5Ctext%20%7Bif%7D%5C%3B%20%5Clambda%20%5Cin%20%5Cmathbb%7BN%7D%20%5Cend%7Bmatrix%7D%5Cright.&#038;bg=ffffff&#038;fg=000000&#038;s=0' alt='\left\{\begin{matrix} \left \lfloor \lambda \right \rfloor &amp; \text {if}\; \lambda \notin \mathbb{N} \\  \lambda-1 &amp;  \text {if}\; \lambda \in \mathbb{N} \end{matrix}\right.' title='\left\{\begin{matrix} \left \lfloor \lambda \right \rfloor &amp; \text {if}\; \lambda \notin \mathbb{N} \\  \lambda-1 &amp;  \text {if}\; \lambda \in \mathbb{N} \end{matrix}\right.' class='latex' /></td>
<td style="text-align: center;">λ</td>
</tr>
</tbody>
</table>
<p><br/><br />
<strong>The Uniform Distribution</strong> exists in both the discrete and the continuous spaces.  For this discussion however, we will strictly discuss the Discrete version. In a discrete uniform distribution, we can generate the Probability Mass Function with the equation:</p>
<p style="text-align: center;"><img src='http://s.wordpress.com/latex.php?latex=%5Ctext%7Bpmf%7D%20%5Cleft%5C%7B%5Cbegin%7Bmatrix%7D%20%5Cfrac%7B1%7D%7Bn%7D%20%26%20%5Ctext%20%7Bfor%7D%5C%3B%20a%20%5Cleq%20k%20%5Cleq%20b%20%5C%5C%20%5C%5C%200%20%26%20%5Ctext%20%7Botherwise%7D%20%5Cend%7Bmatrix%7D%5Cright.&#038;bg=ffffff&#038;fg=000000&#038;s=0' alt='\text{pmf} \left\{\begin{matrix} \frac{1}{n} &amp; \text {for}\; a \leq k \leq b \\ \\ 0 &amp; \text {otherwise} \end{matrix}\right.' title='\text{pmf} \left\{\begin{matrix} \frac{1}{n} &amp; \text {for}\; a \leq k \leq b \\ \\ 0 &amp; \text {otherwise} \end{matrix}\right.' class='latex' /></p>
<p>where:</p>
<p style="text-align: center;"><img src='http://s.wordpress.com/latex.php?latex=a%2C%20b%20%5Cin%20%5Cmathbb%7BN%7D%20%5C%5C%20k%20%5Cin%20%5Cleft%20%5C%7B%20a%2C%20a%2B1%2C%20%5Cldots%20%2C%20b-1%2C%20b%20%5Cright%20%5C%7D%20%5C%5C%20n%20%3D%20b%20-%20a%20%2B%201&#038;bg=ffffff&#038;fg=000000&#038;s=0' alt='a, b \in \mathbb{N} \\ k \in \left \{ a, a+1, \ldots , b-1, b \right \} \\ n = b - a + 1' title='a, b \in \mathbb{N} \\ k \in \left \{ a, a+1, \ldots , b-1, b \right \} \\ n = b - a + 1' class='latex' /></p>
<p>Using the same parameters, we can calculate the Cumulative Distribution Function using the equation:</p>
<p style="text-align: center;"><img src='http://s.wordpress.com/latex.php?latex=%5Ctext%20%7Bcdf%7D%20%5Cleft%5C%7B%5Cbegin%7Bmatrix%7D%200%20%26%20%5Ctext%20%7Bfor%7D%20%5C%3B%20k%20%3C%20a%20%5C%5C%20%20%5Cfrac%7B%5Cleft%20%5Clfloor%20k%20%5Cright%20%5Crfloor%20-%20a%20%2B%201%7D%7Bn%7D%20%26%20%5Ctext%20%7Bfor%7D%20a%20%5Cleq%20k%20%5Cleq%20b%5C%5C%20%201%20%26%20%5Ctext%20%7Bfor%7D%20%5C%3B%20k%20%3E%20b%20%20%20%5Cend%7Bmatrix%7D%5Cright.&#038;bg=ffffff&#038;fg=000000&#038;s=0' alt='\text {cdf} \left\{\begin{matrix} 0 &amp; \text {for} \; k &lt; a \\  \frac{\left \lfloor k \right \rfloor - a + 1}{n} &amp; \text {for} a \leq k \leq b\\  1 &amp; \text {for} \; k &gt; b   \end{matrix}\right.' title='\text {cdf} \left\{\begin{matrix} 0 &amp; \text {for} \; k &lt; a \\  \frac{\left \lfloor k \right \rfloor - a + 1}{n} &amp; \text {for} a \leq k \leq b\\  1 &amp; \text {for} \; k &gt; b   \end{matrix}\right.' class='latex' /></p>
<p style="text-align: left;">Using the PDF and CDF we can plot a set of points onto graphs which would look similar to Figure 1a &amp; 1b respectively (with the same parameters):</p>
<div id="attachment_385" class="wp-caption aligncenter" style="width: 259px"><a href="http://kreese.net/wordpress/wp-content/uploads/2010/02/Discrete-Uniform-PDF-e1266818321288.jpg"><img class="size-full wp-image-384" title="Discrete Uniform PDF" src="http://kreese.net/wordpress/wp-content/uploads/2010/02/Discrete-Uniform-PDF-e1266818321288.jpg" alt="Discrete Uniform Probability Mass Function" width="249" height="191" /></a>(a)<br />
<a href="http://kreese.net/wordpress/wp-content/uploads/2010/02/Discrete-Uniform-CDF-e1266818376134.jpg"><img class="size-full wp-image-385" title="Discrete Uniform CDF" src="http://kreese.net/wordpress/wp-content/uploads/2010/02/Discrete-Uniform-CDF-e1266818376134.jpg" alt="Discrete Uniform Cumulative Distribution Function" width="250" height="192" /></a>(b)<br />
<p class="wp-caption-text">A plot of the Discrete Uniform (a) Probability Mass Function and (b) Cumulative Distribution Function.  a = 1, b = 5.  Graph generated with MATLAB </p></div>
<p><strong>The Triangular Distribution</strong> can be used in situations which a normal distribution might be needed, but when we want to restricted the distribution to a set of bounds.  A triangular distribution has three parameters a lower limit <em>a</em>, an upper limit<em> b</em>, and a mode <em>c</em>.  These parameters are defined as:</p>
<p style="text-align: center;"><img src='http://s.wordpress.com/latex.php?latex=%20a%20%5Cin%20%5CRe%20%5C%5C%20b%20%3E%20a%20%5C%5C%20a%20%5Cleq%20c%20%5Cleq%20b&#038;bg=ffffff&#038;fg=000000&#038;s=0' alt=' a \in \Re \\ b &gt; a \\ a \leq c \leq b' title=' a \in \Re \\ b &gt; a \\ a \leq c \leq b' class='latex' /></p>
<p style="text-align: left;">With these parameters we can find the PMF and CDF to be:</p>
<p style="text-align: center;"><img src='http://s.wordpress.com/latex.php?latex=%5Ctext%20%7Bpmf%7D%20%5Cleft%5C%7B%5Cbegin%7Bmatrix%7D%20%5Cfrac%7B2%28x-a%29%7D%7B%28b-a%29%28c-a%29%7D%20%26%20%5Ctext%20%7Bfor%7D%20%5C%3B%20a%20%5Cleq%20x%20%5Cleq%20c%20%5C%5C%20%5C%5C%20%5Cfrac%7B2%28b-x%29%7D%7B%28b-a%29%28b-c%29%7D%20%26%20%5Ctext%20%7Bfor%7D%20%5C%3B%20c%20%5Cleq%20x%20%5Cleq%20b%20%5Cend%7Bmatrix%7D%5Cright.%20%5C%5C%20%5C%5C%20%5C%5C%20%5Ctext%20%7Bcdf%7D%20%5Cleft%5C%7B%5Cbegin%7Bmatrix%7D%20%5Cfrac%7B%28x-a%29%5E%7B2%7D%7D%7B%28b-a%29%28c-a%29%7D%20%26%20%5Ctext%20%7Bfor%7D%20%5C%3B%20a%20%5Cleq%20x%20%5Cleq%20c%20%5C%5C%20%5C%5C%201-%5Cfrac%7B%28b-x%29%5E%7B2%7D%7D%7B%28b-a%29%28b-c%29%7D%20%26%20%5Ctext%20%7Bfor%7D%20%5C%3B%20c%20%5Cleq%20x%20%5Cleq%20b%20%5Cend%7Bmatrix%7D%5Cright.&#038;bg=ffffff&#038;fg=000000&#038;s=0' alt='\text {pmf} \left\{\begin{matrix} \frac{2(x-a)}{(b-a)(c-a)} &amp; \text {for} \; a \leq x \leq c \\ \\ \frac{2(b-x)}{(b-a)(b-c)} &amp; \text {for} \; c \leq x \leq b \end{matrix}\right. \\ \\ \\ \text {cdf} \left\{\begin{matrix} \frac{(x-a)^{2}}{(b-a)(c-a)} &amp; \text {for} \; a \leq x \leq c \\ \\ 1-\frac{(b-x)^{2}}{(b-a)(b-c)} &amp; \text {for} \; c \leq x \leq b \end{matrix}\right.' title='\text {pmf} \left\{\begin{matrix} \frac{2(x-a)}{(b-a)(c-a)} &amp; \text {for} \; a \leq x \leq c \\ \\ \frac{2(b-x)}{(b-a)(b-c)} &amp; \text {for} \; c \leq x \leq b \end{matrix}\right. \\ \\ \\ \text {cdf} \left\{\begin{matrix} \frac{(x-a)^{2}}{(b-a)(c-a)} &amp; \text {for} \; a \leq x \leq c \\ \\ 1-\frac{(b-x)^{2}}{(b-a)(b-c)} &amp; \text {for} \; c \leq x \leq b \end{matrix}\right.' class='latex' /></p>
<p style="text-align: left;">Plotting these functions, will result in graphs that appear similar to Figure 2.  Figure 2 images were taken from the wikipedia article.  These two images are distributed under the Creative Commons Attribution ShareAlike 3.0 License.</p>
<div id="attachment_393" class="wp-caption aligncenter" style="width: 259px"><a href="http://kreese.net/wordpress/wp-content/uploads/2010/02/Triangular_distribution_PMF-e1266820957390.png"><img class="size-full wp-image-393" title="Triangular_distribution_PMF" src="http://kreese.net/wordpress/wp-content/uploads/2010/02/Triangular_distribution_PMF-e1266820957390.png" alt="Triangular Distribution Probability Mass function" width="249" height="187" /></a>(a)<br />
<a href="http://kreese.net/wordpress/wp-content/uploads/2010/02/Triangular_distribution_CMF.png"><img class="size-full wp-image-395" title="Triangular_distribution_CMF" src="http://kreese.net/wordpress/wp-content/uploads/2010/02/Triangular_distribution_CMF-e1266821291415.png" alt="Triangular Distribution Cumulative Distribution Function" width="249" height="187" /></a>(b)<br />
<p class="wp-caption-text">A plot of a Continuous Triangular Distribution (a) Probability Mass Function and (b) Cumulative Distribution Function.</p></div>
<p><strong>Binomial Distribution</strong> is a distribution of the number of sequences of trials in an experiment which contains only two possible outcomes (success/failure, true/false, etc.).  This distribution is associated with Bernoulli Trials and when parameter n = 1, we can call this distribution a <strong>Bernoulli Distribution</strong>.  The Binomial Distribution has three parameters:</p>
<p style="text-align: center;"><img src='http://s.wordpress.com/latex.php?latex=n%20%5Cin%20%5Cmathbb%7BN%7D%5Ctext%20%7B%20-%20number%20of%20trials%7D%20%20%5C%5C%20p%20%5Cin%20%5B0%2C1%5D%20%5C%5C%20k%20%5Cin%20%5Cleft%20%5C%7B%200%2C%20%5Cldots%2C%20n%20%5Cright%20%5C%7D&#038;bg=ffffff&#038;fg=000000&#038;s=0' alt='n \in \mathbb{N}\text { - number of trials}  \\ p \in [0,1] \\ k \in \left \{ 0, \ldots, n \right \}' title='n \in \mathbb{N}\text { - number of trials}  \\ p \in [0,1] \\ k \in \left \{ 0, \ldots, n \right \}' class='latex' /></p>
<p style="text-align: left;">We can find the PMF and the CDF to be:</p>
<p style="text-align: center;"><img src='http://s.wordpress.com/latex.php?latex=pmf%20%3D%20%5Cbinom%7Bn%7D%7Bk%7D%20p%5E%7Bk%7D%281-p%29%5E%7Bn-k%7D%20%5C%5C%5C%5C%20cdf%20%3D%20%5Csum_%7Bi%3D0%7D%5E%7B%5Cleft%20%5Clfloor%20x%20%5Cright%20%5Crfloor%7D%5Cbinom%7Bn%7D%7Bi%7Dp%5E%7Bi%7D%281-p%29%5E%7Bn-i%7D&#038;bg=ffffff&#038;fg=000000&#038;s=0' alt='pmf = \binom{n}{k} p^{k}(1-p)^{n-k} \\\\ cdf = \sum_{i=0}^{\left \lfloor x \right \rfloor}\binom{n}{i}p^{i}(1-p)^{n-i}' title='pmf = \binom{n}{k} p^{k}(1-p)^{n-k} \\\\ cdf = \sum_{i=0}^{\left \lfloor x \right \rfloor}\binom{n}{i}p^{i}(1-p)^{n-i}' class='latex' /></p>
<p style="text-align: left;">we define <img src='http://s.wordpress.com/latex.php?latex=%5Cbinom%7Bn%7D%7Bk%7D&#038;bg=ffffff&#038;fg=000000&#038;s=0' alt='\binom{n}{k}' title='\binom{n}{k}' class='latex' /> to be the binomial coefficient which we can define as:</p>
<p style="text-align: center;"><img src='http://s.wordpress.com/latex.php?latex=%5Cbinom%7Bn%7D%7Bk%7D%20%3D%20%5Cfrac%7Bn%21%7D%7Bk%21%28n-k%29%21%7D&#038;bg=ffffff&#038;fg=000000&#038;s=0' alt='\binom{n}{k} = \frac{n!}{k!(n-k)!}' title='\binom{n}{k} = \frac{n!}{k!(n-k)!}' class='latex' /></p>
<p style="text-align: left;">The resulting PMF and CDF graphs might look like (with the same parameters) Figure 3a &amp; Figure 3b respectively:</p>
<div id="attachment_408" class="wp-caption aligncenter" style="width: 260px"><a href="http://kreese.net/wordpress/wp-content/uploads/2010/02/Discrete-Binomial-PDF.jpg"><img class="size-full wp-image-408" title="Discrete Binomial PDF" src="http://kreese.net/wordpress/wp-content/uploads/2010/02/Discrete-Binomial-PDF-e1266823496172.jpg" alt="Discrete Binomial Probability Mass Function" width="250" height="192" /></a>(a)<br />
<a href="http://kreese.net/wordpress/wp-content/uploads/2010/02/Discrete-Binomial-CDF.jpg"><img class="size-full wp-image-409" title="Discrete Binomial CDF" src="http://kreese.net/wordpress/wp-content/uploads/2010/02/Discrete-Binomial-CDF-e1266823721319.jpg" alt="Discrete Binomial Cumulative Distribution Function" width="250" height="189" /></a>(b)<br />
<p class="wp-caption-text">A plot of the Discrete Binomial distribution (a) Probability Mass Function and (b) Cumulative Distribution Function.  n = 5, p = 0.5</p></div>
<p><strong>Exponential Distribution</strong> is a continuous probability distribution that is frequently used in Simulations.  Though it is considered a class of continuous distributions, discretizing the distribution does not take a lot of effort.  The exponential function is always bounded between [0,∞) and has one parameter:</p>
<p style="text-align: center;"><img src='http://s.wordpress.com/latex.php?latex=%5Clambda%20%3D%20%5CRe%20%3E%200&#038;bg=ffffff&#038;fg=000000&#038;s=0' alt='\lambda = \Re &gt; 0' title='\lambda = \Re &gt; 0' class='latex' /></p>
<p style="text-align: left;">Using this parameter, we can solve the PMF and CDF for any exponential distribution:</p>
<p style="text-align: center;"><img src='http://s.wordpress.com/latex.php?latex=%5Ctext%20%7Bpmf%7D%20%3D%20%5Clambda%20e%5E%7B-%5Clambda%20x%7D%20%5C%5C%20%5C%5C%20%5Ctext%20%7Bcdf%7D%20%3D%201-e%5E%7B-%5Clambda%20x%7D&#038;bg=ffffff&#038;fg=000000&#038;s=0' alt='\text {pmf} = \lambda e^{-\lambda x} \\ \\ \text {cdf} = 1-e^{-\lambda x}' title='\text {pmf} = \lambda e^{-\lambda x} \\ \\ \text {cdf} = 1-e^{-\lambda x}' class='latex' /></p>
<p style="text-align: left;">Plotting these functions will result in graphs that look like (with the same parameters):</p>
<p style="text-align: left;">
<div id="attachment_420" class="wp-caption aligncenter" style="width: 260px"><a href="http://kreese.net/wordpress/wp-content/uploads/2010/02/Discrete-Exponential-PDF.jpg"><img class="size-full wp-image-420" title="Discrete Exponential PDF" src="http://kreese.net/wordpress/wp-content/uploads/2010/02/Discrete-Exponential-PDF-e1266826732115.jpg" alt="Exponential Distribution Probability Mass Function" width="250" height="193" /></a>(a)<br />
<a href="http://kreese.net/wordpress/wp-content/uploads/2010/02/Discrete-Exponential-CDF-e1266826819866.jpg"><img class="size-full wp-image-421" title="Discrete Exponential CDF" src="http://kreese.net/wordpress/wp-content/uploads/2010/02/Discrete-Exponential-CDF-e1266826819866.jpg" alt="Exponential Distribution Cumulative Distribution Function" width="250" height="192" /></a>(b)<br />
<p class="wp-caption-text">A plot of a Continuous Exponential Distribution (a) Probability Mass Function and (b) Cumulative Distribution Function. λ = 0.4</p></div>
<p><strong>Poisson Distribution</strong> will be the last distribution discussed in this entry.  This distribution can be used to express a probability of a number of events occurring within a fixed period of time, assuming that these events occur with an average rate and the events are independently from other events.  The Poisson Distribution functions have two parameters:</p>
<p style="text-align: center;"><img src='http://s.wordpress.com/latex.php?latex=%5Clambda%20%3D%20%5Cmathbb%7BN%7D%20%3E%200%20%5C%5C%20k%20%5Cin%20%5Cmathbb%7BN%7D%20%5Cgeq%200&#038;bg=ffffff&#038;fg=000000&#038;s=0' alt='\lambda = \mathbb{N} &gt; 0 \\ k \in \mathbb{N} \geq 0' title='\lambda = \mathbb{N} &gt; 0 \\ k \in \mathbb{N} \geq 0' class='latex' /></p>
<p style="text-align: left;">The PMF and CDF are, respectively:</p>
<p style="text-align: center;"><img src='http://s.wordpress.com/latex.php?latex=%5Ctext%20%7Bpmf%7D%20%3D%20%5Cfrac%7B%5Clambda%5E%7Bk%7D%7D%7Bk%21%7D%5C%3B%5Ccdot%5C%3Be%5E%7B-%5Clambda%7D%20%5C%5C%20%5C%5C%20%5Ctext%20%7Bcdf%7D%20%3D%20e%5E%7B-%5Clambda%7D%5Csum_%7Bi%3D0%7D%5E%7Bk%7D%5Cfrac%7B%5Clambda%5E%7Bi%7D%7D%7Bi%21%7D&#038;bg=ffffff&#038;fg=000000&#038;s=0' alt='\text {pmf} = \frac{\lambda^{k}}{k!}\;\cdot\;e^{-\lambda} \\ \\ \text {cdf} = e^{-\lambda}\sum_{i=0}^{k}\frac{\lambda^{i}}{i!}' title='\text {pmf} = \frac{\lambda^{k}}{k!}\;\cdot\;e^{-\lambda} \\ \\ \text {cdf} = e^{-\lambda}\sum_{i=0}^{k}\frac{\lambda^{i}}{i!}' class='latex' /></p>
<p style="text-align: left;">It is interesting to note that as λ moves towards sufficiently large values, a normal distribution with a mean and variance of λ and a standard deviation of <img src='http://s.wordpress.com/latex.php?latex=%5Csqrt%7B%5Clambda%7D&#038;bg=ffffff&#038;fg=000000&#038;s=0' alt='\sqrt{\lambda}' title='\sqrt{\lambda}' class='latex' /> will decently approximate the Poisson distribution.  If we plot the PDF and CDF for the Poisson Distribution, we get a graph that would look like (with the same parameters):</p>
<p style="text-align: left;">
<div id="attachment_417" class="wp-caption aligncenter" style="width: 260px"><a href="http://kreese.net/wordpress/wp-content/uploads/2010/02/Discrete-Poisson-PDF.jpg"><img class="size-full wp-image-417" title="Discrete Poisson PDF" src="http://kreese.net/wordpress/wp-content/uploads/2010/02/Discrete-Poisson-PDF-e1266825497541.jpg" alt="Poisson Distribution Probability Mass Function" width="250" height="186" /></a>(a)<br />
<a href="http://kreese.net/wordpress/wp-content/uploads/2010/02/Discrete-Poisson-CDF.jpg"><img class="size-full wp-image-418" title="Discrete Poisson CDF" src="http://kreese.net/wordpress/wp-content/uploads/2010/02/Discrete-Poisson-CDF-e1266825687890.jpg" alt="Poisson Distribution Cumulative Distribution Function" width="250" height="191" /></a>(b)<br />
<p class="wp-caption-text">A plot of the the Discrete Poisson Distribution (a) Probability Mass Function and (b) Cumulative Distribution Function. λ = 4</p></div>
<p>These are only a handful of possible distributions that could result from simulation outcomes, but these are probably the most frequently encountered distributions.  More distributions will be touched on in future posts.  If you have one you&#8217;d like me to discuss or go into more detail about, leave a comment!</p>
]]></content:encoded>
			<wfw:commentRss>http://kreese.net/index.php/2010/02/discrete-statistical-distributions/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Analyzing Simulation Data</title>
		<link>http://kreese.net/index.php/2010/02/analyzing-simulation-data/</link>
		<comments>http://kreese.net/index.php/2010/02/analyzing-simulation-data/#comments</comments>
		<pubDate>Sun, 21 Feb 2010 10:57:07 +0000</pubDate>
		<dc:creator>Kristopher Reese</dc:creator>
				<category><![CDATA[Simulations]]></category>
		<category><![CDATA[Statistics]]></category>
		<category><![CDATA[Mean Inter-Arrival Time]]></category>
		<category><![CDATA[Mean Number of Jobs]]></category>
		<category><![CDATA[Mean Service Time]]></category>
		<category><![CDATA[Mean Wait Time]]></category>
		<category><![CDATA[Server Utilization]]></category>

		<guid isPermaLink="false">http://kreese.net/?p=349</guid>
		<description><![CDATA[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 [...]]]></description>
			<content:encoded><![CDATA[<p>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:</p>
<table>
<thead>
<tr>
<th valign="middle"><strong>Customer</strong></th>
<th valign="middle"><strong>Inter-arrival Time</strong></th>
<th valign="middle"><strong>Arrival Time</strong></th>
<th valign="middle"><strong>Service Time</strong></th>
<th valign="middle"><strong>Begin Service</strong></th>
<th valign="middle"><strong>Wait Time</strong></th>
<th valign="middle"><strong>End Service</strong></th>
<th valign="middle"><strong>Time in System</strong></th>
<th valign="middle"><strong>Server Idle</strong></th>
</tr>
</thead>
<tbody>
<tr>
<td style="text-align: center;" valign="middle">1</td>
<td style="text-align: center;" valign="middle">-</td>
<td style="text-align: center;" valign="middle">0</td>
<td style="text-align: center;" valign="middle">3.3</td>
<td style="text-align: center;" valign="middle">0</td>
<td style="text-align: center;" valign="middle">0</td>
<td style="text-align: center;" valign="middle">3.3</td>
<td style="text-align: center;" valign="middle">3.3</td>
<td style="text-align: center;" valign="middle">0</td>
</tr>
<tr>
<td style="text-align: center;" valign="middle">2</td>
<td style="text-align: center;" valign="middle">5.1</td>
<td style="text-align: center;" valign="middle">5.1</td>
<td style="text-align: center;" valign="middle">4.5</td>
<td style="text-align: center;" valign="middle">5.1</td>
<td style="text-align: center;" valign="middle">0</td>
<td style="text-align: center;" valign="middle">9.5</td>
<td style="text-align: center;" valign="middle">4.5</td>
<td style="text-align: center;" valign="middle">1.8</td>
</tr>
<tr>
<td style="text-align: center;" valign="middle">3</td>
<td style="text-align: center;" valign="middle">3.9</td>
<td style="text-align: center;" valign="middle">9.0</td>
<td style="text-align: center;" valign="middle">3.2</td>
<td style="text-align: center;" valign="middle">9.6</td>
<td style="text-align: center;" valign="middle">0.6</td>
<td style="text-align: center;" valign="middle">12.8</td>
<td style="text-align: center;" valign="middle">3.8</td>
<td style="text-align: center;" valign="middle">0</td>
</tr>
<tr>
<td style="text-align: center;" valign="middle">4</td>
<td style="text-align: center;" valign="middle">4.5</td>
<td style="text-align: center;" valign="middle">13.5</td>
<td style="text-align: center;" valign="middle">4.8</td>
<td style="text-align: center;" valign="middle">13.5</td>
<td style="text-align: center;" valign="middle">0</td>
<td style="text-align: center;" valign="middle">18.3</td>
<td style="text-align: center;" valign="middle">4.8</td>
<td style="text-align: center;" valign="middle">0.7</td>
</tr>
<tr>
<td style="text-align: center;" valign="middle">5</td>
<td style="text-align: center;" valign="middle">4.4</td>
<td style="text-align: center;" valign="middle">17.9</td>
<td style="text-align: center;" valign="middle">4.9</td>
<td style="text-align: center;" valign="middle">18.3</td>
<td style="text-align: center;" valign="middle">0.4</td>
<td style="text-align: center;" valign="middle">23.2</td>
<td style="text-align: center;" valign="middle">5.3</td>
<td style="text-align: center;" valign="middle">0</td>
</tr>
<tr>
<td style="text-align: center;" valign="middle">6</td>
<td style="text-align: center;" valign="middle">5.6</td>
<td style="text-align: center;" valign="middle">23.5</td>
<td style="text-align: center;" valign="middle">4.8</td>
<td style="text-align: center;" valign="middle">23.5</td>
<td style="text-align: center;" valign="middle">0</td>
<td style="text-align: center;" valign="middle">28.3</td>
<td style="text-align: center;" valign="middle">4.8</td>
<td style="text-align: center;" valign="middle">0.3</td>
</tr>
<tr>
<td style="text-align: center;" valign="middle">7</td>
<td style="text-align: center;" valign="middle">4.1</td>
<td style="text-align: center;" valign="middle">27.6</td>
<td style="text-align: center;" valign="middle">3.1</td>
<td style="text-align: center;" valign="middle">28.3</td>
<td style="text-align: center;" valign="middle">0.7</td>
<td style="text-align: center;" valign="middle">31.4</td>
<td style="text-align: center;" valign="middle">3.8</td>
<td style="text-align: center;" valign="middle">0</td>
</tr>
<tr>
<td style="text-align: center;" valign="middle">8</td>
<td style="text-align: center;" valign="middle">4.2</td>
<td style="text-align: center;" valign="middle">31.8</td>
<td style="text-align: center;" valign="middle">3.2</td>
<td style="text-align: center;" valign="middle">31.8</td>
<td style="text-align: center;" valign="middle">0</td>
<td style="text-align: center;" valign="middle">35</td>
<td style="text-align: center;" valign="middle">3.2</td>
<td style="text-align: center;" valign="middle">0.4</td>
</tr>
</tbody>
</table>
<p>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.</p>
<p><strong>Mean Service Time.</strong> The following equation can be used for determining the mean service time of the customers.</p>
<p style="text-align: center;"><img src='http://s.wordpress.com/latex.php?latex=%5Cbar%7B%5Cmathrm%7Bst%7D%7D%20%3D%20%5Cfrac%7B%5Csum%20%5Ctext%20%7BService%20Times%7D%7D%7B%5Ctext%20%7BTotal%20Customers%7D%7D&#038;bg=ffffff&#038;fg=000000&#038;s=0' alt='\bar{\mathrm{st}} = \frac{\sum \text {Service Times}}{\text {Total Customers}}' title='\bar{\mathrm{st}} = \frac{\sum \text {Service Times}}{\text {Total Customers}}' class='latex' /></p>
<p>For our given example, we get:</p>
<p style="text-align: center;"><img src='http://s.wordpress.com/latex.php?latex=%5Cbar%7B%5Cmathrm%7Bst%7D%7D%20%3D%20%5Cfrac%7B31.8%7D%7B8%7D%20%3D%203.975&#038;bg=ffffff&#038;fg=000000&#038;s=0' alt='\bar{\mathrm{st}} = \frac{31.8}{8} = 3.975' title='\bar{\mathrm{st}} = \frac{31.8}{8} = 3.975' class='latex' /></p>
<p><strong>Mean Inter-Arrival Time.</strong> The following equation can be used for determining the mean inter-arrival time of the customers.</p>
<p style="text-align: center;"><img src='http://s.wordpress.com/latex.php?latex=%5Cbar%7B%5Cmathrm%7Bia%7D%7D%20%3D%20%5Cfrac%7B%5Csum%20%5Ctext%20%7BInter-Arrival%20Time%7D%7D%7B%5Ctext%20%7BTotal%20Customers%7D%7D&#038;bg=ffffff&#038;fg=000000&#038;s=0' alt='\bar{\mathrm{ia}} = \frac{\sum \text {Inter-Arrival Time}}{\text {Total Customers}}' title='\bar{\mathrm{ia}} = \frac{\sum \text {Inter-Arrival Time}}{\text {Total Customers}}' class='latex' /></p>
<p>For our example, we would get:</p>
<p style="text-align: center;"><img src='http://s.wordpress.com/latex.php?latex=%5Cbar%7B%5Cmathrm%7Bia%7D%7D%20%3D%20%5Cfrac%7B31.8%7D%7B7%7D%20%3D%204.54&#038;bg=ffffff&#038;fg=000000&#038;s=0' alt='\bar{\mathrm{ia}} = \frac{31.8}{7} = 4.54' title='\bar{\mathrm{ia}} = \frac{31.8}{7} = 4.54' class='latex' /></p>
<p><strong>Mean Wait Time. </strong> 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:</p>
<p style="text-align: center;"><img src='http://s.wordpress.com/latex.php?latex=%5Ctext%20%7BMean%20Wait%20Time%20for%20all%7D%20%3D%20%5Cfrac%7B%5Csum%20%5Ctext%20%7BWaiting%20Time%7D%7D%7B%5Ctext%20%7BTotal%20Customers%7D%7D&#038;bg=ffffff&#038;fg=000000&#038;s=0' alt='\text {Mean Wait Time for all} = \frac{\sum \text {Waiting Time}}{\text {Total Customers}}' title='\text {Mean Wait Time for all} = \frac{\sum \text {Waiting Time}}{\text {Total Customers}}' class='latex' /></p>
<p>For our example the mean wait time of all customers is:</p>
<p style="text-align: center;"><img src='http://s.wordpress.com/latex.php?latex=%5Ctext%20%7BMean%20Wait%20Time%20for%20all%7D%20%3D%20%5Cfrac%7B1.7%7D%7B8%7D%20%3D%200.21&#038;bg=ffffff&#038;fg=000000&#038;s=0' alt='\text {Mean Wait Time for all} = \frac{1.7}{8} = 0.21' title='\text {Mean Wait Time for all} = \frac{1.7}{8} = 0.21' class='latex' /></p>
<p>In contrast, the mean wait time for only the customers who waited is:</p>
<p style="text-align: center;"><img src='http://s.wordpress.com/latex.php?latex=%5Ctext%20%7BMean%20Wait%20Time%20for%20waiters%7D%20%3D%20%5Cfrac%7B1.7%7D%7B3%7D%20%3D%200.57&#038;bg=ffffff&#038;fg=000000&#038;s=0' alt='\text {Mean Wait Time for waiters} = \frac{1.7}{3} = 0.57' title='\text {Mean Wait Time for waiters} = \frac{1.7}{3} = 0.57' class='latex' /></p>
<p><strong>Server Utilization.</strong> 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:</p>
<p style="text-align: center;"><img src='http://s.wordpress.com/latex.php?latex=%5Ctext%20%7BServer%20Utilization%7D%20%3D%201%20-%20%5Cfrac%7B%5Csum%20%5Ctext%20%7Bserver%20idle%7D%7D%7B%5Ctext%20%7BTotal%20Time%7D%7D&#038;bg=ffffff&#038;fg=000000&#038;s=0' alt='\text {Server Utilization} = 1 - \frac{\sum \text {server idle}}{\text {Total Time}}' title='\text {Server Utilization} = 1 - \frac{\sum \text {server idle}}{\text {Total Time}}' class='latex' /></p>
<p>For our example, we get:</p>
<p style="text-align: center;"><img src='http://s.wordpress.com/latex.php?latex=%5Ctext%20%7BServer%20Utilization%7D%20%3D%201%20-%20%5Cfrac%7B3.2%7D%7B35.0%7D%20%3D%201%20-%200.091%20%3D%200.908%20%5Capprox%2091%5C%25&#038;bg=ffffff&#038;fg=000000&#038;s=0' alt='\text {Server Utilization} = 1 - \frac{3.2}{35.0} = 1 - 0.091 = 0.908 \approx 91\%' title='\text {Server Utilization} = 1 - \frac{3.2}{35.0} = 1 - 0.091 = 0.908 \approx 91\%' class='latex' /></p>
<p><strong>Mean Number of Customers in System.</strong> 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:</p>
<p style="text-align: center;"><img src='http://s.wordpress.com/latex.php?latex=%5Crho%20%3D%20%5Cfrac%20%7B%5Clambda%7D%7B%5Cmu%7D&#038;bg=ffffff&#038;fg=000000&#038;s=0' alt='\rho = \frac {\lambda}{\mu}' title='\rho = \frac {\lambda}{\mu}' class='latex' /></p>
<p>With ρ we can find the Mean number of Customers in the system with the following equation:</p>
<p style="text-align: center;"><img src='http://s.wordpress.com/latex.php?latex=E%5Bn%5D%3D%5Cfrac%20%7B%5Crho%7D%7B%281-%5Crho%29%7D&#038;bg=ffffff&#038;fg=000000&#038;s=0' alt='E[n]=\frac {\rho}{(1-\rho)}' title='E[n]=\frac {\rho}{(1-\rho)}' class='latex' /></p>
<p>Therefore for our example, we can define ρ as and then solve the Mean Number of Customers in the System:</p>
<p style="text-align: center;"><img src='http://s.wordpress.com/latex.php?latex=%5Crho%20%3D%20%5Cfrac%20%7B4.54%7D%7B3.98%7D%20%3D%201.14&#038;bg=ffffff&#038;fg=000000&#038;s=0' alt='\rho = \frac {4.54}{3.98} = 1.14' title='\rho = \frac {4.54}{3.98} = 1.14' class='latex' /></p>
<p style="text-align: center;"><img src='http://s.wordpress.com/latex.php?latex=E%5Bn%5D%3D%5Cfrac%20%7B1.14%7D%7B%281-1.14%29%7D%20%3D%20%5Cfrac%20%7B1.14%7D%7B%280.14%29%7D%20%5Capprox%208&#038;bg=ffffff&#038;fg=000000&#038;s=0' alt='E[n]=\frac {1.14}{(1-1.14)} = \frac {1.14}{(0.14)} \approx 8' title='E[n]=\frac {1.14}{(1-1.14)} = \frac {1.14}{(0.14)} \approx 8' class='latex' /></p>
<p>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.</p>
]]></content:encoded>
			<wfw:commentRss>http://kreese.net/index.php/2010/02/analyzing-simulation-data/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Introduction to Simulations</title>
		<link>http://kreese.net/index.php/2010/02/introduction-to-simulations/</link>
		<comments>http://kreese.net/index.php/2010/02/introduction-to-simulations/#comments</comments>
		<pubDate>Sun, 21 Feb 2010 07:59:58 +0000</pubDate>
		<dc:creator>Kristopher Reese</dc:creator>
				<category><![CDATA[Simulations]]></category>
		<category><![CDATA[Discrete-Event]]></category>
		<category><![CDATA[Simulation]]></category>

		<guid isPermaLink="false">http://kreese.net/?p=345</guid>
		<description><![CDATA[Simulations are an important tool in computer scientists&#8217; arsenal.  It allows a scientist to statistically analyze a designed experiment with only a fraction of the cost of implementing a final system.
In simulations of systems, be it computer performance analysis or protein folding, there are two major classes of simulations: Discrete-Event Simulations and Continuous Simulations. [...]]]></description>
			<content:encoded><![CDATA[<p>Simulations are an important tool in computer scientists&#8217; arsenal.  It allows a scientist to statistically analyze a designed experiment with only a fraction of the cost of implementing a final system.</p>
<p>In simulations of systems, be it computer performance analysis or protein folding, there are two major classes of simulations: Discrete-Event Simulations and Continuous Simulations.  A Continuous Simulation is a simulation in which the state variables changes continuously over the designated time that the simulation is run.  In contrast, a Discrete-Event Simulation is a simulation in which the state variable of the system change only at discrete points in time.</p>
<p>The majority of the posts about Simulations on this site will discuss Discrete-Event Simulations, though many of the equations and statistical concepts could be used with analysis of Continuous Simulations with only minor changes.  The rest of this post will outline the advantages and disadvantages of simulation, as well as a list of common mistakes in simulation.</p>
<h3>Advantages/Disadvantages</h3>
<p>Before listing some of the advantages and Disadvantages, we must first know when simulation is appropriate and when simulation is likely to not be appropriate to a situation.  Though Simulations are a powerful tool, in many situations a common sense solution can be reached or in some cases can often by solved analytically using formulae related to the model.  In some cases, we may run into a lack of data for the model, in which case the model may be difficult to simulate.  We may also run into a few rare cases of the cost/benefit of the simulation to hold no significant value.  However, simulations can often be applied to a multitude of situations including: The study of complex systems or subsystems, the knowledge that would be gained by the simulation holds significant value, to study the effects of changing inputs, to determine possible system requirements (for example, software), to train humans or intelligent machines, visualization of systems, and of course many other topic.  The following lists are shortened versions from [1]</p>
<p><strong>Advantages.</strong> A simulation can lead to discovery of new models or systems.  Some of the advantages that using simulation is to:</p>
<ul>
<li>Explore new options without disrupting the current operation of a system.</li>
<li>It has significantly lower cost in comparison to implementing a final system before testing.</li>
<li>We can simulate a larger amount of time in a shorter period using simulations, known as time-warping.</li>
<li>It allows us the study the interactions or importance of variables in the system</li>
<li>It allows us to study various &#8220;what if&#8230;&#8221; conditions</li>
<li>and, it helps scientists or engineers to develop a model that helps understand the system better.</li>
</ul>
<p><strong>Disadvatages.</strong> Despite the significant advantages, there are a handful of disadvantages that should be considered before implementing a simulation for your needs.</p>
<ul>
<li>Implementing a simulation takes time and often this results in a company spending more money to hire the necessary designers for the simulation.</li>
<li>Simulation is an art.  The results of a simulation are highly variable, often based on the skill of the designer.</li>
<li>Analysis of simulation results can often be difficult unless programmed correctly.  This again relates to Simulation being an art.</li>
</ul>
<h3>Common Mistakes in Simulation</h3>
<p>This section discusses some of the aspects that have to be overcome and what makes Simulation more of an art.  The list below is a simplified version of the list of common mistakes in [2]</p>
<ol>
<li><em>Inappropriate Level of Detail</em>: Without the proper level of detail within the simulation could result in the failure of the simulation or inaccurate results in comparison to the model being tested.  However in order to do a proper analysis of the data for the model, we have to make some simplifications and assumptions.  The difficulty lies in capturing the proper level of detail while simplifying the model well enough to analyze the data received from the simulation.</li>
<li><em>Improper Language</em>:  A simulation can be designed in almost any programming language, however choosing the proper programming language has a significant impact on the development time of the model.  Many languages can cut development times significantly, and some can even make analysis of the data significantly easier for the developer.</li>
<li><em>Unverified Models</em>: Simulation models are often implemented with large programs.  The developer has to take special care to ensure that there are no bugs or programming errors which might invalidate the results of the Simulation.</li>
<li><em>Invalid Models</em>:  Incorrect of assumptions about the system could result in invalidated data even with a flawless program.</li>
<li><em>Improperly Handled Initial Conditions</em>:  Including the initial portion of the simulation could result in non-representative data of the system.  To avoid this, one should give the simulation the required burn-in period for the data to converge on data that is representative of the system.</li>
<li><em>Too Short Simulations</em>:  Often times, the Analyst will try to save time by running the system within a shorter period of time.  Related to item 5, this can result in data that is non-representative of the systems data.</li>
<li><em>Poor Random-Number Generators</em>: Random Numbers are an important aspect of simulations.  It is often better to use a well known generator, however in some cases, the generators may not work for your simulation.  Generating random numbers will be discussed in a future post.</li>
<li><em>Improper Selection of Seeds</em>: Seeding the random number generator is important to maintain independence among the streams in the simulation.  In many cases, using the same seed in the streams may result in correlation among each of the system processes which might result in non-representative data.</li>
</ol>
<h3>References</h3>
<p>[1] J.Banks, J.Carson, B. Nelson, and D. Nicol <span style="text-decoration: underline;">Discrete-Event System Simulation</span> New Jersey: Prentice Hall, 2005.</p>
<p>[2] R.Jain, <span style="text-decoration: underline;">The Art of Computer Systems Performance Analysis</span> New York: Wiley, 1991.</p>
]]></content:encoded>
			<wfw:commentRss>http://kreese.net/index.php/2010/02/introduction-to-simulations/feed/</wfw:commentRss>
		<slash:comments>2</slash:comments>
		</item>
		<item>
		<title>kReese.net in 2010</title>
		<link>http://kreese.net/index.php/2010/01/kreese-net-in-2010/</link>
		<comments>http://kreese.net/index.php/2010/01/kreese-net-in-2010/#comments</comments>
		<pubDate>Mon, 18 Jan 2010 08:06:41 +0000</pubDate>
		<dc:creator>Kristopher Reese</dc:creator>
				<category><![CDATA[Site Updates]]></category>
		<category><![CDATA[kReese.net]]></category>
		<category><![CDATA[plugins]]></category>
		<category><![CDATA[wordpress]]></category>

		<guid isPermaLink="false">http://kreese.net/?p=101</guid>
		<description><![CDATA[After spending a majority of the last few months of 2009 working on updating my site to make it easier to update, I finally caved in and decided to use Wordpress instead of programming my own site.  It took me a while to cave in simply because of the enjoyment I get from programming [...]]]></description>
			<content:encoded><![CDATA[<p>After spending a majority of the last few months of 2009 working on updating my site to make it easier to update, I finally caved in and decided to use Wordpress instead of programming my own site.  It took me a while to cave in simply because of the enjoyment I get from programming my site.  But by using Wordpress, I saved time with coding so that I can focus on schoolwork and content on the site.  I look forward to finally getting more time to write on the blog rather than having to program new information.</p>
<p>Using Wordpress has its advantages!  Here&#8217;s a list of plugins that I&#8217;ve used on this version of the site:</p>
<ol>
<li>Akismet (Spam) &#8211; created by <a title="Visit author homepage" href="http://ma.tt/">Matt Mullenweg</a></li>
<li>Clean-contact (Contact Form) &#8211; created by <a title="Visit author homepage" href="http://www.monkeytreelabs.com/">Monkey Tree Labs</a></li>
<li>Delete-Revision (Revision Management) &#8211; created by <a title="Visit author homepage" href="http://gohsy.com/">gohsy</a></li>
<li>EG-Attachements (Document Library) &#8211; created by <a title="Visit author homepage" href="http://www.emmanuelgeorjon.com/">Emmanuel GEORJON</a></li>
<li>Google XML Sitemaps (Site Map Generator) &#8211; created by <a title="Visit author homepage" href="http://www.arnebrachhold.de/">Arne Brachhold</a></li>
<li>ICS Calendar (Events Calendar) &#8211; created by <a href="http://www.fullimpact.net/">Daniel Olfelt</a></li>
<li>Multi-level Navigation Plugin (Main Navigation) &#8211; created by <a title="Visit author homepage" href="http://pixopoint.com/">PixoPoint Web Development / Ryan Hellyer</a></li>
<li>Recent Posts &#8211; created by <a title="Visit author homepage" href="http://nickmomrik.com/">Nick Momrik</a></li>
<li>Sticky Menu (Secondary Navigation) &#8211; created by <a title="Visit author homepage" href="http://tela-web.com/">ericdes</a></li>
<li>WP-Cache (Page Caching) &#8211; created by <a title="Visit author homepage" href="http://mnm.uib.es/gallir/">Ricardo Galli Granada</a></li>
<li>WP-DBManger (Database Management) &#8211; created by <a title="Visit author homepage" href="http://lesterchan.net/">Lester &#8216;GaMerZ&#8217; Chan</a></li>
<li><a title="Visit author homepage" href="http://mnm.uib.es/gallir/"></a>WP-Syntax (Code Syntax Highlighting) &#8211; created by <a title="Visit author homepage" href="http://ryan.mcgeary.org/">Ryan McGeary</a></li>
<li>WP Photo Album (Photo Albums) &#8211; created by <a title="Visit author homepage" href="http://me.mywebsight.ws/">Rubin J. Kaplan</a></li>
</ol>
<p>Despite this, there are a few plugins that I had to create myself.  This includes plugins for editing a Curriculum Vitae and creating document repositories.  The theme itself was created by me specifically for kReese.net.  As these plugins and themes become more stable, I will link to these through my website.</p>
]]></content:encoded>
			<wfw:commentRss>http://kreese.net/index.php/2010/01/kreese-net-in-2010/feed/</wfw:commentRss>
		<slash:comments>2</slash:comments>
		</item>
	</channel>
</rss>

<!-- Dynamic Page Served (once) in 0.624 seconds -->
