Variance of product of two random variables where one is a Bernoulli whose probability is a function of the first variable.

29 Views Asked by At

I have the following problem. I have a Gaussian variable $x$ with mean $\mu$ and variance $\sigma$ and I construct a certain function $0 < f(x) < 1$. This function value becomes then the probability of a Bernoulli variable $y \sim B(1, f(x))$. So the estimator samples quantities

$K = y \cdot x$

I want to calculate the variance of this quantity. If understand correctly I should use the law of total variance, because y depends on x. But I am not sure how to do it properly.

1

There are 1 best solutions below

0
On

I'm going to use capital letters $X$ and $Y$ both because of common convention and also because I'll be using lower case letters later on.

The Law of total variance, applied to $K$, will look like this:

$$\mathrm{Var}(K) = \mathrm{E}_X[\mathrm{Var}(K|X)] + \mathrm{Var}_X(\mathrm{E}[K|X])$$

Now the conditional variable $Z|X$ is equal to $XY|X$, which takes a value of $X$ with probability $f(X)$ and a value of $0$ with probability $1 - f(X)$. Using normal properties of expectation and variance, that means we can calculate:

$$\begin{eqnarray} \mathrm{E}[K | X] & = & \mathrm{E}[XY | X] \\ & = & X \mathrm{E}[Y | X] \\ & = & X f(X) \\ \mathrm{Var}(K | X) & = & \mathrm{Var}(XY | X) \\ & = & X^2 \mathrm{Var}(Y | X) \\ & = & X^2 f(X) (1 - f(X)) \end{eqnarray}$$

Notice that since we're conditioning on $X$, it is treated as a constant in the expectations.

So now we just have to calculate the terms in the total variance formula by taking the appropriate expectations. I'll do the second term, I encourage you to tackle the first one and to combine them. I will also define $p(x)$ to be the pdf of $X$, which of course is just an appropriately transformed Gaussian curve.

$$\begin{eqnarray} \mathrm{Var}_X(\mathrm{E}[K|X]) & = & \mathrm{Var}_X(X f(X)) \\ & = & \mathrm{E}[(X f(X))^2] - (\mathrm{E}[X f(X)])^2 \\ & = & \int_{-\infty}^\infty (x f(x))^2 p(x) dx - \left(\int_{-\infty}^\infty x f(x) p(x) dx \right)^2 \end{eqnarray}$$

Without actually knowing what $f(x)$ is, we can't evaluate these integrals, but at least we can write everything out. There is also a very small bit of cancelling between this and the first term, which is nice.