I understand the definition of convexity in a function $f: \mathbb R^d \to \mathbb R$ as the inequality for all $a,b\in\mathbb R^d$ and $0<\theta<1:$

$$\theta f(a) + (1-\theta)f(b)        \geq f(\theta a + (1-\theta)b).$$

However, I am confused - likely because I never had formal training - about the index notation in the [definition of convexity][1] for random variables:

$$\sum w_i \mathbb E\Big[f(X_i) \Big]\ge \mathbb E\Big[ \sum f(w_i X_i) \Big]$$

Both $X_i$ and $f(X_i)$ are random variables, and [random variables can be indexed][2]. 

>So what is $w_i$? I am used to $w$ being weights - like a vector of probabilities, with $i$ in $w_i$ being each specific entry, but that doesn't make sense. I guess the $i$ just refers to the index $i$ of the random variable, which I don't know what differentiating function it has in a general definition...


  [1]: https://www.fooledbyrandomness.com/heuristic.pdf
  [2]: https://www.amazon.com/What-Makes-Variables-Random-Probability/dp/149878108X