I'm now learning Bayesian inference.This is one of the questions I'm doing.
Suppose we have R.V.s $X_1,X_2,\ldots,X_n$ each have an Exponential distribution with parameter $\theta$. and prior for $\theta$ is an Exponential distribution with parameter $\lambda$. So what would you do to find posterior?
Attempts: Prior should be PDF of exponential with parameter $\lambda$. Likelihood should be product of PDF of exponential of each $X_i$, with parameter $\theta$.
Then what would you do next?
Many thanks.
Use the fact that: $$ f(\theta|x_1,...,x_n)=\frac{L(\theta)*p(\theta)}{\int_{-\infty}^\infty L(\theta)*p(\theta)d\theta}$$ Where $L(\theta)$ is the likelihood function, $p(\theta)$ is the prior, and $f(\theta|x_1,...,x_n)$ is the posterior distribution.
In this case, you have that: $$ f(\theta|x_1,...,x_n)=\frac{\theta^ne^{-\theta \sum_{i=1}^nX_i}*\lambda e^{-\lambda\theta}}{\int_0^\infty \theta^ne^{-\theta \sum_{i=1}^nX_i}*\lambda e^{-\lambda\theta} d\theta}$$