Poisson
Represents the number of events occurring within a fixed interval of time or space. It is used for modeling the number of times an event happens in a given period of time, distance, area, or volume when these events occur with a known constant mean rate and independently of the time since the last event.
Create a new Poisson distribution
Poisson X = Poisson(lambda);
creates a discrete Poisson probability distribution.
Distribution properties:
lambda (λ)
double
Average number of events in the interval (also known as the rate parameter)
E()
double
Returns the expected value of average number of events in the interval.
D()
double
Represents variance, that measures the spread of dispersion of the random variable around its expected value E(X).
P(int k)
double
Probability of observing exactly 𝑘 events in an interval: P(X = k)
P_LT(int k)
double
Probability of observing less than 𝑘 events in an interval: P(X < k)
P_LTE(int k)
double
Probability of observing less than or exactly 𝑘 events in an interval: P(X ≤ k)
P_HT(int k)
double
Probability of observing more than 𝑘 events in an interval: P(X > k) = P(X ≤ k)
P_HTE(int k)
double
Probability of observing more than or exactly 𝑘 events in an interval: P(X ≥ k) = P(X < k)
Example
//Example: A bookstore expects 3 visitors per hour. What's the probability
//of encountering 5 visitors in an hour?
double lambda = 3; //3 visitors per hour
Poisson X = Poisson(lambda);
std::cout << X.P(5) << std::endl; //0.100819
Last updated