DA5. Exponential distribution in real-life¶
Give an example, USING YOUR OWN WORDS (NOT TEXT COPIED FROM THE INTERNET), of how either the Poisson or the Exponential distribution could be used to model something in real life (only one example is necessary). You can give an example in an area that interests you (a list of ideas is below). Give a very rough description of the sample space.
This essay will refer to the same example used in the previous two chapters, the discussion assignments of units 4 and 5. The example evolves around studying the running time of a program that we wrote; the circumstances around the study change every unit according to the question; for this week, we will design a study modelling the Poisson distribution.
According to Yakir, 2011; The Poisson distribution is used to describe the distribution when the data sample is too large or even unbounded (Yakir, 2011, p.71). For the study in hand, the number of times the program will run can not be known when it is created, and it is very large or almost unbounded so that the Poisson distribution can fit our modelling.
We have included a code in our program that reports the running time (consumed time for specific functionality) and other environment variables and saves them to a database. We then chose a random sample of 100 records to study; this sample is included in the attached document under the file name ‘da5.csv’. Numbers in this file are initially distributed in the second week of this course as an example (ex1).
The table includes 100 rows of 2 columns, the process number (PID) and the time consumed (time), and the latter is the column of interest to this study. The study defines success as getting running time exactly less than 165 units of time.
According to Yakir, 2011; the random variable X has a Poisson distribution2 with expectation E(X) = lambda (Yakir, 2011, p.72). So we need to find the variance of Time in our sample. We can find the sample using the formula of variance or using the R function ‘var()’, and we are going to use the latter:
var (da5$Time)
[1] 280.6847
We can store the variance into a variable as:
da5.Time.var = var(da5$Time)
Then we can calculate the success probability of our sample according to the formula presented on page 72 of Yakir, 2011 as ‘dpois(x, E)’ where x is sample space -in our case, it is the sequence of numbers from 0 to 100- and E ix the expectation (or variance) of our sample that we calculated earlier,
dpois( x, E); dpois (0:100, da5.Time.var);
The results are pasted in the image below:
We can also bar plot the results using this command, and the bar is pasted below:
barplot(dpois (0:100, da5.Time.var));
References:
Yakir, B. (2011). Introduction to Statistical Thinking (With R, Without Calculus). Retrieved from http://pluto.huji.ac.il/~msby/StatThink/IntroStat.pdf