Relationship between the expectation of the squared L2 norm of sum of elements and the sum of expectations of squared L2 norm of elements.

28 Views Asked by At

I am quite confused about the relationship between the following terms,

$E||\sum_{i=1}^n f(x_i) x_i||^2$ and $\sum_{i=1}^n E||f(x_i) x_i||^2$ where $x_i \in \mathbb{R}^p$ and $f(\cdot): \mathbb{R}^p \rightarrow \mathbb{R}$ is some arbitrary function. I believe one relationship can be obtained via Jensen's inequality which says that

$$ E||\sum_{i=1}^n f(x_i) x_i||^2 \leq n \sum_{i=1}^n E||f(x_i) x_i||^2 $$

However, I have also seen several results in optimization-based research papers that simply allow the expectation to be pulled inside the summation such that,

$$ E||\sum_{i=1}^n f(x_i) x_i||^2 = \sum_{i=1}^n E||f(x_i) x_i||^2 $$

or even

$$ E||\sum_{i=1}^n f(x_i) x_i||^2 = \sum_{i=1}^n E[f(x_i)] \cdot || x_i||^2 $$

Note the equality sign in both cases. I believe this might be possible when the expectation is being taken over $i$ or when $f(x_i)$ affects the inclusion of certain indices in the term. For instance, if $f$ is an indicator function that decides whether $i$ is included in the summation or not. However, I am wondering whether there is a rigorous way to prove either of these statements. Or are these statements even valid in the first place?