4

I was experimenting with Poisson distribution on desmos and noticed that as $\lambda$ (the mean of distribution) gets larger, the x coordinate of distribution peak approaches $\lambda-0.5$. Why is it so?

  • Does https://stats.stackexchange.com/questions/210475/why-two-modes-for-a-poisson-distribution-with-lambda-an-integer/211612#211612 answer your question? – whuber Jan 09 '22 at 21:08
  • 2
    See [Wikipedia](https://en.wikipedia.org/wiki/Poisson_distribution) for mode of Poisson distribution. Roughly, mode must be an integer (a little below $\lambda$ (or if $\lambda$ is integer, double mode at $\lambda$ and $\lambda-1.)$ – BruceET Jan 09 '22 at 21:41
  • @BruceET i.e at the nearest integer(s) to $\lambda-0.5$ – Henry Jan 10 '22 at 00:56
  • 1
    @Henry Not the nearest integer: the mode is the *floor* of $\lambda.$ – whuber Jan 10 '22 at 14:25
  • @whuber there is not much difference between the floor of $\lambda$ and the nearest integer to $\lambda-0.5$, and when there is (when $\lambda$ is an integer) then the latter might be thought to be slightly better in identifying the double mode. – Henry Jan 10 '22 at 17:12
  • @Henry "Not much difference" means *in half the cases, it's different.* Why not use a simple, correct characterization of the mode rather than an approximate one that is wrong half the time? – whuber Jan 10 '22 at 18:00
  • 1
    @whuber. A lot more than half the cases - in fact every case except when $\lambda$ is an integer. For example if $\lambda=7.9$ then the nearest integer to $\lambda-0.5 = 7.4$ is $7 =\lfloor 7.9\rfloor$. If $\lambda=7.3$ then the nearest integer to $\lambda-0.5 = 6.8$ is $7 =\lfloor 7.3\rfloor$. – Henry Jan 10 '22 at 18:09
  • 1
    @Henry Sorry, I was misreading you. The nearest integer to $\lambda-0.5$ indeed is *identical* to the rule I gave. Thanks for your patience in setting me straight! – whuber Jan 10 '22 at 18:11

2 Answers2

8

The mode of the Poisson distribution occurs at the value $\text{Mode}(\lambda) = \lceil \lambda \rceil - 1$, whereas your proposed approximation is:

$$\widehat{\text{Mode}}(\lambda) \equiv \lambda - \tfrac{1}{2}.$$

Letting $u(\lambda) \equiv \lceil \lambda \rceil - \lambda$ denote the "upper remainder" of the number $\lambda$ we can write the difference between the true mode and your approximation as:

$$\begin{align} \text{DIFF} \equiv \text{Mode}(\lambda) - \widehat{\text{Mode}}(\lambda) &= (\lceil \lambda \rceil - 1) - (\lambda-\tfrac{1}{2}) \\[6pt] &= (\lceil \lambda \rceil - \lambda) -\tfrac{1}{2} \\[6pt] &= u(\lambda) - \tfrac{1}{2}. \\[6pt] \end{align}$$

It is simple to establish that $-\tfrac{1}{2} \leqslant \text{DIFF} < \tfrac{1}{2}$ so your approximation is near to the true mode. As $\lambda \rightarrow \infty$ the relative error in the approximation converges to zero.

Ben
  • 91,027
  • 3
  • 150
  • 376
5

The analysis at https://stats.stackexchange.com/a/211612/919 shows the mode of any Poisson$(\lambda)$ distribution is near $\lambda$ itself. Although that question concerns only integral $\lambda,$ its results answer the present question, too.

Let $p_\lambda(k)$ be the Poisson$(\lambda)$ probability for $k\in\{0,1,2,\ldots,\}$ (all other probabilities are zero, of course). These probabilities are proportional to the ratios

$$p_\lambda(k) \ \propto\ \frac{\lambda^k}{k!}.$$

As pointed out in the foregoing link, this means two successive Poisson probabilities are related by

$$p_\lambda(k+1) = \frac{\lambda}{k+1} p_\lambda(k).$$

Consequently, as $k$ progresses from $0$ through all integers less than $\lambda-1,$ the probability increases from $p_\lambda(k)$ to $p_\lambda(k+1);$ and then once $k$ exceeds $\lambda-1,$ the probability decreases. Therefore

All Poisson probability functions $p_\lambda$ rise to a peak and then fall again. The peak (a mode) occurs at the greatest integer less than $\lambda,$ written $\lfloor \lambda\rfloor.$ When $\lambda$ is an integer, the peak occurs at the two neighboring values $\lfloor \lambda\rfloor$ and $\lfloor \lambda\rfloor + 1.$

To illustrate, here is a plot of the modes based on a brute-force search.

Figure

The search was conducted by this R function. It evaluates the Poisson probabilities for $k$ between two suitable extreme quantiles, finds the indexes where the largest probability occurs, and returns an array of the values of $k$ corresponding to those indexes.

mode <- function(lambda) {
  q <- min(1/2, ppois(floor(lambda), lambda))          # This is *a* probability
  k <- do.call(seq, as.list(qpois(c(q, 1-q), lambda))) # Search limits
  p <- dpois(k, lambda)
  k[which(p == max(p))]
}
whuber
  • 281,159
  • 54
  • 637
  • 1,101
  • Exceptionally clear. For the R code line where you find the quantile of a value marginally less than one, using $1-1e-10$, is this so you do not get a value of infinity returned from qpois? – Single Malt Jan 10 '22 at 15:35
  • @Single Yes, that's exactly right. A fully general algorithm would first find an apparent mode (look near $\lambda$!) and then search out into both tails until any *remaining* probability is less than the probability at the tentative mode(s). It could then stop, knowing that no *global* maximum probability could be lurking further out in the tails. Instead, I took a mindlessly simple `R`-oriented approach that will work for any reasonably small $\lambda.$ "Small" means $\lambda \le 10^{23},$ approximately: my code will fail for much larger values than that. – whuber Jan 10 '22 at 15:48
  • 1
    In light of this issue, I have modified the `R` code to implement this "smarter" algorithm. It's still pointless to use it for $\lambda \gg 10^{7.5}$ or so, because floating point imprecision starts introducing detectable error. – whuber Jan 10 '22 at 15:57