A tragedy of statistics in most faculties is how dull it’s made. Teachers spend hours wading through derivations, equations, and theorems, and, once you finally get to the simplest part — applying concepts to actual numbers — it’s with irrelevant, unimaginative examples like rolling dice. Are often “> this is often a shame as stats can be enjoyable if you skip the derivations (which you’ll likely never need) and specialize in using the ideas to unravel interesting problems.

In this article, we’ll cover Poisson Processes and therefore the Poisson distribution, two important probability concepts. After highlighting only the relevant theory, we’ll run through a real-world example, showing equations and graphs to place the ideas during a proper context.

## Poisson Process

A Poisson Process may be a model for a series of discrete event where the typical time between events is understood, but the precise timing of events is random. The arrival of an occasion is independent of the event before (waiting time between events is memory less). For instance, suppose we own an internet site which our content delivery network (CDN) tells us goes down on the average once per 60 days, but one failure doesn’t affect the probability of subsequent. All we all know is that the average time between failures. This is often a Poisson process that appears like:

The important point is we all know the typical time between events but they’re randomly spaced (stochastic). We’d have back-to-back failures, but we could also go years between failures thanks to the randomness of the method.

A Poisson Process meets the subsequent criteria (in reality many phenomena modeled as Poisson processes don’t meet these exactly):

Events are independent of every other. The occurrence of 1 event doesn’t affect the probability another event will occur.

The average rate (events per time period) is constant.

Two events cannot occur at an equivalent time.

The last point — events aren’t simultaneous — means we will consider each sub-interval of a Poisson process as a Bernoulli trial, that is, either a hit or a failure. With our website, the whole interval could also be 600 days, but each sub-interval — at some point — our website either goes down or it doesn’t.

Common samples of Poisson processes are customers calling a help center, visitors to an internet site, decay in atoms, photons arriving at an area telescope, and movements during a stock price. Poisson processes are generally related to time, but they are doing not need to be. Within the stock case, we’d know the typical movements per day (events per time), but we could even have a Poisson process for the amount of trees in an acre (events per area).

(One instance frequently given for a Poisson Process is bus arrivals (or trains or now Ubers). However, this is often not a real Poisson process because the arrivals aren’t independent of 1 another. Even for bus systems that don’t run on time, whether or not one bus is late affects the time of arrival of subsequent bus. Jake VanderPlas features a great article on applying a Poisson process to bus arrival times which works better with made-up data than real-world data.)

## Poisson distribution

The Poisson Process is that the model we use for describing randomly occurring events and by itself isn’t that useful. we’d like the Poisson distribution to try to to interesting things like finding the probability of variety of events during a period of time or finding the probability of waiting a while until subsequent event.

The Poisson distribution probability mass function gives the probability of observing k events during a period of time given the length of the amount and therefore the average events per time:

Poisson distribution for probability of k events in period of time .

This is a touch convoluted, and events/time * period of time is typically simplified into one parameter, λ, lambda, the speed parameter. With this substitution, the Poisson distribution probability function now has one parameter:

Lambda are often thought of because the expected number of events within the interval. (We’ll switch to calling this an interval because remember, we don’t need to use a period of time, we could use area or volume supported our Poisson process). I prefer to write down out lambda to remind myself the speed parameter may be a function of both the typical events per time and therefore the length of the period of time but you’ll most ordinarily see it as directly above.

As we modify the speed parameter, λ, we modify the probability of seeing different numbers of events in one interval. The below graph is that the probability mass function of the Poisson distribution showing the probability of variety of events occurring in an interval with different rate parameters.

The most likely number of events within the interval for every curve is that the rate parameter. This is sensible because the speed parameter is that the expected number of events within the interval and thus when it’s an integer, the speed parameter are going to be the amount of events with the best probability.

When it’s not an integer, the very best probability number of events are going to be the closest integer to the speed parameter, since the Poisson distribution is merely defined for a discrete number of events. The discrete nature of the Poisson distribution is additionally why this is often a probability mass function and not a density function. (The rate parameter is additionally the mean and variance of the distribution, which don’t got to be integers.)

We can use the Poisson distribution mass function to seek out the probability of observing variety of events over an interval generated by a Poisson process. Another use of the mass function equation — as we’ll see later — is to seek out the probability of waiting a while between events.

## A Worked-Out Example

