Calculate the Poisson parameter given a probability

1.2k Views Asked by At

I was looking at this question, but it never received an answer. Is it possible to calculate $\lambda$ (the expected number) from a probability?

I know that $\lambda$ is easily calculated if, say, we know that the P(X=0 crashes per month) = .05. Then $\lambda$ is $-\ln(.05)$ crashes per month.

But what if we are given that P(X=5 crashes per month)=.05. How would I find the expected number of crashes a month in that case? (if it is even possible)

2

There are 2 best solutions below

1
On BEST ANSWER

I see in the comments you have reduced it to solving $$\lambda^5 e^{-\lambda} = 6$$ which has "exact" solutions in terms of the Lambert W-function, but as a practical matter you should graph it and find the solution using a computer or calculator. (You also asked about approximation methods. Though I think this is a bit of a waste of time for the question at hand... Newton's method?)

Hey, but wait... if you graph it you'll see pretty clearly that there are two real positive solutions, one between $2$ and $3$ and one between $9$ and $10$. Which one is right? Well, they actually both have to be right. In the Poisson distribution, $\lambda$ is allowed to be any positive real number, and if you set $\lambda$ to either of those in you'll get $P(X=5) = .05.$

What's going on? If you start with lambda really small, $P(X=5)$ will be tiny, and as you increase it, it will increase. Eventually it will pass $.05$. Then it will keep increasing until $\lambda=5$ and it is maximally probable that $X=5.$ Then as you increase $\lambda$ further, $X$ will start to prefer to be bigger than $5$ and the probability it is $5$ will decrease, crossing $.05$ again on the way down.

So it makes sense that there are two solutions. Also, if you picked a number much larger than $.05,$ you would risk picking it too high so that it has no solutions. In other words, even when $\lambda = 5,$ there is still not that much probability that $X=5.$

0
On

Given $X \sim \mathsf{Pois}(\lambda)$ and $P(X=5)=0.05,$ you seek numerical approximations to $\lambda.$

This is to follow up on @spaceisdarkgreen's suggestion (+1). [I suggest you click to Accept that answer.] I give code below in R statistical software, to make the appropriate plot and get some numerical results.

Some authors call the general method implemented in the code a grid search. It is a brute force method that tries lots of evenly-spaced values of $\lambda$ and picks satisfactory ones. Perhaps the method is inelegant and inefficient, but it is easy to program and well within the capabilities of most personal computers.

There are indeed two possible solutions: (a) $\lambda_1 \approx 2.22950,$ but values between 2.157 and 2.319 give $P(X=5)=0.05$ to two places; (b) $\lambda_2 \approx 9.42515,$ but values between 9.220 and 9.647 also give two-place accuracy for the target probability.

With just a sketch and a bit of trial and error on a calculator you should be able to get close enough values for $\lambda_1$ and $\lambda_2$ for your purposes.

lam = seq(.1, 12, by=.00001);  y = lam^5*exp(-lam)
plot(lam,y,type="l", col="blue", lwd=2); abline(h=6, col="darkgreen")
lam[y==max(y)]
## 5

lam = seq(.1, 3, by=.00001);  y = lam^5*exp(-lam)
lam1 = lam[abs(y-6)==min(abs(y-6))]; lam1
## 2.2395                                 # best val < 3
min(lam[round(dpois(5,lam),2)==.05])
## 2.15686
max(lam[round(dpois(5,lam),2)==.05])
## 2.31933

lam = seq(6, 10, by=.00001);  y = lam^5*exp(-lam)
lam2 = lam[abs(y-6)==min(abs(y-6))]; lam2
## 9.42515                                # best val > 6
min(lam[round(dpois(5,lam),2)==.05])
## 9.21958
max(lam[round(dpois(5,lam),2)==.05])
## 9.64665

abline(v=c(lam1,lam2), col="red")         # red lines on graph
dpois(5, lam1); dpois(5, lam2)            # probs corresp to best values
## 0.05000018
## 0.04999994

enter image description here

Note: The function $y(\lambda)$ of the program is the likelihood function of $\lambda$ for data $X = 5$ (up to a constant factor). The third line of code illustrates that, given $X = 5$, the maximum likelihood estimator of $\lambda$ is $\hat \lambda = 5.$