# Bayesian statistics - finding a posterior distribution

Suppose the number of sales, N, in a year on a sales portfolio has a poisson distribution with parameter $\lambda$. Sales are either large with probability $p$ or small with probability $1-p$, independently from each other.

Suppose we observer $r$ large sales. Show that the conditional distribution of $N - r \mid r$ is poisson.

I've managed to complete the question from first principles:

Let $R$ be the number of large sales, we have $R \mid N$ is binomially distributed with parameters $N$ and $p$.

If we consider $P(N - r = s \mid R = r)$ and apply Bayes conditional probability formula we eventually get the result.

I am wondering if there is perhaps a simplier way to do it? For instance, could we perhaps just directly use the the result that, $$\text{ Posterior PDF } \propto \text{Prior PDF } \times \text{ Likelihood}$$ that is, $$f(\theta \mid x) \propto f(\theta) \times L(x \mid \theta)$$

Can this general formula be applied in this case as a shortcut?

• When the $\text{“} \propto \text{''}$ symbol is used in this context, sometimes it may be too easy to forget that it does not mean proportional as a function of $x,$ but rather proportional as a function of $\theta. \qquad$ – Michael Hardy Aug 30 '17 at 19:50
• If you know the desired final form, or suspect it might be a member of a known family, a useful trick is to take the logarithm, simpify the sum of the log prior and the log-likelihood, and then by matching it to a known family you can identify the posterior and its normalising constant immediately – Nadiels Aug 30 '17 at 19:52

Let's call the random variables for total sales $N$, larger sales $R$ and smaller sales $M$. Clearly $N=R+M$.

You are looking for $\Pr(M=m\mid R=r)$ and how it varies with $m$. Using your Bayes expression and dropping multiplicative terms unrelated to $m$, this is $$\Pr(N=m+r\mid R=r)$$ $$\propto \Pr(N=m+r)\Pr(R=r \mid N=m+r)$$ $$= \frac{e^{-\lambda} \lambda^{m+r}}{(m+r)!} \frac{(m+r)!}{r!\, m!}p^r(1-p)^{m}$$ $$\propto \frac{(\lambda(1-p))^{m}}{ m!}$$ which is proportional to the probability mass function of a Poisson distribution with parameter $\lambda(1-p)$

• Incidentally, since the final expression does not contain $r$, this implies $M$ and $R$ are independent – Henry Aug 31 '17 at 7:47

$N \sim\operatorname{Poisson}(\lambda)$ and $R\mid N \sim\operatorname{Binomial}(N,p).$ \begin{align} & \Pr( R = r) = \operatorname{E}(\Pr(R = r \mid N)) \\[10pt] = {} & \operatorname{E}\left( \binom N r p^r (1-p)^{N-r} \right) = \sum_{n=0}^\infty \binom n r p^r(1-p)^{n-r} \Pr(N=n) \\[10pt] = {} & \sum_{n=r}^\infty \text{starting at }n=r\text{ rather than } n=0 \text{ because } \binom n r = 0 \text{ when } n<r \\[10pt] = {} & \sum_{n=r}^\infty \binom n r p^r(1-p)^{n-r} \frac {\lambda^n e^{-\lambda}} {n!} = \sum_{n=r}^\infty \frac{p^r}{r!} \cdot \frac{(1-p)^{n-r}}{(n-r)!} \cdot \lambda^n e^{-\lambda} \end{align} The factors $\dfrac{p^r}{r!}$ and $e^{-\lambda}$ can be pulled out of the sum because they do not change as $n$ changes.

Then the substitution $m=n-r$ changes $\sum_{n=r}^\infty$ to $\sum_{m=0}^\infty,$ starting at $0$ rather than at $r.$

So you have $$\sum_{m=0}^\infty \frac{(1-p)^m}{m!}.$$ And that is $e^{1-p}.$ Then fill in the rest of the algebraic details.

That's one way. Maybe if I'm back later I'll see if there's another convenient way to do it.

• Thanks for your answer. I guess I am trying to get it of the form similar to the question: math.stackexchange.com/questions/321573/… - however I am having trouble deciding what the "prior" and the "likelihood" is here, as the answer seems like a posterior. – DH. Aug 30 '17 at 20:56