For the matter we’ll solve with a Poisson distribution , we could continue with website failures, but I propose something grander. In my childhood, my father would often take me into our yard to watch (or attempt to observe) meteor showers. We weren’t space geeks, but watching objects from space spend within the sky was enough to urge us outside albeit meteor showers always appeared to occur within the coldest months.

The number of meteors seen are often modeled as a Poisson distribution because the meteors are independent, the typical number of meteors per hour is constant (in the short term), and — this is often an approximation — meteors don’t occur simultaneously. To characterize the Poisson distribution , all we’d like is that the rate parameter which is that the number of events/interval * interval length. From what I remember, we were told to expect 5 meteors per hour on the average or 1 every 12 minutes. thanks to the limited patience of a young child (especially on a freezing night), we never stayed out quite hour , so we’ll use that because the period of time . Putting the 2 together, we get:

What exactly does “5 meteors expected” mean? Well, consistent with my pessimistic dad, that meant we’d see 3 meteors in an hour, tops. At the time, I had no data science skills and trusted his judgment. Now that I’m older and have a healthy amount of skepticism towards authority figures, it’s time to place his statement to the test. We will use the Poisson distribution to seek out the probability of seeing exactly 3 meteors in one hour of observation:

14% or about 1/7. If we went outside nightly for one week, then we could expect my dad to be right precisely once! While that’s nice to understand, what we are after is that the distribution, the probability of seeing different numbers of meteors. Doing this by hand is tedious, so we’ll use Python — which you’ll see during this Jupyter Notebook — for calculation and visualization.

The below graph shows the Probability Mass Function for the amount of meteors in an hour with a mean time between meteors of 12 minutes (which is that the same as saying 5 meteors expected in an hour).

This is what “5 expected events” means! The foremost likely number of meteors is 5, the speed parameter of the distribution. (Due to a quirk of the numbers, 4 and 5 have an equivalent probability, 18%). like any distribution, there’s one presumably value, but there also are a good range of possible values. for instance, we could leave and see 0 meteors, or we could see quite 10 in one hour. to seek out the possibilities of those events, we use an equivalent equation but this point calculate sums of probabilities (see notebook for details).

We already calculated the prospect of seeing exactly 3 meteors as about 14%. The prospect of seeing 3 or fewer meteors in one hour is 27% which suggests the probability of seeing quite 3 is 73%. Likewise, the probability of quite 5 meteors is 38.4% while we could expect to ascertain 5 or fewer meteors in 61.6% of observation hours. Although it’s small, there’s a 1.4% chance of observing quite 10 meteors in an hour!

To visualize these possible scenarios, we will run an experiment by having our sister record the amount of meteors she sees every hour for 10,000 hours. The results are shown within the histogram below:

## Experimenting with the speed Parameter

The rate parameter, λ, is that the only number we’d like to define the Poisson distribution . However, since it’s a product of two parts (events/interval * interval length) there are two ways to vary it: we will increase or decrease the events/interval and that we can increase or decrease the interval length.

First, let’s change the speed parameter by increasing or decreasing the amount of meteors per hour to ascertain how the distribution is affected. For this graph, we are keeping the period of time constant at hour (1 hour).

In each case, the foremost likely number of meteors over the hour is that the expected number of meteors, the speed parameter for the Poisson distribution . together example, at 12 meteors per hour (MPH), our rate parameter is 12 and there’s an 11% chance of observing exactly 12 meteors in 1 hour. If our rate parameter increases, we should always expect to ascertain more meteors per hour.

Another option is to extend or decrease the interval length. Below is that the same plot, but this point we are keeping the amount of meteors per hour constant at 5 and changing the length of your time we observe.

It’s no surprise that we expect to ascertain more meteors the longer we stay out! Whoever said “he who hesitates is lost” clearly never stood around watching meteor showers.

## Waiting Time

An intriguing a part of a Poisson process involves deciding how long we’ve to attend until subsequent event (this is usually called the interarrival time). Consider the situation: meteors appear once every 12 minutes on the average. If we reach a random time, how long can we expect to attend to ascertain subsequent meteor? My dad always (this time optimistically) claimed we only had to attend 6 minutes for the primary meteor which agrees with our intuition. However, if we’ve learned anything, it’s that our intuition isn’t good at probability

