Can the expected value be applied to non-linear functions?

263 Views Asked by At

I'm doing a research project about the bias of different methods of integral estimation. One of these methods involves the following math:

$$ E\left[\sum_{i=1}^nf(x_i)\right] = \sum_{i=1}^nf(E[x_i])$$

for $ x_1, x_2,\ldots, x_n \sim G$ are i.i.d where $G$ is some probability distribution function.

Does this math only hold when f is a linear function? Does it never hold? Does it always hold?

1

There are 1 best solutions below

2
On

Let's take a simple example: $g$ is a sample from $G$, a Bernoulli distribution with $p=\frac12$. $n=1$ and $f(x)=x^2$. The LHS is $E(g^2)=\frac12$ while the RHS is $E(g)^2=\frac14\ne\frac12$.

So the formula does not hold in all cases. You can write, by linearity of expectation, $$E\left(\sum_{i=1}^nf(x_i)\right)=\sum_{i=1}^nE(f(x_i))$$ but then swapping $f$ and $E$ will only work in general when $f$ is linear, by Jensen's inequality.