I'd like to estimation the parameter $ \lambda $ for IID $ \left\{ {x}_{i} \right\}_{i = 1}^{N} $ where $ {x}_{i} \sim \exp \left( \lambda \right)$, now I also have the prior knowledge that $ \lambda $ has a normal distribution that $\lambda \sim N(\mu,\delta^2)$, where the $\mu$ and $\delta$ are expected to be known.
The Exponential Distribution is given by:
$$ f(x; \lambda) = \begin{cases} \lambda {e}^{-\lambda x} & x \ge 0, \\ 0 & x < 0. \end{cases} $$
If there is anything that is not clear about the problem, please let me know! thank you very much.
$$P(\lambda|\{x_i\}_{i=1}^{N}) = \frac{P(\{x_i\}_{i=1}^{N}|\lambda)P(\lambda)}{P(\{x_i\}_{i=1}^{N})}$$
$$\log P(\lambda|\{x_i\}_{i=1}^{N}) = \log P(\{x_i\}_{i=1}^{N}|\lambda) + \log P(\lambda) - \log P(\{x_i\}_{i=1}^{N})$$
Since, we will be taking derivative wrt $\lambda$ of the above equation to find the MAP estimate, the last term which is independent of $\lambda$ need not be computed.
$$P(\lambda) = \frac{1}{\sqrt{2\pi}\delta}e^{-\frac{1}{2}\left(\frac{\lambda-\mu}{\delta}\right)^2} \implies \log P(\lambda) = -\log(\sqrt{2\pi}\delta) -\frac{1}{2}\left(\frac{\lambda-\mu}{\delta}\right)^2$$
$$P(\{x_i\}_{i=1}^{N}|\lambda) = \prod_{i=1}^{n}P(x_i|\lambda) = \lambda^n e^{-\lambda \sum_{i=1}^{n}x_i} \implies \log P(\{x_i\}_{i=1}^{N}|\lambda) = n\log \lambda - \lambda \sum_{i=1}^{n}x_i$$
$$\therefore \ \ \frac{\partial \log P(\lambda|\{x_i\}_{i=1}^{N})}{\partial \lambda} = 0 \implies \frac{n}{\lambda} - \sum_{i=1}^{n}x_i - \frac{1}{\delta}\left(\frac{\lambda - \mu}{\delta}\right) = 0$$
$$\implies n\delta^2 - n\bar{x}\delta^2 \lambda -\lambda^2+\lambda \mu = 0 \implies \lambda^2 +\lambda(n\bar{x}\delta^2-\mu) - n\delta^2 = 0$$
$$\implies \lambda = \frac{\mu - n\bar{x}\delta^2 \pm \sqrt{(n\bar{x}\delta^2-\mu)^2 + 4n\delta^2}}{2} = \lambda_{+}, \lambda_-$$
Using the fact that $\lambda$ must be positive, we ignore $\lambda_-$.
$$\frac{\partial^2 \log P(\lambda|\{x_i\}_{i=1}^{N})}{\partial \lambda^2}\bigg\vert_{\lambda = \lambda_+} = -\frac{n}{\lambda_+^2} - \frac{1}{\delta^2} < 0$$
Therefore, $\lambda_+$ is a maximum and the MAP estimate of $\lambda$.