# Homework Help: Posterior Distribution for Number for Grouped Poissons

1. Nov 19, 2013

### SpringPhysics

1. The problem statement, all variables and given/known data
I am trying to determine the posterior distribution of N where given a sequence of n independence Poisson random variables, the first N come from Poisson(a1) and the next N+1st to the nth ones come from Poisson(a2). The prior distribution on N is discrete uniform on the integers from 1 to n-1.

2. Relevant equations

3. The attempt at a solution
I found the likelihood (which is the same as the posterior):

P(N|a1, a2) $\alpha$ e-N(a1-a2)(a1/a2)ƩXi where i goes from 1 to N

No matter how much I try to rearrange the terms, I can't find out what this distribution is. Any help would be appreciated. Thanks.
1. The problem statement, all variables and given/known data

2. Relevant equations

3. The attempt at a solution

2. Nov 19, 2013

### Ray Vickson

"Posterior" means "after an observation". What is the observation? Is it the sum of the random variables, or what?

3. Nov 19, 2013

### haruspex

The way I read the question, though it sounds a little weird, is that a number N is selected according to a distribution, then that number is used to produce a sequence of n terms in which the first N are selected from one Poisson distribution of known parameter, and the rest from a Poisson of known, different parameter. But we don't know what N was. The sequence obtained conveys information about N, so it now has a posterior distribution.
And the way I read the OP, SpringPhysics has figured out the relative probabilities for values of N, but needs to normalise them by dividing by the total. If so, SpringPhysics has done the hard work and it's a simple matter of summing a finite geometric series.
Everything is constant in the sum except N.

4. Nov 19, 2013

### SpringPhysics

haruspex:
Yes, I've already figured out the relative probabilities. I don't see how this is a sum of a geometric series though. Do you mean to simplify as

exp(Ʃ[Xi * (log(a1) - log(a2)) - (a1 - a2)]}
where the sum goes from i = 1 to N

I still don't recognize the distribution.

EDIT: I understand what you mean now, but I don't need to find the normalizing constant. I need to figure out what this distribution is so that I can perform Gibbs sampling.

EDIT 2: Oh, I see. So I actually have to compute the probability for each possible value of N by dividing the sum, which is actually doable since it's discrete? Thanks so much!

Last edited: Nov 19, 2013
5. Nov 19, 2013

### haruspex

Good job I was offline for a while