Poisson Probability Distribution Using R
Experiment
Poisson Probability Distribution Using R
1. Aim
To study and implement the Poisson probability distribution in R by calculating individual and cumulative probabilities, generating the probability distribution, finding its mean and variance, and visualizing the distribution.
2. Objectives
After completing this experiment, students should be able to:
- Understand the concept and characteristics of the Poisson distribution.
- Identify the parameter of a Poisson distribution.
- Calculate the probability of a specified number of events manually.
- Calculate Poisson probabilities using R.
- Calculate cumulative probabilities.
- Generate the complete Poisson probability distribution.
- Calculate the mean, variance, and standard deviation.
- Visualize and interpret the Poisson distribution.
3. Theory
3.1 Poisson Distribution
The Poisson distribution is a discrete probability distribution used to model the number of times an event occurs in a fixed interval of time, distance, area, or volume, when the events occur independently and at a relatively constant average rate.
Examples include:
- Number of customers arriving at a bank in one hour
- Number of calls received by a call center in one minute
- Number of defects in a length of manufactured material
- Number of accidents at a particular intersection in a day
- Number of emails received in an hour
If represents the number of occurrences of an event in a fixed interval, then:
where is the average number of occurrences in that interval.
3.2 Conditions for Poisson Distribution
A Poisson distribution is appropriate when:
- The number of occurrences is counted in a fixed interval.
- Events occur independently.
- The average rate of occurrence is approximately constant.
- Two events do not occur at exactly the same instant in the theoretical model.
- The probability of an occurrence in a very small interval is proportional to the size of that interval.
3.3 Poisson Probability Formula
The probability of exactly occurrences is:
where:
- = average number of occurrences
- = factorial of
4. Problem Statement
A computer server receives an average of 4 requests per minute.
Assume that the requests occur independently and the average rate remains constant.
Let:
Therefore:
Using the Poisson distribution:
- Calculate the probability of receiving exactly 3 requests in one minute.
- Calculate the probability of receiving at most 3 requests in one minute.
- Calculate the probability of receiving at least 3 requests in one minute.
- Generate the complete probability distribution for .
- Calculate the mean, variance, and standard deviation.
- Plot the Poisson probability distribution.
- Interpret the results.
5. Manual Calculation
5.1 Probability of Exactly 3 Requests
Given:
and
Using the Poisson formula:
Since:
and
we get:
Using:
we get:
Therefore:
or approximately 19.54%.
5.2 Probability of At Most 3 Requests
"At most 3" means:
Therefore:
Using the Poisson formula:
For
For
For
For
Therefore:
or approximately 43.35%.
5.3 Probability of At Least 3 Requests
"At least 3" means:
Using the complement:
We have:
Therefore:
or approximately 76.19%.
6. Mean, Variance and Standard Deviation
One important property of the Poisson distribution is that its mean and variance are both equal to .
Mean
For the given problem:
Variance
Therefore:
Standard Deviation
Therefore:
Thus:
| Measure | Value |
|---|---|
| Mean | 4 |
| Variance | 4 |
| Standard deviation | 2 |
7. R Functions for Poisson Distribution
R provides four important functions for the Poisson distribution:
| R Function | Purpose |
|---|---|
dpois() | Probability of exactly occurrences |
ppois() | Cumulative probability |
qpois() | Quantile for a given probability |
rpois() | Generates random observations |
For example:
dpois(3, lambda = 4)
calculates:
Similarly:
ppois(3, lambda = 4)
calculates:
8. Program
# Poisson Probability Distribution # Parameter lambda <- 4 # Possible number of requests x <- 0:12 # Probability distribution probability <- dpois(x, lambda = lambda) distribution <- data.frame( Requests = x, Probability = probability ) print(distribution) # Probability of exactly 3 requests p_exactly_3 <- dpois(3, lambda = lambda) cat("\nProbability of exactly 3 requests =", p_exactly_3, "\n") # Probability of at most 3 requests p_at_most_3 <- ppois(3, lambda = lambda) cat("Probability of at most 3 requests =", p_at_most_3, "\n") # Probability of at least 3 requests p_at_least_3 <- 1 - ppois(2, lambda = lambda) cat("Probability of at least 3 requests =", p_at_least_3, "\n") # Mean mean_value <- lambda # Variance variance <- lambda # Standard deviation standard_deviation <- sqrt(lambda) cat("\nMean =", mean_value, "\n") cat("Variance =", variance, "\n") cat("Standard Deviation =", standard_deviation, "\n") # Plot the Poisson distribution barplot(probability, names.arg = x, main = "Poisson Probability Distribution", xlab = "Number of Requests per Minute", ylab = "Probability")
9. Expected Result
Requests Probability
1 0 0.0183156389
2 1 0.0732625556
3 2 0.1465251111
4 3 0.1953668148
5 4 0.1953668148
6 5 0.1562934519
7 6 0.1041956346
8 7 0.0595403626
9 8 0.0297701813
10 9 0.0132311917
11 10 0.0052924767
12 11 0.0019245370
13 12 0.0006415123
Probability of exactly 3 requests = 0.1953668
Probability of at most 3 requests = 0.4334701
Probability of at least 3 requests = 0.7618967
Mean = 4
Variance = 4
Standard Deviation = 2 The program also generates the probability of each possible number of requests from 0 to 12 and displays the corresponding Poisson distribution using a bar plot.
10. Interpretation
From the results:
- The probability of receiving exactly 3 requests in one minute is approximately 19.54%.
- The probability of receiving at most 3 requests is approximately 43.35%.
- The probability of receiving at least 3 requests is approximately 76.19%.
- The expected number of requests per minute is 4.
- The variance is also 4, which is a characteristic property of the Poisson distribution.
- The standard deviation is 2.
The bar plot shows that the probabilities are concentrated around the average value of 4 requests per minute.
Comments
Post a Comment