To compute the posterior distribution, we use Bayes' theorem:
\(\pi(\lambda|X_1,X_2,...,X_n) \propto \pi(\lambda) \times \prod_{i=1}^{n} f(X_i|\lambda)\)
where \(\pi(\lambda)\) is the prior distribution and \(f(X_i|\lambda)\) is the likelihood function.
In this case, the prior distribution \(\pi(\lambda)\) is an exponential distribution, given by \(\pi(\lambda) \sim \textsf{Exp}(a)\).
The likelihood function is given by \(f(X_i|\lambda) = \frac{1}{\sqrt{2\pi}}e^{-\frac{(X_i-\lambda)^2}{2}}\).
Therefore, the posterior distribution is given by:
\(\pi(\lambda|X_1,X_2,...,X_n) \propto e^{-a\lambda} \times e^{-\frac{1}{2}\sum_{i=1}^{n}(X_i-\lambda)^2}\)
Multiplying the exponential terms and simplifying, we get:
\(\pi(\lambda|X_1,X_2,...,X_n) \propto e^{-(a+\frac{n}{2})\lambda + \sum_{i=1}^{n}X_i\lambda - \frac{1}{2}\sum_{i=1}^{n}X_i^2}\)
We recognize the exponential distribution in the exponent, so we can factor out the normalizing constant to find the proportional form of the posterior distribution:
\(\pi(\lambda|X_1,X_2,...,X_n) \propto e^{-(a+\frac{n}{2})\lambda}\times e^{-\frac{1}{2}(\sum_{i=1}^{n}X_i^2 - 2\lambda\sum_{i=1}^{n}X_i)}\)
This is a proportional form of a gamma distribution with shape parameter \(a^* = a + \frac{n}{2}\) and rate parameter \(b^* = \sum_{i=1}^{n}X_i\).
Therefore, the posterior distribution is given by \(\pi(\lambda|X_1,X_2,...,X_n) \sim \textsf{Gamma}(a^*, b^*)\).
Now, let's move on to computing the median and mode of the posterior distribution.
The median of a gamma distribution is given by \(\lambda = \frac{a^* - 1}{b^*}\). Therefore, the median of the posterior distribution is:
\(\text{median} = \frac{a + \frac{n}{2} - 1}{\sum_{i=1}^{n}X_i}\)
The mode of a gamma distribution is given by \(\lambda = \frac{a^* - 1}{b^*}\) if \(a^* > 1\), otherwise the mode is undefined. Therefore, the mode of the posterior distribution is:
\(\text{mode} = \frac{a + \frac{n}{2} - 1}{\sum_{i=1}^{n}X_i}\) if \(a + \frac{n}{2} > 1\), otherwise the mode is undefined.
Now, suppose that we instead have the proper prior \pi (\lambda ) \sim \textsf{Exp}(a) (a > 0). Again, just as in part (b): conditional on \lambda, we have observations X _1, X _2, \cdots, X _{n} \stackrel{\text {i.i.d}}{\sim } \textsf{N}(\lambda , 1). You may assume that a < \displaystyle \sum _{i=1}^{n} X_ i. Compute the posterior distribution \pi (\lambda | X_1, X_2, \ldots , X_ n), then provide the following statistics on the posterior distribution. Write Phi for the CDF function \Phi () and PhiInv for its inverse.
Use SumXi for \sum _{i=1}^ n X_ i.
median:
unanswered
[Math Processing Error]
mode:
1 answer