Code
repair_count <- 0:3
repair_mass <- c(.50, .30, .15, .05)
sum(repair_count * repair_mass)The earlier pages introduced probability mass functions and probability density functions. We can now summarize the center of either distribution. Suppose R records the number of self repairs in a sampled dialogue turn.
| repair count r | p_R(r) |
|---|---|
| 0 | .50 |
| 1 | .30 |
| 2 | .15 |
| 3 | .05 |
We want one number that summarizes the center of this probability distribution. Averaging the four support values would give (0+1+2+3)/4=1.5, but that calculation gives equal weight to values with unequal probabilities.
The expected value weights each value by its probability. It is also called the mean of the distribution when the weighted average exists.
Multiply each support value by its mass.
| r | p_R(r) | r p_R(r) |
|---|---|---|
| 0 | .50 | 0 |
| 1 | .30 | .30 |
| 2 | .15 | .30 |
| 3 | .05 | .15 |
Add the weighted contributions:
0+.30+.30+.15=.75.
In notation,
\mathbb{E}[R] \equiv\sum_r r\,p_R(r) =.75.
The symbol \mathbb{E} denotes the expectation operation. It takes the full probability distribution of R and returns its probability weighted average.
The support contains only whole repair counts, so no dialogue turn has exactly .75 repairs. The expected value need not be a possible observed value.
Let R_1,R_2,\ldots be independent variables with this PMF. Their sample mean has expectation .75 for every sample size, and the law of large numbers implies that the sample mean converges in probability to .75. The expectation is a property of the distribution, not the outcome of one turn.
repair_count <- 0:3
repair_mass <- c(.50, .30, .15, .05)
sum(repair_count * repair_mass)The result is .75. The multiplication is elementwise, so each support value is paired with its own probability before the products are summed.
For an absolutely continuous variable X with density f_X, suppose
\int_{-\infty}^{\infty}|x|f_X(x)\,\mathrm{d}x<\infty.
Its expected value is
\mathbb{E}[X] \equiv\int_{-\infty}^{\infty}x f_X(x)\,\mathrm{d}x,
The factor x weights the probability density at each value. Absolute integrability guarantees that the expectation is finite.
The discrete sum and continuous integral implement the same idea: values receiving more modeled probability contribute more to the center.
The expectation is not the arithmetic average of the distinct support values. For the repair example, that calculation gives 1.5 rather than .75 because it treats the rare value 3 as if it were as common as 0.
Identify the probability attached to each value. The expectation averages outcomes under the distribution, not labels in the support set.
Expected value averages the original values. The next page asks how to average a transformed property of those values.