# Upper bounding the variance of a sum

I have random variables $$X_1, \ldots, X_N$$ and two functions: a bounded function $$|f|\leq M$$ and another function $$0 \le g \le 1$$. I would like to upper bound the variance $$\mathbb{V}\left[\sum_{i=1}^N f(X_i)g(X_i) \right]$$ by a bound that does not depend on $$f$$ (happy for it to depend on $$g$$). Is it possible?

# Attempt

I tried by using the usual variance formula, but I am unsure if I can do this type of bounds \begin{align} \mathbb{V}\left[\sum_{i=1}^N f(X_i)g(X_i) \right] &= \mathbb{E}\left[\left(\sum_{i=1}^N f(X_i)g(X_i)\right)^2\right] - \mathbb{E}\left[\sum_{i=1}^N f(X_i)g(X_i)\right]^2 \\ &\leq \mathbb{E}\left[\left(\sum_{i=1}^N M g(X_i)\right)^2\right]- \mathbb{E}\left[\sum_{i=1}^N f(X_i)g(X_i)\right]^2 \\ &= M^2 \mathbb{E}\left[\left(\sum_{i=1}^N g(X_i)\right)^2\right] - \mathbb{E}\left[\sum_{i=1}^N f(X_i)g(X_i)\right]^2 \\ &\leq M^2 \mathbb{E}\left[\left(\sum_{i=1}^N g(X_i)\right)^2\right] \end{align} but I was wondering if I can do anything better. One idea I had was to work directly on the formula for the variance of a sum $$\mathbb{V}\left[\sum_{i=1}^N f(X_i)g(X_i)\right] = \sum_{i=1}^N \mathbb{V}[f(X_i)g(X_i)] + 2 \sum_{i=1}^N \sum_{j=i+1}^N \text{Cov}\left(f(X_i)g(X_i), f(X_j)g(X_j)\right)$$

• That inequality isn't valid as written (what if $\sum g(X_i) = 0$?); you'd need $\sum M|g(X_i)|$ instead. Mar 21 at 15:58
• @GregMartin Mmmm I think I forgot to write a condition. Here I know that $g$ is non-negative as well Mar 21 at 16:00
• $(X_n)_{n=1,..,N}$ are i.i.d?
– NN2
Mar 21 at 16:34
• @NN2 Yes, they are! $X_1, \ldots X_n \overset{\text{iid}}{\sim} \mu$ Mar 21 at 16:56

From the assumption that $$(X_i)_{i=1,..,N}$$ are i.i.d, we deduce that $$(f(X_i)g(X_i))_{i=1,..,N}$$ are also i.i.d. As a consequence \begin{align} L:=\mathbb{V}\left(\sum_{i=1}^N f(X_i)g(X_i) \right) &= n\cdot \mathbb{V}\left( f(X_1)g(X_1) \right) \\ &= n\cdot \mathbb{E}\left(f^2(X_1)g^2(X_1) \right)-n\cdot \mathbb{E}^2\left(f(X_1)g(X_1) \right)\\ \end{align} Without any further information about $$f,g$$ and $$X$$, a best upper bound is $$L\stackrel{(1)}{\le}n\cdot \mathbb{E}\left(f^2(X_1)g^2(X_1) \right)\stackrel{(2)}{\le}\color{red}{nM^2\cdot \mathbb{E}\left(g^2(X_1) \right)}$$ The equality of $$(1)$$ occurs if for example $$f$$ is an odd function, $$g$$ is an even function and $$X$$ follows a symmetric distribution.
The equality of $$(2)$$ occurs if and only if $$|f(x)| = M$$ for all $$x$$.