The variance of bilateral filtered random variables I am glad to have found this great site. There is a problem I am trying to solve for a while. I want to analyze the noise attenuation behavior of the bilateral filter. So given the unnormalized Gaussian function
$$\phi(z)=\exp(-\frac{1}{2}z^2)$$
I define weights 
$$w(x)=\phi\left(\frac{x}{\sigma_s}\right)\phi\left(\frac{X_0-X_x}{\sigma_r}\right)$$
which are basically the product of two Gaussian functions. $X_x$ is a stationary random process which is independent and identically normal distributed for all $x$, i.e.,
$$\{X_x\sim \mathcal{N}(y,\sigma_n^2) \,:\, \forall x \in \mathbb{R}\}.$$
Now I am interested to find an analytic expression of the variance $\sigma_b^2$ defined as
$$\sigma_b^2=Var\left\{\int\limits_{-\infty}^\infty \frac{w(x)}{\int_{-\infty}^\infty w(\tilde{x})d\tilde{x}}X_x dx\right\}$$
as a function of $(\sigma_n,\sigma_s,\sigma_r)$.
For the simpler linear filtering case $w(x)=\phi(\frac{x}{\sigma_s})$ I have got the solution, which is:
$$\sigma_b^2=\int\limits_{-\infty}^{\infty} \left(\frac{\exp\left(-\frac{x^2}{2\sigma_s^2}\right)}{\sqrt{2\pi}\sigma_s}\right)^2\sigma_n^2 dx
=\frac{\sigma_n^2}{2\pi\sigma_s^2}|\sigma_s|\sqrt{\pi}=\frac{\sigma_n^2}{2\sqrt{\pi}\sigma_s }.$$
But I don't know how to use the bilateral weights defined above.
Any advise is highly appreciated.
 A: 
Sobering fact: Consider some i.i.d. random variables $(X_x)_{0\leqslant x\leqslant 1}$. Then the integral $\displaystyle\int_0^1X_x\,\mathrm dx$ does not exist unless $\mathrm P(X_x=z)=1$ for some $z$.

To prove this, remember how integrals are defined. The upper and lower Darboux sums associated to a partition $\tau=(t_k)$ of $[0,1]$ are
$$
U_\tau=\sum_k(t_k-t_{k-1})\sup\{X_x\mid t_{k-1}\leqslant x\leqslant t_k\},
$$
and
$$
L_\tau=\sum_k(t_k-t_{k-1})\inf\{X_x\mid t_{k-1}\leqslant x\leqslant t_k\},
$$
respectively, and the integral exists if $U_\tau-L_\tau$ can be made as small as desired by imposing that the mesh of $\tau$ is small enough. And now, the bad news:

Let $M$ and $m$ denote the upper and lower limits of the support of the common distribution of the random variables $X_x$. Then $\sup\{X_x\mid s\leqslant x\leqslant t\}=M$ and $\inf\{X_x\mid s\leqslant x\leqslant t\}=m$ almost surely, for every $s\lt t$.

(Hint: Apply the law of large numbers to the events $A_x=[X_x\geqslant z]$ and $B_x=[X_x\leqslant z]$, for every given $z$.)
Thus, for every partition $\tau$, $U_\tau=M$ and $L_\tau=m$ almost surely. In particular, $\displaystyle\int_0^1X_x\mathrm dx$ does not exist as soon as $m\lt M$. For (non-degenerate) gaussian random variables, $m=-\infty$ and $M=+\infty$.
To conclude:

For i.i.d. (non-degenerate) random variables $(X_x)_x$, the object $\displaystyle\int_0^1X_x\mathrm dx$ does not exist.

Turning to Riemann sums $R(\tau,\xi)$, the situation is not any better. Recall that
$$
R(\tau,\xi)=\sum_k(t_k-t_{k-1})X_{\xi_k},
$$
where $\tau=(t_k)$ is a partition of $[0,1]$ and $\xi=(\xi_k)$ is a tag of $\tau$ in the sense that $t_{k-1}\leqslant\xi_k\leqslant t_k$ for every $k$. Then, the law of large numbers shows that, as soon as the common distribution of the random variables $X_x$ is integrable with mean $m$, when the mesh of $\tau$ goes to zero, $R(\tau,\xi)$ converges to $m$ almost surely and in $L^1$. Here the limiting object exists (this is the real number $m$) but it is degenerate.
