Solved – Marginal of a uniform distribution

marginal-distributionself-studyuniform distribution

Given $f\left(x|\theta\right)=1/\theta, 0\leq x\leq \theta,L\left(\theta, a\right)=\left(a-\theta\right)^2,$ and $\pi\left(\theta\right)=\theta e^{-\theta},\theta\gt 0$

I've seen Problem calculating joint and marginal distribution of two uniform distributions, but it's not what I'm looking for.

Problem: calculate the marginal density of $x$, i.e., $f\left(x\right)$.

\begin{eqnarray}
f\left(x\right) &=& \int f\left(x|\theta\right)\pi\left(\theta\right)d\theta\\\
&=& \int \frac{1}{\theta}\cdot\theta\cdot e^{-\theta}d\theta\\\
&=& \int e^{-\theta}d\theta.
\end{eqnarray}

Somehow the last equation should turn out to be $e^{-x}$, according to the book. I don't see how this is true, since I'm integrating over $\theta$. I don't understand why $x$ should end up in the solution since it's nowhere in the original equation. I'm also not sure what the limits of integration are. If $\theta > 0$, then I though maybe they should be $\left[0, \infty\right)$, but that gives $1$ as the solution to the integration.

Best Answer

You seem to be a little confused about the likelihood function of the $U[0,\theta]$ model.

Let $f(x\mid\theta)=1/\theta$, for $0\leq x\leq\theta$, and $f(x\mid\theta)=0$, otherwise, for $\theta>0$.

For some fixed $x$, what is the graph of $f(x\mid\theta)$ as a function of $\theta$?

To draw the graph, notice -- and this is the key point -- that $x\in[0,\theta]$ if and only if $\theta\in[x,\infty)$.

So, using indicator functions, we have $$f(x\mid\theta)=\frac{1}{\theta}I_{[0,\theta]}(x)=\frac{1}{\theta}I_{[x,\infty)}(\theta)\, .$$

After you understand this, just do the integration: $$f(x)=\int_0^\infty f(x\mid\theta)\pi(\theta)\,d\theta = \int_x^\infty \frac{1}{\theta}\pi(\theta)\,d\theta\, .$$

Related Question