Mixture of a realization of uniform variable and noise Suppose that $X \sim U[0,1]$. After $X = x$ has realized, we don't observe $x$, but we instead observe a noisy signal of $x$, defined as $S = \tau x + (1 - \tau) U$, where $\tau \sim Ber(p)$ and $U \sim U[0,1]$. The interpretation is that the signal $S$ is equal to the true value $x$ w.p. $p$, while it is a pure noise w.p. $1-p$. Now, I want to derive the posterior distribution of $X$ given $S=s$. Intuitively $E[X\mid S]=\tau x + (1-\tau)\frac{1}{2}$, but not sure how to formally derive this.
My attempt is as follows. Since $f(X\mid S=s)=P(\tau=1\mid S=s)s+P(\tau=0\mid S=s)\times1$, we want to derive $P(\tau = 1\mid S = s)$, which is given by
$$
P(\tau=1\mid S=s) =\frac{P(s\mid\tau=1)p}{P(s\mid\tau=1)p+P(s\mid\tau=0)(1-p)}
 =\frac{\mathbb{I}(s=x)p}{\mathbb{I}(s=x)p+1\times(1-p)}.
$$
But, from here I'm not sure how to proceed.
Moreover, what happens if we observe two independent signals, i.e., $S_1 = \tau x + (1-\tau)U_1$ and $S_2 = \tau x + (1-\tau)U_2$ ? Can we write down the posterior distribution or expectation?
 A: First, a little intuition.
When $\tau = 1$, $X = S$. So $P(X = S) = p$. That means that once we're given $S = s$, $X = s$ with probability $p$.
When $\tau = 0$, then knowing that $S = s$ doesn't tell us anything about $X$, and $X \sim U[0,1]$ with probability $1-p$.
This mean that $X|S = s$ is a mixture of a uniform distribution and a degenerate distribution. It's easier to present the conditional CDF of $X|S = s$ than the conditional PDF because of the probability mass at $X = s$:
$F(x|S = s) = \left\{\begin{array}{lr}(1-p)(x) & 0 \leq x < s \\ (1-p)x + p & s \leq x \leq 1 \end{array}\right.$
For example, if $p = 0.6$ and we are given $S = 0.3$, then the conditional CDF would look like:

As for your second case where we see two realizations of the signal, $S_1 = \tau x + (1-\tau)U_1$ and $S_2 = \tau x + (1-\tau)U_2$ where $U_1$ and $U_2$ are both independent $U[0,1]$ random variables, there are two cases.

*

*If $\tau = 0$, then $S_1 = U_1$ and $S_2 = U_2$, meaning that $S_1 = S_2$ almost never. So if we observe $S_1 \neq S_2$, we can infer that $\tau = 0$ and $X \sim U[0,1]$.


*If $\tau = 1$, then $S_1 = S_2 = x$. So if we observe $S_1 = S_2$, we can infer that $X = s_1$.
When we observe two independent signals, we can nail down the value of $X$ exactly with probability $p$, and can narrow down its distribution to a uniform distribution with probability $1-p$.
If instead, the two independent signals are based on independent $\tau$ draws, so that $S_1 = \tau_1 x + (1-\tau_1)U_1$ and $S_2 = \tau_2 x + (1-\tau_2)U_2$, then there are four outcomes.

*

*$P(\tau_1 =0, \tau_2 = 0) = (1-p)^2$


*$P(\tau_1 =0, \tau_2 = 1) = p(1-p)$


*$P(\tau_1 =1, \tau_2 = 0) = p(1-p)$


*$P(\tau_1 =1, \tau_2 = 1) = p^2$
If we observe $S_1 = S_2$, we know we have case 4.
If we observe $S_1 \neq S_2$, we don't know which of cases 1, 2, or 3 we are dealing with, but we do know that they occur with conditional probabilities $\frac{1-p}{1+p}, \frac{p}{1+p}$, and $\frac{p}{1+p}$, respectively. Now, the conditional CDF will have two jumps, each of length $\frac{p}{1+p}$, at $s_1$ and $s_2$ corresponding to cases 3 and 2, respectively, and a slope of $\frac{1-p}{1+p}$.
So in general (apologies for all the indicator functions) the conditional CDF would be
$F(x | S_1 = s_1, S_2 = s_2) = \left\{\begin{array}{lcr}\mathbf 1_{[s_1, 1]}(x) & \mbox{if} & s_1 = s_2 \\ \mathbf 1_{[0,1]}(x)\left(\frac{1-p}{1+p}\right)x + \mathbf 1_{[s_1, 1]}(x)\left(\frac{p}{1+p}\right) + \mathbf 1_{[s_2, 1]}(x)\left(\frac{p}{1+p}\right) + \mathbf 1_{(1, \infty)}(x) & \mbox{if} & s_1 \neq s_2\end{array}\right.$
As one last example, if $S_1 = 0.1, S_2 = 0.7$, and $p = 0.5$, the CDF would look like

