{"id":2548,"date":"2025-03-21T07:02:23","date_gmt":"2025-03-21T07:02:23","guid":{"rendered":"https:\/\/mailitics.com\/index.php\/2025\/03\/21\/mastering-the-poisson-distribution-intuition-and-foundations\/"},"modified":"2025-03-21T07:02:23","modified_gmt":"2025-03-21T07:02:23","slug":"mastering-the-poisson-distribution-intuition-and-foundations","status":"publish","type":"post","link":"https:\/\/mailitics.com\/index.php\/2025\/03\/21\/mastering-the-poisson-distribution-intuition-and-foundations\/","title":{"rendered":"Mastering the Poisson Distribution: Intuition and Foundations"},"content":{"rendered":"<p>    Mastering the Poisson Distribution: Intuition and Foundations<br \/>\n \t<BR><br \/>\n<BR><\/BR><br \/>\n    <!-- no image --><br \/>\n \t<BR><br \/>\n<BR><\/BR><\/p>\n<div>\n<p class=\"wp-block-paragraph\" id=\"b3b7\">You\u2019ve probably used the normal distribution one or two times too many. We all have \u2014 It\u2019s a true workhorse. But sometimes, we run into problems. For instance, when predicting or forecasting values, simulating data given a particular data-generating process, or when we try to visualise model output and explain them intuitively to non-technical stakeholders. Suddenly, things don\u2019t make much sense: can a user really have made -8 clicks on the banner? Or even 4.3 clicks? Both are examples of how count data doesn\u2019t behave.<\/p>\n<p class=\"wp-block-paragraph\" id=\"c800\">I\u2019ve found that better encapsulating the data generating process into my modelling has been key to having sensible model output. Using the Poisson distribution when it was appropriate has not only helped me convey more meaningful insights to stakeholders, but it has also enabled me to produce more accurate error estimates, better <a href=\"https:\/\/towardsdatascience.com\/tag\/inference\/\" title=\"Inference\">Inference<\/a>, and sound decision-making.<\/p>\n<p class=\"wp-block-paragraph\" id=\"8a0f\">In this post, my aim is to help you get a deep intuitive feel for the Poisson distribution by walking through example applications, and taking a dive into the foundations \u2014 the maths. I hope you learn not just how it works, but also why it works, and when to apply the distribution.<\/p>\n<p class=\"wp-block-paragraph\" id=\"35f6\"><em>If you know of a resource that has helped you grasp the concepts in this blog particularly well, you\u2019re invited to share it in the comments!<\/em><\/p>\n<h2 class=\"wp-block-heading\" id=\"853b\">Outline<\/h2>\n<ol class=\"wp-block-list\">\n<li class=\"wp-block-list-item\">\n<strong>Examples and use cases:<\/strong>\u00a0Let\u2019s walk through some use cases and sharpen the intuition I just mentioned. Along the way, the relevance of the <a href=\"https:\/\/towardsdatascience.com\/tag\/poisson-distribution\/\" title=\"Poisson Distribution\">Poisson Distribution<\/a> will become clear.<\/li>\n<li class=\"wp-block-list-item\">\n<strong>The foundations:<\/strong>\u00a0Next, let\u2019s break down the equation into its individual components. By studying each part, we\u2019ll uncover why the distribution works the way it does.<\/li>\n<li class=\"wp-block-list-item\">\n<strong>The assumptions:<\/strong>\u00a0Equipped with some formality, it will be easier to understand the assumptions that power the distribution, and at the same time set the boundaries for when it works, and when not.<\/li>\n<li class=\"wp-block-list-item\">\n<strong>When real life deviates from the model:<\/strong>\u00a0Finally, let\u2019s explore the special links that the Poisson distribution has with the Negative Binomial distribution. Understanding these relationships can deepen our understanding, and provide alternatives when the Poisson distribution is not suited for the job.<\/li>\n<\/ol>\n<h2 class=\"wp-block-heading\" id=\"a380\">Example in an online marketplace<\/h2>\n<p class=\"wp-block-paragraph\" id=\"7bc4\">I chose to deep dive into the Poisson distribution because it frequently appears in my day-to-day work. Online marketplaces rely on binary user choices from two sides: a seller deciding to list an item and a buyer deciding to make a purchase. These micro-behaviours drive supply and demand, both in the short and long term. A marketplace is born.<\/p>\n<p class=\"wp-block-paragraph\" id=\"3154\">Binary choices aggregate into counts \u2014 the sum of many such decisions as they occur. Attach a timeframe to this counting process, and you\u2019ll start seeing Poisson distributions everywhere. Let\u2019s explore a concrete example next.<\/p>\n<p class=\"wp-block-paragraph\" id=\"4a0a\">Consider a seller on a platform. In a given month, the seller may or may not list an item for sale (a binary choice). We would only know if she did because then we\u2019d have a measurable count of the event. Nothing stops her from listing another item in the same month. If she does, we count those events. The total could be zero for an inactive seller or, say, 120 for a highly engaged seller.<\/p>\n<p class=\"wp-block-paragraph\" id=\"6581\">Over several months, we would observe a varying number of listed items by this seller \u2014 sometimes fewer, sometimes more \u2014 hovering around an average monthly listing rate. That is essentially a Poisson process. When we get to the assumptions section, you\u2019ll see what we had to assume away to make this example work.<\/p>\n<h3 class=\"wp-block-heading\" id=\"c06a\">Other examples<\/h3>\n<p class=\"wp-block-paragraph\" id=\"a01f\">Other phenomena that can be modelled with a Poisson distribution include:<\/p>\n<ul class=\"wp-block-list\">\n<li class=\"wp-block-list-item\">\n<strong>Sports analytics<\/strong>: The number of goals scored in a match between two teams.<\/li>\n<li class=\"wp-block-list-item\">\n<strong>Queuing<\/strong>: Customers arriving at a help desk or customer support calls.<\/li>\n<li class=\"wp-block-list-item\">\n<strong>Insurance<\/strong>: The number of claims made within a given period.<\/li>\n<\/ul>\n<p class=\"wp-block-paragraph\" id=\"15b2\">Each of these examples warrants further inspection, but for the remainder of this post, we\u2019ll use the marketplace example to illustrate the inner workings of the distribution.<\/p>\n<h2 class=\"wp-block-heading\" id=\"ba36\">The mathy bit<\/h2>\n<p class=\"wp-block-paragraph\" id=\"7e42\"><em>\u2026 or foundations.<\/em><\/p>\n<p class=\"wp-block-paragraph\" id=\"5892\">I find opening up the probability mass function (PMF) of distributions helpful to understanding why things work as they do. The PMF of the Poisson distribution goes like:<\/p>\n<figure class=\"wp-block-image size-full is-resized\"><img data-recalc-dims=\"1\" decoding=\"async\" src=\"https:\/\/i0.wp.com\/contributor.insightmediagroup.io\/wp-content\/uploads\/2025\/03\/0_tvdDQOonfkPugrsX.webp?ssl=1\" alt=\"\" class=\"wp-image-599958\" style=\"width:247px;height:auto\"><\/figure>\n<p class=\"wp-block-paragraph\" id=\"f9f7\">Where \u03bb is the rate parameter, and \ud835\udc58 is the manifested count of the random variable (\ud835\udc58 = 0, 1, 2, 3, \u2026 events). Very neat and compact.<\/p>\n<figure class=\"wp-block-image size-large\"><img data-recalc-dims=\"1\" height=\"536\" width=\"1024\" decoding=\"async\" src=\"https:\/\/i0.wp.com\/contributor.insightmediagroup.io\/wp-content\/uploads\/2025\/03\/Poisson-1-1024x536.png?resize=1024%2C536&#038;ssl=1\" alt=\"Graph: The probability mass function of the Poisson distribution, for a few different lambdas.\" class=\"wp-image-599836\"><figcaption class=\"wp-element-caption\">The probability mass function of the Poisson distribution, for a few different lambdas.<\/figcaption><\/figure>\n<h3 class=\"wp-block-heading\" id=\"66ee\">Contextualising \u03bb and k: the marketplace example<\/h3>\n<p class=\"wp-block-paragraph\" id=\"ab6b\">In the context of our earlier example \u2014 a seller listing items on our platform \u2014 \u03bb represents the seller\u2019s average monthly listings. As the expected monthly value for this seller, \u03bb orchestrates the number of items she would list in a month. Note that \u03bb is a Greek letter, so read: \u03bb is a parameter that we can estimate from data. On the other hand, \ud835\udc58 does not hold any information about the seller\u2019s idiosyncratic behaviour. It\u2019s the target value we set for the number of events that may happen to learn about its probability.<\/p>\n<h3 class=\"wp-block-heading\" id=\"6683\">The dual role of \u03bb as the mean and variance<\/h3>\n<p class=\"wp-block-paragraph\" id=\"eab1\">When I said that \u03bb orchestrates the number of monthly listings for the seller, I meant it quite literally. Namely, \u03bb is both the expected value and variance of the distribution, indifferently, for all values of \u03bb. This means that the mean-to-variance ratio (index of dispersion) is always 1.<\/p>\n<p class=\"wp-block-paragraph\" id=\"9a60\">To put this into perspective, the normal distribution requires two parameters \u2014 \ud835\udf07 and \ud835\udf0e\u00b2, the average and variance respectively \u2014 to fully describe it. The Poisson distribution achieves the same with just one.<\/p>\n<p class=\"wp-block-paragraph\" id=\"c992\">Having to estimate only one parameter can be beneficial for parametric inference. Specifically, by reducing the variance of the model and increasing the statistical power. On the other hand, it can be too limiting of an assumption. Alternatives like the Negative Binomial distribution can alleviate this limitation. We\u2019ll explore that later.<\/p>\n<h3 class=\"wp-block-heading\" id=\"db8f\">Breaking down the probability mass function<\/h3>\n<p class=\"wp-block-paragraph\" id=\"4082\">Now that we know the smallest building blocks, let\u2019s zoom out one step: what is \u03bb\u1d4f, \ud835\udc52^\u207b\u03bb, and \ud835\udc58!, and more importantly, what is each of these components\u2019 function in the whole?<\/p>\n<ul class=\"wp-block-list\">\n<li class=\"wp-block-list-item\">\n<strong>\u03bb\u1d4f\u00a0<\/strong>is a weight that expresses how likely it is for \ud835\udc58 events to happen, given that the expectation is \u03bb. Note that \u201clikely\u201d here does not mean a probability, yet. It\u2019s merely a signal strength.<\/li>\n<li class=\"wp-block-list-item\">\n<strong>\ud835\udc58!<\/strong>\u00a0is a combinatorial correction so that we can say that the order of the events is irrelevant. The events are interchangeable.<\/li>\n<li class=\"wp-block-list-item\">\n<strong>\ud835\udc52^\u207b\u03bb<\/strong>\u00a0normalises the integral of the PMF function to sum up to 1. It\u2019s called the partition function of exponential-family distributions.<\/li>\n<\/ul>\n<p class=\"wp-block-paragraph\" id=\"a101\">In more detail, \u03bb\u1d4f relates the observed value \ud835\udc58 to the expected value of the random variable, \u03bb. Intuitively, more probability mass lies around the expected value. Hence, if the observed value lies close to the expectation, the probability of occurring is larger than the probability of an observation far removed from the expectation. Before we can cross-check our intuition with the numerical behaviour of \u03bb\u1d4f, we need to consider what \ud835\udc58! does.<\/p>\n<h3 class=\"wp-block-heading\" id=\"6607\">Interchangeable events<\/h3>\n<p class=\"wp-block-paragraph\" id=\"aedb\">Had we cared about the order of events, then each unique event could be ordered in \ud835\udc58! ways. But because we don\u2019t, and we deem each event interchangeable, we \u201cdivide out\u201d \ud835\udc58! from \u03bb\u1d4f to correct for the overcounting.<\/p>\n<p class=\"wp-block-paragraph\" id=\"5ac2\">Since \u03bb\u1d4f is an exponential term, the output will always be larger as \ud835\udc58 grows, holding \u03bb constant. That is the opposite of our intuition that there is maximum probability when \u03bb = \ud835\udc58, as the output is larger when \ud835\udc58 = \u03bb + 1. But now that we know about the interchangeable events assumption \u2014 and the overcounting issue \u2014 we know that we have to factor in \ud835\udc58! like so: \u03bb\u1d4f \ud835\udc52^\u207b\u03bb \/ \ud835\udc58!, to see the behaviour we expect.<\/p>\n<p class=\"wp-block-paragraph\" id=\"3170\">Now let\u2019s check the intuition of the relationship between \u03bb and \ud835\udc58 through \u03bb\u1d4f, corrected for \ud835\udc58!. For the same \u03bb, say \u03bb = 4, we should see \u03bb\u1d4f \ud835\udc52^\u207b\u03bb \/ \ud835\udc58! to be smaller for values of \ud835\udc58 that are far removed from 4, compared to values of \ud835\udc58 that lie close to 4. Like so: inline code: 4\u00b2\/2 = 8 is smaller than 4\u2074\/24 = 10.7. This is consistent with the intuition of a higher likelihood of \ud835\udc58 when it\u2019s near the expectation. The image below shows this relationship more generally, where you see that the output is larger as \ud835\udc58 approaches \u03bb.<\/p>\n<figure class=\"wp-block-image size-large\"><img data-recalc-dims=\"1\" height=\"536\" width=\"1024\" decoding=\"async\" src=\"https:\/\/i0.wp.com\/contributor.insightmediagroup.io\/wp-content\/uploads\/2025\/03\/Poisson-2-1024x536.png?resize=1024%2C536&#038;ssl=1\" alt=\"Graph: The probability mass function without the normalising component e^-lambda.\" class=\"wp-image-599837\"><figcaption class=\"wp-element-caption\">The probability mass function without the normalising component e^-lambda.<\/figcaption><\/figure>\n<h2 class=\"wp-block-heading\" id=\"639e\">The assumptions<\/h2>\n<p class=\"wp-block-paragraph\" id=\"edf6\">First, let\u2019s get one thing off the table: the difference between a\u00a0<em>Poisson process<\/em>, and the\u00a0<em>Poisson distribution<\/em>. The\u00a0<em>process<\/em>\u00a0is a stochastic continuous-time model of points happening in given interval: 1D, a line; 2D, an area, or higher dimensions. We, data scientists, most often deal with the one-dimensional case, where the \u201cline\u201d is time, and the points are the events of interest \u2014 I dare to say.<\/p>\n<p class=\"wp-block-paragraph\" id=\"017f\">These are the assumptions of the Poisson process:<\/p>\n<ol class=\"wp-block-list\">\n<li class=\"wp-block-list-item\">\n<strong>The occurrence of one event does not affect the probability of a second event.<\/strong>\u00a0Think of our seller going on to list another item tomorrow indifferently of having done so already today, or the one from five days ago for that matter. The point here is that there is no memory between events.<\/li>\n<li class=\"wp-block-list-item\">\n<strong>The average rate at which events occur, is independent of any occurrence.<\/strong>\u00a0In other words, no event that happened (or will happen) alters \u03bb, which remains constant throughout the observed timeframe. In our seller example, this means that listing an item today does not increase or decrease the seller\u2019s motivation or likelihood of listing another item tomorrow.<\/li>\n<li class=\"wp-block-list-item\">\n<strong>Two events cannot occur at exactly the same instant.<\/strong>\u00a0If we were to zoom at an infinite granular level on the timescale, no two listings could have been placed simultaneously; always sequentially.<\/li>\n<\/ol>\n<p class=\"wp-block-paragraph\" id=\"0905\">From these assumptions \u2014 no memory, constant rate, events happening alone \u2014 it follows that 1) any interval\u2019s number of events is Poisson-distributed with parameter \u03bb\u209c and 2) that disjoint intervals are independent \u2014 two key properties of a Poisson process.<\/p>\n<p class=\"wp-block-paragraph\" id=\"8674\"><em>A Note on the distribution:<br \/><\/em>The distribution simply describes probabilities for various numbers of counts in an interval. Strictly speaking, one can use the distribution pragmatically whenever the data is nonnegative, can be unbounded on the right, has mean \u03bb, and reasonably models the data. It would be just convenient if the underlying process is a Poisson one, and actually justifies using the distribution.<\/p>\n<h3 class=\"wp-block-heading\" id=\"34f7\">The marketplace example: Implications<\/h3>\n<p class=\"wp-block-paragraph\" id=\"e9d6\">So, can we justify using the Poisson distribution for our marketplace example? Let\u2019s open up the assumptions of a Poisson process and take the test.<\/p>\n<p class=\"wp-block-paragraph\" id=\"c81a\"><strong>Constant \u03bb<\/strong><\/p>\n<ul class=\"wp-block-list\">\n<li class=\"wp-block-list-item\">\n<em>Why it may fail:\u00a0<\/em>The seller has patterned online activity; holidays; promotions; listings are seasonal goods.<\/li>\n<li class=\"wp-block-list-item\">\n<em>Consequence:<\/em>\u00a0\u03bb is not constant, leading to overdispersion (mean-to-variance ratio is larger than 1, or to temporal patterns.<\/li>\n<\/ul>\n<p class=\"wp-block-paragraph\" id=\"6728\"><strong>Independence and memorylessness<\/strong><\/p>\n<ul class=\"wp-block-list\">\n<li class=\"wp-block-list-item\">\n<em>Why it may fail:<\/em>\u00a0The propensity to list again is higher after a successful listing, or conversely, listing once depletes the stock and intervenes with the propensity of listing again.<\/li>\n<li class=\"wp-block-list-item\">\n<em>Consequence:<\/em>\u00a0Two events are no longer independent, as the occurrence of one informs the occurrence of the other.<\/li>\n<\/ul>\n<p class=\"wp-block-paragraph\" id=\"03d3\"><strong>Simultaneous events<\/strong><\/p>\n<ul class=\"wp-block-list\">\n<li class=\"wp-block-list-item\">\n<em>Why it may fail:<\/em>\u00a0Batch-listing, a new feature, was introduced to help the sellers.<\/li>\n<li class=\"wp-block-list-item\">\n<em>Consequence:<\/em>\u00a0Multiple listings would come online at the same time, clumped together, and they would be counted simultaneously.<\/li>\n<\/ul>\n<h3 class=\"wp-block-heading\" id=\"6902\">Balancing rigour and pragmatism<\/h3>\n<p class=\"wp-block-paragraph\" id=\"51a3\">As Data Scientists on the job, we may feel trapped between rigour and pragmatism. The three steps below should give you a sound foundation to decide on which side to err, when the Poisson distribution falls short:<\/p>\n<ol class=\"wp-block-list\">\n<li class=\"wp-block-list-item\">\n<strong>Pinpoint your goal:<\/strong>\u00a0is it inference, simulation or prediction, and is it about high-stakes output? List the worst thing that can happen, and the cost of it for the business.<\/li>\n<li class=\"wp-block-list-item\">\n<strong>Identify the problem and solution<\/strong>: why does the Poisson distribution not fit, and what can you do about it? list 2-3 solutions, including changing nothing.<\/li>\n<li class=\"wp-block-list-item\">\n<strong>Balance gains and costs:<\/strong>\u00a0Will your workaround improve things, or make it worse? and at what cost: interpretability, new assumptions introduced and resources used. Does it help you in achieving your goal?<\/li>\n<\/ol>\n<p class=\"wp-block-paragraph\" id=\"cbbf\">That said, here are some counters I use when needed.<\/p>\n<h2 class=\"wp-block-heading\" id=\"2f96\">When real life deviates from your model<\/h2>\n<p class=\"wp-block-paragraph\" id=\"32b5\">Everything described so far pertains to the standard, or homogenous, Poisson process. But what if reality begs for something different?<\/p>\n<p class=\"wp-block-paragraph\" id=\"32b5\">In the next section, we\u2019ll cover two extensions of the Poisson distribution when the constant \u03bb assumption does not hold. These are not mutually exclusive, but neither they are the same:<\/p>\n<ol class=\"wp-block-list\">\n<li class=\"wp-block-list-item\">\n<strong>Time-varying\u00a0<\/strong>\u03bb<strong>:<\/strong>\u00a0a single seller whose listing rate ramps up before holidays and slows down afterward<\/li>\n<li class=\"wp-block-list-item\">\n<strong>Mixed Poisson distribution:<\/strong>\u00a0multiple sellers listing items, each with their own \u03bb can be seen as a mixture of various Poisson processes<\/li>\n<\/ol>\n<h2 class=\"wp-block-heading\" id=\"c0b8\">Time-varying \u03bb<\/h2>\n<p class=\"wp-block-paragraph\" id=\"7c0d\">The first extension allows \u03bb to have its own value for each time\u00a0<em>t<\/em>. The PMF then becomes<\/p>\n<figure class=\"wp-block-image size-full\"><img data-recalc-dims=\"1\" decoding=\"async\" src=\"https:\/\/i0.wp.com\/contributor.insightmediagroup.io\/wp-content\/uploads\/2025\/03\/Poisson-3.png?ssl=1\" alt=\"\" class=\"wp-image-599838\"><\/figure>\n<p class=\"wp-block-paragraph\" id=\"6d80\">Where the number of events \ud835\udc3e(\ud835\udc47) in an interval \ud835\udc47 follows the Poisson distribution with a rate no longer equal to a fixed \u03bb, but one equal to:<\/p>\n<figure class=\"wp-block-image size-full\"><img data-recalc-dims=\"1\" decoding=\"async\" src=\"https:\/\/i0.wp.com\/contributor.insightmediagroup.io\/wp-content\/uploads\/2025\/03\/Poisson-4.png?ssl=1\" alt=\"\" class=\"wp-image-599839\"><\/figure>\n<p class=\"wp-block-paragraph\" id=\"06a1\">More intuitively, integrating over the interval \ud835\udc61 to \ud835\udc61 + \ud835\udc56 gives us a single number: the expected value of events over that interval. The integral will vary by each arbitrary interval, and that\u2019s what makes \u03bb change over time. To understand how that integration works, it was helpful for me to think of it like this: if the interval \ud835\udc61 to \ud835\udc61\u2081 integrates to 3, and \ud835\udc61\u2081 to \ud835\udc61\u2082 integrates to 5, then the interval \ud835\udc61 to \ud835\udc61\u2082 integrates to 8 = 3 + 5. That\u2019s the two expectations summed up, and now the expectation of the entire interval.<\/p>\n<p class=\"wp-block-paragraph\" id=\"1412\"><strong>Practical implication\u00a0<\/strong><br \/>One may want to modeling the expected value of the Poisson distribution as a function of time. For instance, to model an overall change in trend, or seasonality. In generative model notation:<\/p>\n<figure class=\"wp-block-image size-full\"><img data-recalc-dims=\"1\" decoding=\"async\" src=\"https:\/\/i0.wp.com\/contributor.insightmediagroup.io\/wp-content\/uploads\/2025\/03\/Poisson-5.png?ssl=1\" alt=\"\" class=\"wp-image-599840\"><\/figure>\n<p class=\"wp-block-paragraph\" id=\"50a5\">Time may be a continuous variable, or an arbitrary function of it.<\/p>\n<h2 class=\"wp-block-heading\" id=\"ec61\">Process-varying \u03bb: Mixed Poisson distribution<\/h2>\n<p class=\"wp-block-paragraph\" id=\"6061\">But then there\u2019s a gotcha. Remember when I said that \u03bb has a dual role as the mean and variance? That still applies here. Looking at the \u201crelaxed\u201d PMF*, the only thing that changes is that \u03bb can vary freely with time. But it\u2019s still the one and only \u03bb that orchestrates both the expected value and the dispersion of the PMF*. More precisely, \ud835\udd3c[\ud835\udc4b] = Var(\ud835\udc4b) still holds.<\/p>\n<p class=\"wp-block-paragraph\" id=\"fcd5\">There are various reasons for this constraint not to hold in reality. Model misspecification, event interdependence and unaccounted for heterogeneity could be the issues at hand. I\u2019d like to focus on the latter case, as it justifies the Negative Binomial distribution \u2014 one of the topics I promised to open up.<\/p>\n<p class=\"wp-block-paragraph\" id=\"50ee\"><strong>Heterogeneity and overdispersion<\/strong><br \/>Imagine we are not dealing with one seller, but with 10 of them listing at different intensity levels, \u03bb\u1d62, where \ud835\udc56 = 1, 2, 3, \u2026, 10 sellers. Then, essentially, we have 10 Poisson processes going on. If we unify the processes and estimate the grand \u03bb, we simplify the mixture away. Meaning, we get a correct estimate of all sellers on average, but the resulting grand \u03bb is naive and does not know about the original spread of \u03bb\u1d62. It still assumes that the variance and mean are equal, as per the axioms of the distribution. This will lead to overdispersion and, in turn, to underestimated errors. Ultimately, it inflates the false positive rate and drives poor decision-making.\u00a0<em>We need a way to embrace the heterogeneity amongst sellers\u2019 \u03bb\u1d62.<\/em><\/p>\n<p class=\"wp-block-paragraph\" id=\"bee8\"><strong>Negative binomial: Extending the Poisson distribution<\/strong><br \/>Among the few ways one can look at the Negative Binomial distribution, one way is to see it as a compound Poisson process \u2014 10 sellers, sounds familiar yet? That means multiple independent Poisson processes are summed up to a single one. Mathematically, first we draw \u03bb from a Gamma distribution: \u03bb ~ \u0393(r, \u03b8), then we draw the count \ud835\udc4b | \u03bb ~ Poisson(\u03bb).<\/p>\n<p class=\"wp-block-paragraph\" id=\"5317\">In one image, it is as if we would sample from plenty Poisson distributions, corresponding to each seller.<\/p>\n<figure class=\"wp-block-image size-large\"><img data-recalc-dims=\"1\" height=\"536\" width=\"1024\" decoding=\"async\" src=\"https:\/\/i0.wp.com\/contributor.insightmediagroup.io\/wp-content\/uploads\/2025\/03\/Poisson-6-1024x536.png?resize=1024%2C536&#038;ssl=1\" alt=\"A negative Binomial distribution arises from many Poisson distributions.\" class=\"wp-image-599841\"><figcaption class=\"wp-element-caption\">A negative Binomial distribution arises from many Poisson distributions.<\/figcaption><\/figure>\n<p class=\"wp-block-paragraph\" id=\"86fa\">The more exposing alias of the Negative binomial distribution is\u00a0<em>Gamma-Poisson mixture distribution<\/em>, and now we know why: the dictating \u03bb comes from a continuous mixture. That\u2019s what we needed to explain the heterogeneity amongst sellers.<\/p>\n<p class=\"wp-block-paragraph\" id=\"207d\">Let\u2019s simulate this scenario to gain more intuition.<\/p>\n<figure class=\"wp-block-image size-large\"><img data-recalc-dims=\"1\" height=\"536\" width=\"1024\" decoding=\"async\" src=\"https:\/\/i0.wp.com\/contributor.insightmediagroup.io\/wp-content\/uploads\/2025\/03\/Poisson-7-1024x536.png?resize=1024%2C536&#038;ssl=1\" alt=\"Gamma mixture of lambda.\" class=\"wp-image-599842\"><figcaption class=\"wp-element-caption\">Gamma mixture of lambda.<\/figcaption><\/figure>\n<p class=\"wp-block-paragraph\" id=\"3cc2\">First, we draw \u03bb\u1d62 from a Gamma distribution: \u03bb\u1d62 ~ \u0393(r, \u03b8). Intuitively, the Gamma distribution tells us about the variety in the intensity \u2014 listing rate \u2014 amongst the sellers.<\/p>\n<p class=\"wp-block-paragraph\" id=\"428a\">On a practical note, one can instill their assumptions about the degree of heterogeneity in this step of the model:\u00a0<em>how<\/em>\u00a0different are sellers? By varying the levels of heterogeneity, one can observe the impact on the final Poisson-like distribution. Doing this type of checks (i.e., posterior predictive check), is common in Bayesian modeling, where the assumptions are set explicitly.<\/p>\n<figure class=\"wp-block-image size-large\"><img data-recalc-dims=\"1\" height=\"536\" width=\"1024\" decoding=\"async\" src=\"https:\/\/i0.wp.com\/contributor.insightmediagroup.io\/wp-content\/uploads\/2025\/03\/Poisson-8-1024x536.png?resize=1024%2C536&#038;ssl=1\" alt=\"Gamma-Poisson mixture distribution versus homogenous Poisson distribution. \u03a4he dashed line reflects \u03bb, which is 4 for both distributions.\" class=\"wp-image-599843\"><figcaption class=\"wp-element-caption\"><em>Gamma-Poisson mixture distribution versus homogenous Poisson distribution. \u03a4he dashed line reflects \u03bb, which is 4 for both distributions.<\/em><\/figcaption><\/figure>\n<p class=\"wp-block-paragraph\" id=\"c34d\">In the second step, we plug the obtained \u03bb into the Poisson distribution: \ud835\udc4b | \u03bb ~ Poisson(\u03bb), and obtain a Poisson-like distribution that represents the summed subprocesses. Notably, this unified process has a larger dispersion than expected from a homogeneous Poisson distribution, but it is in line with the Gamma mixture of \u03bb.<\/p>\n<h2 class=\"wp-block-heading\" id=\"d06e\">Heterogeneous \u03bb and inference<\/h2>\n<p class=\"wp-block-paragraph\" id=\"485e\">A practical consequence of introducing flexibility into your assumed distribution is that inference becomes more challenging. More parameters (i.e., the Gamma parameters) need to be estimated. Parameters act as flexible explainers of the data, tending to overfit and explain away variance in your variable. The more parameters you have, the better the explanation may seem, but the model also becomes more susceptible to noise in the data. Higher variance reduces the power to identify a difference in means, if one exists, because \u2014 well \u2014 it gets lost in the variance.<\/p>\n<p class=\"wp-block-paragraph\" id=\"7b40\"><strong>Countering the loss of power<\/strong><\/p>\n<ol class=\"wp-block-list\">\n<li class=\"wp-block-list-item\">Confirm whether you indeed need to extend the standard Poisson distribution. If not, simplify to the simplest, most fit model. A quick check on overdispersion may suffice for this.<\/li>\n<li class=\"wp-block-list-item\">Pin down the estimates of the Gamma mixture distribution parameters using regularising, informative priors (think: Bayes).<\/li>\n<\/ol>\n<p class=\"wp-block-paragraph\" id=\"7d47\">During my research process for writing this blog, I learned a great deal about the connective tissue underlying all of this: how the binomial distribution plays a fundamental role in the processes we\u2019ve discussed. And while I\u2019d love to ramble on about this, I\u2019ll save it for another post, perhaps. In the meantime, feel free to share your understanding in the comments section below <img data-recalc-dims=\"1\" decoding=\"async\" src=\"https:\/\/i0.wp.com\/s.w.org\/images\/core\/emoji\/15.0.3\/72x72\/1f44d.png?ssl=1\" alt=\"\ud83d\udc4d\" class=\"wp-smiley\" style=\"height: 1em; max-height: 1em;\">.<\/p>\n<h2 class=\"wp-block-heading\" id=\"787a\">Conclusion<\/h2>\n<p class=\"wp-block-paragraph\" id=\"eab6\">The Poisson distribution is a simple distribution that can be highly suitable for modelling count data. However, when the assumptions do not hold, one can extend the distribution by allowing the rate parameter to vary as a function of time or other factors, or by assuming subprocesses that collectively make up the count data. This added flexibility can address the limitations, but it comes at a cost: increased flexibility in your modelling raises the variance and, consequently, undermines the statistical power of your model.<\/p>\n<p class=\"wp-block-paragraph\" id=\"35e0\">If your end goal is inference, you may want to think twice and consider exploring simpler models for the data. Alternatively, switch to the Bayesian paradigm and leverage its built-in solution to regularise estimates: informative priors.<\/p>\n<p class=\"wp-block-paragraph\" id=\"fe52\">I hope this has given you what you came for \u2014 a better intuition about the Poisson distribution. I\u2019d love to hear your thoughts about this in the comments!<\/p>\n<p class=\"wp-block-paragraph\" id=\"65ad\"><em>Unless otherwise noted, all images are by the author.<br \/>Originally published at\u00a0<\/em><a href=\"https:\/\/aalvarezperez.github.io\/posts\/Mastering-the-Poisson-Distribution-Intuition-and-Foundations\/\" rel=\"noreferrer noopener\" target=\"_blank\"><em>https:\/\/aalvarezperez.github.io<\/em><\/a><em>\u00a0on January 5, 2025.<\/em><\/p>\n<p>The post <a href=\"https:\/\/towardsdatascience.com\/mastering-the-poisson-distribution-intuition-and-foundations\/\">Mastering the Poisson Distribution: Intuition and Foundations<\/a> appeared first on <a href=\"https:\/\/towardsdatascience.com\/\">Towards Data Science<\/a>.<\/p>\n<\/div>\n<p> \t<BR><br \/>\n <BR><\/BR><br \/>\n    Alejandro Alvarez Perez<br \/>\n \t<BR><br \/>\n<BR><\/BR><br \/>\n<a href=\"https:\/\/towardsdatascience.com\/mastering-the-poisson-distribution-intuition-and-foundations\/\">Go to original source<\/a><br \/>\n \t<BR><br \/>\n <BR><\/BR><\/p>\n","protected":false},"excerpt":{"rendered":"<p>Mastering the Poisson Distribution: Intuition and Foundations You\u2019ve probably used the normal distribution one or two times too many. We all have \u2014 It\u2019s a true workhorse. But sometimes, we run into problems. For instance, when predicting or forecasting values, simulating data given a particular data-generating process, or when we try to visualise model output [&hellip;]<\/p>\n","protected":false},"author":2,"featured_media":0,"comment_status":"closed","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[62,83,67,513,229,2075,1710],"tags":[582,922,334],"class_list":["post-2548","post","type-post","status-publish","format-standard","hentry","category-aimldsaimlds","category-data-science","category-deep-dives","category-inference","category-math","category-poisson-distribution","category-statisitcs","tag-distribution","tag-poisson","tag-when"],"_links":{"self":[{"href":"https:\/\/mailitics.com\/index.php\/wp-json\/wp\/v2\/posts\/2548"}],"collection":[{"href":"https:\/\/mailitics.com\/index.php\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/mailitics.com\/index.php\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/mailitics.com\/index.php\/wp-json\/wp\/v2\/users\/2"}],"replies":[{"embeddable":true,"href":"https:\/\/mailitics.com\/index.php\/wp-json\/wp\/v2\/comments?post=2548"}],"version-history":[{"count":0,"href":"https:\/\/mailitics.com\/index.php\/wp-json\/wp\/v2\/posts\/2548\/revisions"}],"wp:attachment":[{"href":"https:\/\/mailitics.com\/index.php\/wp-json\/wp\/v2\/media?parent=2548"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/mailitics.com\/index.php\/wp-json\/wp\/v2\/categories?post=2548"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/mailitics.com\/index.php\/wp-json\/wp\/v2\/tags?post=2548"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}