2

I am thinking about the following model: $$ \theta \sim \mathcal{U}[c- \epsilon, c+\epsilon],\\ x \mid \theta\sim \mathcal{U}[\theta - \epsilon, \theta + \epsilon]. $$

I want to derive the marginal distribution of $x$. Intuitively, when $\theta$ takes $c-\epsilon%$ then $x \sim \mathcal{U}[c-2\epsilon, c]$ and when $\theta$ takes $c+\epsilon$ then $x \sim \mathcal{U}[c, c + 2\epsilon]$. Since $\theta$ is uniform, $x\sim \mathcal{U}[c-2\epsilon, c + 2\epsilon]$. I want to derive this formally. My attempt is $$ f(x)=\int_{c-\epsilon}^{c+\epsilon}f(x\mid\theta)f(\theta)d\theta=\int_{c-\epsilon}^{c+\epsilon}\frac{1}{2\epsilon}\frac{1}{2\epsilon}d\theta=\frac{1}{4\epsilon}\int_{c-\epsilon}^{c+\epsilon}d\theta=\frac{1}{4\epsilon}2\epsilon=\frac{1}{2\epsilon}. $$

But, this is inconsistent with $x\sim \mathcal{U}[c-2\epsilon, c + 2\epsilon]$, which I think is true. What am I missing?

giac
  • 821
  • 5
  • 20
user789100
  • 55
  • 3
  • 2
    Since $x-\theta$ has a uniform distribution, the distribution of $x$ is that of the sum of two independent uniforms. Specifically, when $U$ and $V$ are independent uniform$(0,1)$ variables, $\theta=c + \epsilon(2U-1)$ and $x-\theta=\epsilon(2V-1),$ whence $$x = c + \epsilon(2U-1)+\epsilon(2V-1) = (c-2\epsilon) + 2\epsilon(U+V)$$ shows exactly how $x$ is related to $U+V.$ For many ways to understand and compute the distribution of $U+V,$ please see https://stats.stackexchange.com/a/43075/919. In any event, I warmly recommend **drawing a picture** in the $(\theta,x)$ plane. – whuber Feb 01 '22 at 23:13
  • 1
    Drawing a picture resulted in a parallelogram, which helped me understand the point @gunes raised. Also, the linked post was really great, thank you! – user789100 Feb 02 '22 at 00:20
  • I also recommend the use of indicator functions. – Xi'an Feb 02 '22 at 06:54

1 Answers1

2

Your argument is intuitively wrong, $x$ can be $c-2\epsilon$ only if $\theta=c-\epsilon$. However, $x$ can be $c$ for infinite number of possible values of $\theta$. So, the middle values in the range $[c-2\epsilon, c+2\epsilon]$ have higher likelihood of appearing while sampling $x$ compared to the corner values. It's not uniform.

The integral calculation has errors as well. For example, for $x=c-2\epsilon$, the integral limits can't reach $c+\epsilon$ because $f(x=c-2\epsilon|\theta=c+\epsilon)$ is $0$ instead of $1/2\epsilon$. Uniform random variables needs extra care when dealing with their boundaries. The actual uniform PDF is like the following, not just a constant:

$$f(x|\theta)=\frac{1}{2\epsilon}I(\theta-\epsilon\leq x\leq \theta+\epsilon)$$

Integrating with these indicator functions might be tricky. For this particular case, you need to consider intervals of $x$. A good way to visualize is to plot the regions on an x-y plane and integrating/marginalizing there.

gunes
  • 49,700
  • 3
  • 39
  • 75