{"id":3481,"date":"2026-03-01T20:47:37","date_gmt":"2026-03-01T19:47:37","guid":{"rendered":"https:\/\/www.gironi.it\/blog\/the-poisson-distribution\/"},"modified":"2026-03-02T09:30:29","modified_gmt":"2026-03-02T08:30:29","slug":"the-poisson-distribution","status":"publish","type":"post","link":"https:\/\/www.gironi.it\/blog\/en\/the-poisson-distribution\/","title":{"rendered":"The Poisson Distribution"},"content":{"rendered":"<p>The Poisson distribution is a <strong>discrete probability distribution<\/strong> that describes the number of events occurring in a fixed interval of time or area.<\/p>\n<p>The Poisson distribution is useful for <strong>measuring how many events can occur within a given time horizon<\/strong>, such as the number of customers entering a shop in the next hour, or the number of pageviews on a website in the next minute, and so on.<\/p>\n<figure class=\"aligncenter\"><img loading=\"lazy\" decoding=\"async\" src=\"https:\/\/www.gironi.it\/blog\/wp-content\/uploads\/2020\/11\/Simeon_Poisson.jpg\" alt=\"The Poisson Distribution: Sim\u00e9on-Denis Poisson\" width=\"400\" height=\"469\" \/><figcaption><strong><a href=\"https:\/\/en.wikipedia.org\/wiki\/Sim%C3%A9on-Denis_Poisson\" target=\"_blank\" rel=\"noreferrer noopener\">Sim\u00e9on-Denis Poisson<\/a><\/strong><\/figcaption><\/figure>\n<p><!--more--><\/p>\n<div style=\"border: 1px solid #ccc;padding: 1.2em 1.5em;margin: 1.5em 0;border-radius: 6px\">\n<h3 style=\"margin-top: 0\">What We&#8217;ll Cover<\/h3>\n<ul>\n<li><a href=\"#lambda\">Lambda: The Average Rate of Events<\/a><\/li>\n<li><a href=\"#poisson-binomial\">Poisson and Binomial: A Side Note<\/a><\/li>\n<li><a href=\"#practical-example\">A Practical Example<\/a><\/li>\n<li><a href=\"#seo-application\">The Poisson Distribution Applied to SEO<\/a><\/li>\n<li><a href=\"#alternative-models\">Alternative Models for Web Traffic Analysis<\/a><\/li>\n<li><a href=\"#clicks-example\">Using Poisson for Website Click Estimates<\/a><\/li>\n<li><a href=\"#further-reading\">Further Reading<\/a><\/li>\n<\/ul>\n<\/div>\n<hr \/>\n<h2 id=\"lambda\">Lambda: The Average Rate of Events<\/h2>\n<p>An important element: <strong>each time interval is assumed to be independent of all others.<\/strong><\/p>\n<p>We need to know the <strong>average number of events or the rate at which they occur within the time interval<\/strong>. We represent this value with the Greek letter <strong>lambda<\/strong>:<\/p>\n\\( X \\sim Po(\\lambda) \\\\ \\\\ \\)\n<p>To calculate the probability that there are r occurrences in a specific interval:<\/p>\n\\( P (X=r) = \\frac{e^{-\\lambda} \\lambda^{r}}{r!} \\\\ \\\\ \\)\n<p>For example, if:<\/p>\n\\( X \\sim Po(2) \\\\ \\\\ r=3 \\)\n<p>we get:<\/p>\n\\( P (X=3) = \\frac{e^{-2} \\cdot 2^{3}}{3!} =\\frac{e^{-2} \\cdot 8}{6} = e^{2} \\cdot 1.333 = 0.180 \\\\ \\\\ \\)\n<p>That is, 18%.<\/p>\n<hr \/>\n<h2 id=\"poisson-binomial\">Poisson and Binomial: A Side Note<\/h2>\n<p>If<\/p>\n\\( X \\sim Po(\\lambda x) \\\\ Y \\sim Po(\\lambda y) \\\\ \\\\ \\)\n<p>then<\/p>\n\\( X + Y \\sim Po(\\lambda x + \\lambda y) \\\\ \\\\ \\)\n<p>If<\/p>\n\\( X \\sim Bin(n,p) \\\\ \\\\ \\)\n<p>and n is large and p is small, then we can approximate the <a href=\"https:\/\/www.gironi.it\/blog\/en\/probability-distributions-discrete-distributions-and-the-binomial\/\">binomial<\/a> with the Poisson:<\/p>\n\\( X \\sim Po(n \\cdot p) \\\\ \\\\ \\)\n<h3>Differences Between the Poisson and Binomial Distributions<\/h3>\n<p>The Poisson and binomial distributions are both discrete probability distributions used to model rare events. The main difference between the two concerns the number of trials and successes.<\/p>\n<p><strong>The binomial distribution is biparametric<\/strong>, meaning it is characterised by two parameters n and p, where n represents the number of trials and p the probability of success in each trial.<\/p>\n<p>In contrast, <strong>the Poisson distribution is uniparametric<\/strong>, meaning it is characterised by a single parameter &lambda; representing the average number of events per interval.<\/p>\n<p>Furthermore, the binomial distribution is used when the number of trials is finite and the number of successes cannot exceed n, whereas the Poisson distribution is used when the number of trials is essentially infinite.<\/p>\n<hr \/>\n<h2 id=\"practical-example\">A Practical Example<\/h2>\n<p>A vending machine malfunctions on average 3.4 times per week. What is the probability that the machine will <strong>not<\/strong> break down next week?<\/p>\n\\( P (X=0) = \\frac{e^{- \\lambda} \\cdot \\lambda ^{r}}{r!} \\\\ \\\\ = \\frac{e^{-3.4} \\cdot 3.4 ^{0}}{0!} = \\\\ \\frac{e^{-3.4} \\cdot 1}{1} = 0.033 \\\\ \\)\n<p>We notice that the probability is very low indeed &mdash; just 3.3%.<\/p>\n<p>Note: X=0 because we are looking at the probability that the machine does <strong>not<\/strong> break down.<\/p>\n<figure class=\"aligncenter\"><img loading=\"lazy\" decoding=\"async\" src=\"https:\/\/www.gironi.it\/blog\/wp-content\/uploads\/2023\/03\/DALL\u00b7E-2023-03-17-16.45.37-Una-distributore-automatico-di-bevande-in-stile-pop-art-300x300.png\" alt=\"A vending machine: an example to explain the Poisson distribution\" width=\"300\" height=\"300\" \/><figcaption><em>a battered vending machine&hellip;<\/em><\/figcaption><\/figure>\n<p>In R we would use the command:<\/p>\n<pre><code class=\"language-r\">dpois(0, 3.4)<\/code><\/pre>\n<p>Now let us calculate the probability that the vending machine breaks down exactly 3 times during the next week.<\/p>\n\\( P (X=3) = \\frac{e^{-3.4} \\cdot 3.4 ^{3}}{3!} = \\frac{e^{-3.4} \\cdot 39.304}{6} = 0.216 \\\\ \\)\n<p>The probability is 21.6%.<\/p>\n<p>Moving on to a third question: what are the expected value and the variance of the vending machine malfunctions?<\/p>\n\\( E(X) = \\lambda = 3.4 \\\\ Var(X) = \\lambda = 3.4 \\\\ \\)\n<p style=\"background-color:#f0f0f0;padding:1em;\">As we can see, within the Poisson distribution lambda represents not only the mean but also the <strong>variance<\/strong>. This is known as the <strong>mean-variance equality property of the Poisson distribution<\/strong>.<\/p>\n<p>Therefore, if lambda is large, the Poisson distribution will be more concentrated around its mean and its variance will also be large; if lambda is small, the distribution will be less concentrated around its mean and its variance will also be small.<\/p>\n<hr \/>\n<h2 id=\"seo-application\">The Poisson Distribution Applied to SEO<\/h2>\n<p>There are several aspects that make the Poisson distribution potentially interesting for website traffic analysis. It is a <strong>simple and well-understood statistical model<\/strong> that can be readily applied to website traffic data &mdash; for example, to estimate the <strong>average rate of requests or visits per unit of time<\/strong> and to predict the <strong>probability of observing a certain number of requests or visits in the future<\/strong>.<\/p>\n<p>However, we should keep in mind that there are also many limitations to using the Poisson distribution for SEO-oriented web traffic analysis.<\/p>\n<p>First, the Poisson distribution <strong>assumes that events occur independently and at a constant rate, which may not always hold for website traffic<\/strong>. For example, website traffic might exhibit <strong>peak frequencies<\/strong> or <strong>internal symmetry<\/strong> that the Poisson distribution cannot capture.<\/p>\n<p>Second, the <strong>Poisson distribution is a memoryless process<\/strong>, meaning it does not account for any history of past events. This can be a limitation when analysing website traffic data that display <strong>trends or seasonality<\/strong>.<\/p>\n<p>Third, the Poisson distribution assumes that <strong>events are discrete and countable<\/strong>, which may not always be appropriate for modelling continuous variables such as response time or page load time. Finally, the Poisson distribution is a simple model that may not capture all the complexities of real-world website traffic.<\/p>\n<p>There are several alternative models for website traffic analysis that can be used when the Poisson distribution is not appropriate.<\/p>\n<hr \/>\n<h2 id=\"alternative-models\">Alternative Models for Web Traffic Analysis<\/h2>\n<p>One alternative is the <strong>Negative Binomial distribution<\/strong>, which can handle overdispersion and capture peak frequencies or internal symmetry in website traffic data.<\/p>\n<p>Another alternative is the <strong>Lognormal distribution<\/strong>, which can be used to model continuous variables such as response time or page load time.<\/p>\n<p>The <strong>Exponential distribution<\/strong> can also be used to model the time intervals between requests or visits to a website.<\/p>\n<hr \/>\n<h2 id=\"clicks-example\">Using Poisson for Website Click Estimates<\/h2>\n<p>Suppose we have a website that receives on average 10 clicks per hour and we want to estimate the probability of getting a certain number of clicks in one hour using the Poisson distribution. We can use R to carry out the following steps:<\/p>\n<ol>\n<li>We start by loading the ggplot2 library and defining the average number of clicks per hour (our lambda):<\/li>\n<\/ol>\n<pre><code class=\"language-r\">library(ggplot2)\n\n# Average number of clicks per hour\nlam <- 10<\/code><\/pre>\n<p>2. We now compute the probability mass function (PMF) of the Poisson distribution for each possible number of clicks using the dpois() function. For example, to calculate the probability of getting exactly 15 clicks:<\/p>\n<pre><code class=\"language-r\">clicks <- 15\nprob <- dpois(clicks, lam)\ncat(paste(\"The probability of getting\", clicks, \"clicks per hour is\", prob, \"\\n\"))<\/code><\/pre>\n<p>The output is:<\/p>\n<pre>The probability of getting 15 clicks per hour is 0.0347180696306841<\/pre>\n<p>3. We compute the PMF of the Poisson distribution for a range of possible click counts using dpois() and display the results in a chart. For example, to calculate the probability of getting from 0 to 30 clicks:<\/p>\n<pre><code class=\"language-r\">x <- 0:30\npmf <- dpois(x, lam)<\/code><\/pre>\n<p>4. We now plot the probability for each possible number of clicks:<\/p>\n<pre><code class=\"language-r\">ggplot(data.frame(x=x, pmf=pmf), aes(x, pmf)) +\n  geom_bar(stat=\"identity\") +\n  xlab(\"Number of clicks\") +\n  ylab(\"Probability\") +\n  ggtitle(paste(\"PMF of the Poisson distribution with lambda =\", lam))<\/code><\/pre>\n<figure class=\"aligncenter\"><img decoding=\"async\" src=\"https:\/\/www.gironi.it\/blog\/wp-content\/uploads\/2023\/03\/PMF-Poisson.png\" alt=\"PMF of the Poisson distribution\" \/><\/figure>\n<p>5. We compute the CDF of the Poisson distribution and plot it:<\/p>\n<pre><code class=\"language-r\"># Compute the CDF of the Poisson distribution\ncdf <- ppois(x, lam)\n\n# Plot the CDF\nggplot(data.frame(x=x, cdf=cdf), aes(x, cdf)) +\n  geom_step() +\n  xlab(\"Number of clicks\") +\n  ylab(\"Cumulative probability\") +\n  ggtitle(paste(\"CDF of the Poisson distribution with lambda =\", lam))<\/code><\/pre>\n<figure class=\"aligncenter\"><img decoding=\"async\" src=\"https:\/\/www.gironi.it\/blog\/wp-content\/uploads\/2023\/03\/CDF-Poisson.png\" alt=\"CDF of the Poisson distribution\" \/><\/figure>\n<p>6. We calculate the number of clicks corresponding to a 90% probability:<\/p>\n<pre><code class=\"language-r\">q <- qpois(0.9, lam)\ncat(paste(\"For a 90% probability, the number of clicks must be up to\", q, \"\\n\"))<\/code><\/pre>\n<p>The output is:<\/p>\n<pre>For a 90% probability, the number of clicks must be up to 14<\/pre>\n<p>For convenience, here is the equivalent Python script:<\/p>\n<pre><code class=\"language-python\">import numpy as np\nimport matplotlib.pyplot as plt\nfrom scipy.stats import poisson\n\n# Define the average number of clicks per hour\nlam = 10\n\nclicks = 15\nprob = poisson.pmf(clicks, lam)\nprint(f\"The probability of getting {clicks} clicks per hour is {prob}\")\n\nx = np.arange(0, 31)\npmf = poisson.pmf(x, lam)\n\nplt.bar(x, pmf)\nplt.xlabel('Number of clicks')\nplt.ylabel('Probability')\nplt.title(f'PMF of the Poisson distribution with lambda = {lam}')\nplt.show()\n\ncdf = poisson.cdf(x, lam)\n\nplt.step(x, cdf)\nplt.xlabel('Number of clicks')\nplt.ylabel('Cumulative probability')\nplt.title(f'CDF of the Poisson distribution with lambda = {lam}')\nplt.show()\n\nq = poisson.ppf(0.9, lam)\nprint(f\"For a 90% probability, the number of clicks must be up to {q}\")<\/code><\/pre>\n<hr \/>\n<h3>You might also like<\/h3>\n<ul>\n<li><a href=\"https:\/\/www.gironi.it\/blog\/en\/probability-distributions-discrete-distributions-and-the-binomial\/\">Probability Distributions: Discrete Distributions and the Binomial<\/a><\/li>\n<li><a href=\"https:\/\/www.gironi.it\/blog\/en\/anomaly-detection-how-to-identify-outliers-in-data\/\">Anomaly Detection: How to Identify Outliers in Data<\/a><\/li>\n<li><a href=\"https:\/\/www.gironi.it\/blog\/en\/the-negative-binomial-distribution\/\">The Negative Binomial Distribution<\/a><\/li>\n<\/ul>\n<hr \/>\n<h3 id=\"further-reading\">Further Reading<\/h3>\n<p>For an accessible yet thorough introduction to probability distributions\u2014including the Poisson\u2014<a href=\"https:\/\/www.amazon.it\/dp\/8867319396?tag=consulenzeinf-21\" rel=\"nofollow sponsored noopener\" target=\"_blank\"><em>Finalmente ho capito la statistica<\/em><\/a> by Maurizio De Pra covers these topics in a clear and approachable style, ideal for building solid intuition before moving on to more advanced topics.<\/p>\n","protected":false},"excerpt":{"rendered":"<p>The Poisson distribution is a discrete probability distribution that describes the number of events occurring in a fixed interval of time or area. The Poisson distribution is useful for measuring how many events can occur within a given time horizon, such as the number of customers entering a shop in the next hour, or the &hellip; <a href=\"https:\/\/www.gironi.it\/blog\/en\/the-poisson-distribution\/\" class=\"more-link\">Leggi tutto<span class=\"screen-reader-text\"> &#8220;The Poisson Distribution&#8221;<\/span><\/a><\/p>\n","protected":false},"author":2,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"_uag_custom_page_level_css":"","footnotes":""},"categories":[161],"tags":[],"class_list":["post-3481","post","type-post","status-publish","format-standard","hentry","category-statistics"],"lang":"en","translations":{"en":3481,"it":898},"uagb_featured_image_src":{"full":false,"thumbnail":false,"medium":false,"medium_large":false,"large":false,"1536x1536":false,"2048x2048":false,"post-thumbnail":false},"uagb_author_info":{"display_name":"autore-articoli","author_link":"https:\/\/www.gironi.it\/blog\/author\/autore-articoli\/"},"uagb_comment_info":0,"uagb_excerpt":"The Poisson distribution is a discrete probability distribution that describes the number of events occurring in a fixed interval of time or area. The Poisson distribution is useful for measuring how many events can occur within a given time horizon, such as the number of customers entering a shop in the next hour, or the&hellip;","_links":{"self":[{"href":"https:\/\/www.gironi.it\/blog\/wp-json\/wp\/v2\/posts\/3481","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/www.gironi.it\/blog\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.gironi.it\/blog\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.gironi.it\/blog\/wp-json\/wp\/v2\/users\/2"}],"replies":[{"embeddable":true,"href":"https:\/\/www.gironi.it\/blog\/wp-json\/wp\/v2\/comments?post=3481"}],"version-history":[{"count":1,"href":"https:\/\/www.gironi.it\/blog\/wp-json\/wp\/v2\/posts\/3481\/revisions"}],"predecessor-version":[{"id":3491,"href":"https:\/\/www.gironi.it\/blog\/wp-json\/wp\/v2\/posts\/3481\/revisions\/3491"}],"wp:attachment":[{"href":"https:\/\/www.gironi.it\/blog\/wp-json\/wp\/v2\/media?parent=3481"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.gironi.it\/blog\/wp-json\/wp\/v2\/categories?post=3481"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.gironi.it\/blog\/wp-json\/wp\/v2\/tags?post=3481"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}