I won’t enter the derivation (it comes from the probability mass function equation), but the time we will expect to attend between events may be a decaying exponential. The probability of waiting a given amount of your time between successive events decreases exponentially because the time increases. The subsequent equation shows the probability of waiting quite a specified time.

Probability of waiting more than a certain time.

With our example, we’ve 1 event/12 minutes, and if we connect the numbers we get a 60.65% chance of waiting > 6 minutes. Such a lot for my dad’s guess! To point out another case, we will expect to attend quite half-hour about 8.2% of the time. (We got to note this is often between each successive pair of events. The waiting times between events are memory less, therefore the time between two events has no effect on the time between the other events. This memorylessness is additionally referred to as the Markov property).

A graph helps us to see the exponential return of waiting time:

There is a 100% chance of waiting quite 0 minutes, which drops off to a near 0% chance of waiting quite 80 minutes. Again, since this is often a distribution, there are a good range of possible interarrival times.

Conversely, we will use this equation to seek out the probability of waiting but or adequate to a time:

Probability of waiting but or adequate to a specified time.

We can expect to attend 6 minutes or less to ascertain a meteor 39.4% of the time. We will also find the probability of waiting a period of time: there’s a 57.72% probability of waiting between 5 and half-hour to ascertain subsequent meteor.

To visualize the distribution of waiting times, we will once more run a (simulated) experiment. We simulate expecting 100,000 minutes with a mean rate of 1 meteor / 12 minutes. Then, we discover the waiting time between each meteor we see and plot the distribution.

The most likely waiting time is 1 minute, but that’s not the typical waiting time. Let’s revisit to the primary question: how long can we expect to attend on the average to ascertain the first meteor if we reach a random time?

To answer the typical waiting time question, we’ll run 10,000 separate trials, whenever watching the sky for 100,000 minutes. The graph below shows the distribution of the typical waiting time between meteors from these trials:

The average of the ten, 000 averages seem to be 12.003 minutes. albeit we reach a random time, the typical time we will expect to attend for the primary meteor is that the average time between occurrences. At first, this might be difficult to understand: if events occur on the average every 12 minutes, then why should we’ve to attend the whole 12 minutes before seeing one event? The solution is that this is a mean waiting time, taking under consideration all possible situations.

If the meteors came exactly every 12 minutes, then the typical time we’d need to wait to ascertain the primary one would be 6 minutes. However, because this is often an exponential distribution, sometimes we show up and need to wait an hour, which outweighs the greater number of times once we wait fewer than 12 minutes. This is often called the Waiting Time Paradox and may be a worthwhile read.

As a final visualization, let’s do a random simulation of 1 hour of observation.

Well, this point we got exactly what we expected: 5 meteors. We had to attend quarter-hour for the primary one, on the other hand had an honest stretch of shooting stars. A minimum of during this case, it’d be worth going out of the house for celestial observation!

Notes on Poisson distribution and Bernoulli distribution

A Bernoulli distribution is employed to model the probability of the amount of successes we will expect from n trials with a probability p. The Poisson distribution may be a special case of the Bernoulli distribution as n goes to infinity while the expected number of successes remains fixed. The Poisson is employed as an approximation of the Binomial if n is large and p is little.

As with many ideas in statistics, “large” and “small” are up to interpretation. A rule of thumb is that the Poisson distribution may be a decent approximation of the Binomial if n > 20 and np < 10. Therefore, a coin flip, even for 100 trials, should be modeled as a Binomial because np =50. A call center which gets 1 call every half-hour over 120 minutes might be modeled as a Poisson distribution as np = 4. One important distinction may be a Binomial occurs for a hard and fast set of trials (the domain is discrete) while a Poisson occurs over a theoretically infinite number of trials (continuous domain). this is often only an approximation; remember, all models are wrong, but some are useful!

For more on this subject, see the Related Distribution section on Wikipedia for the Poisson distribution. There’s also an honest Stack Exchange answer here.

Notes on Meteors/Meteorites/Meteoroids/Asteroids

Meteors are the streaks of sunshine you see within the sky that are caused by pieces of debris called meteoroids burning up within the atmosphere. A meteoroid can come from an asteroid, a comet, or a bit of a planet and is typically millimeters in diameter but are often up to a kilometer. If the meteoroid survives its trip through the atmosphere and impacts Earth, it’s called a meteorite. Asteroids are much larger chunks of rock orbiting the sun within the belt. Pieces of asteroids that break off become meteoroids. The more you know!