# Maximum a posteriori estimate with exponential prior

Lets say that I have N observations that are poisson and i.i.d. The prior is an exponential with parameter 2. I know that the exponential distribution is given by

$$\lambda e^{(-\lambda x)}$$

But how does it work with x when you multiply the prior times the likelihood to get the maximum a posteriori (MAP) estimate? In most places, they seem to just set $$x=1$$, but I don't understand why.

This would lead to the the MAP estimate to be

$$\operatorname{argmax} \quad \lambda^{\sum x_n}e^{-\lambda N}e^{-2\lambda}$$

So my question is, how do you handle $$x$$ in the exponential distribution when it is a prior?

I'm not clear on the question, so I'm going to write some exposition and then finish my answer when you've clarified.

The Maximum A Posteriori estimate is, as you've said, is

$$\hat{\lambda} = \underset{\lambda \in \mathbb{R}_+}{\mbox{argmax}} \left\{ \ell(\lambda; x) + \log(p(\lambda)) \right\}$$

Here, $$\ell(\lambda;x)$$ is the log likelihood and $$p(\lambda)$$ is the prior density. The prior for $$\lambda$$ depends on a different parameter which we will call $$k$$. The likelihood (poisson) is

$$\dfrac{\lambda ^x e^{\lambda}}{\Gamma(x+1)}$$

The prior is (remember, $$\lambda$$ is the variable, $$k$$ is the parameter)

$$k \exp(-k \lambda)$$

The log posterior is then (if my algebra is correct)

$$N \bar{x}\log(\lambda) - N \lambda - \sum_i\log(\Gamma(x_i+1)) - \log(k) - k \lambda$$

From here, you can differentuate with respect to lambda and solve.

$$0 = \dfrac{N \bar{x}}{\lambda} - N -k \implies \lambda = \dfrac{N}{N+k} \bar{x}$$

Does your question concern $$k$$, the parameter in the prior?

• Okay, so x (I guess that would correspond to your k) in my definition of the exponential function has nothing to do with any observations then? – user5744148 Mar 20 at 0:33
• @user5744148 Correct, the prior density is not a function of the observed data. The name implies that it necessarily comes prior. – Demetri Pananos Mar 20 at 0:34