Salta al contenuto
Note per Studenti Expected Value Report

Expected Value

In questa pagina 6

The density of the r.v. contains all the information on the variability of the r.v. within its set of values X\mathcal{X}. In practice one looks for summaries of the complete information that can give a partial but still useful description of the variability. The expected value is the simplest such "summary" number for r.v.'s and it is an index of "centrality": it gives a quantitative idea of the "center" around which the r.v. takes values.

Motivation

Example. Giovanni has the following academic record: 21,24,21,27,27,24,27,27,27,24,24,2721, 24, 21, 27, 27, 24, 27, 27, 27, 24, 24, 27. The most common summary of performance is the arithmetic mean: mX=112∑grades=2×21+4×24+6×2712=212 21+412 24+612 27  (=25, computed here).m_X = \frac1{12}\sum \text{grades} = \frac{2\times21 + 4\times24 + 6\times27}{12} = \frac{2}{12}\,21 + \frac4{12}\,24 + \frac{6}{12}\,27 \;(=25,\ \text{computed here}).

Interpretation. The grades of Giovanni are repeated observations of a r.v. XX = "Giovanni's grade" taking values in the alphabet X={21,24,27}\mathcal{X} = \{21, 24, 27\}. The empirical density of XX is (see Empirical Probabilities and Diagnostic TestsAn empirical probability measure assigns to each event its observed relative frequency over n repetitions of an experiment, and for diagnostic tests it yields sensitivity and specificity from a contingency table.Empirical Probabilities and Diagnostic Tests →) p^X(21)=P^n(X=21)=212,p^X(24)=P^n(X=24)=412,p^X(27)=P^n(X=27)=612.\hat p_X(21) = \hat P_n(X = 21) = \tfrac{2}{12}, \quad \hat p_X(24) = \hat P_n(X=24) = \tfrac4{12}, \quad \hat p_X(27) = \hat P_n(X = 27) = \tfrac6{12}. Note that the arithmetic mean can be written mX=21 p^X(21)+24 p^X(24)+27 p^X(27)=∑xk∈Xxk p^X(xk).m_X = 21\,\hat p_X(21) + 24\,\hat p_X(24) + 27\,\hat p_X(27) = \sum_{x_k \in \mathcal{X}} x_k\,\hat p_X(x_k). This example motivates the introduction of the parameter called expected value.

Definition

Definition. Let XX be a discrete r.v. with alphabet X\mathcal{X} and discrete density pX(⋅)p_X(\cdot). The expected value of XX is E(X)≜∑xk∈Xxk pX(xk).E(X) \triangleq \sum_{x_k \in \mathcal{X}} x_k\,p_X(x_k).

Remark. If X\mathcal{X} is finite, E(X)E(X) is always well defined. If X\mathcal{X} is countably infinite, then E(X)E(X) is well defined if the series converges.

Exercise (on the page). Show that E(X)E(X) can be written as E(X)=∫−∞+∞x fX(x) dxE(X) = \int_{-\infty}^{+\infty}x\,f_X(x)\,dx, where fX(x)=∑xk∈XpX(xk)δ(x−xk)f_X(x) = \sum_{x_k\in\mathcal{X}}p_X(x_k)\delta(x-x_k) is the generalised density. (Hint, not on the page: ∫x δ(x−xk) dx=xk\int x\,\delta(x-x_k)\,dx = x_k, the sifting property of the delta.)

Examples.

Fundamental theorem

E(X)=∑xk∈Xxk pX(xk)=∑ω∈ΩX(ω) P({ω}).E(X) = \sum_{x_k\in\mathcal{X}} x_k\,p_X(x_k) = \sum_{\omega\in\Omega} X(\omega)\,P(\{\omega\}).

Proof. E(X)=∑xkxkpX(xk)=∑xkxkP([X=xk])=∑xkxk∑ω∈[X=xk]P({ω})=∑xk∑ω∈[X=xk]X(ω)P({ω})=∑ω∈ΩX(ω)P({ω}).E(X) = \sum_{x_k}x_kp_X(x_k) = \sum_{x_k}x_kP([X = x_k]) = \sum_{x_k}x_k\sum_{\omega\in[X = x_k]}P(\{\omega\}) = \sum_{x_k}\sum_{\omega\in[X=x_k]}X(\omega)P(\{\omega\}) = \sum_{\omega\in\Omega}X(\omega)P(\{\omega\}). The last step holds because the sets [X=xk][X = x_k] partition Ω\Omega (so the double sum runs once over every ω\omega), and on [X=xk][X = x_k] we have X(ω)=xkX(\omega) = x_k. □\square

Remark. In practice this result is not relevant since we do not have access to Ω\Omega and X(ω)X(\omega), but the result is essential to understand the properties of the expected value. (The proof is written as a sum over ω\omega, i.e. for a discrete sample space.)

Properties of the expected value

1. Homogeneity. For any a∈Ra \in \mathbb{R}, E(aX)=aE(X)E(aX) = aE(X). Proof. By the fundamental theorem, E(aX)=∑ωaX(ω)P({ω})=a∑ωX(ω)P({ω})=aE(X)=∑xkaxkpX(xk)E(aX) = \sum_\omega aX(\omega)P(\{\omega\}) = a\sum_\omega X(\omega)P(\{\omega\}) = aE(X) = \sum_{x_k}a x_k p_X(x_k). □\square

2. Additivity. For X,Y:Ω→RX, Y : \Omega \to \mathbb{R}, E(X+Y)=E(X)+E(Y)E(X+Y) = E(X) + E(Y). Proof. E(X+Y)=∑ω(X(ω)+Y(ω))P({ω})=∑ωX(ω)P({ω})+∑ωY(ω)P({ω})=E(X)+E(Y)E(X+Y) = \sum_\omega (X(\omega) + Y(\omega))P(\{\omega\}) = \sum_\omega X(\omega)P(\{\omega\}) + \sum_\omega Y(\omega)P(\{\omega\}) = E(X)+E(Y). □\square

Remark. 1 + 2 are equivalent to E(aX+bY)=aE(X)+bE(Y)E(aX + bY) = aE(X) + bE(Y) (linearity of the expected value).

Degenerate r.v.'s. It is convenient to include in the definition of random variables the degenerate case where XX takes only one (constant) value: X:Ω→R,ω↦X(ω)=c∈R constant.X : \Omega \to \mathbb{R}, \qquad \omega \mapsto X(\omega) = c \in \mathbb{R} \text{ constant}. The alphabet contains only one point, X={c}\mathcal{X} = \{c\}, and the discrete density is all concentrated at cc: pX(c)=1p_X(c) = 1. The DF is FX(x)=P(X≤x)=∑xkpX(xk)1(x−xk)=1(x−c)F_X(x) = P(X\le x) = \sum_{x_k}p_X(x_k)\mathbb{1}(x - x_k) = \mathbb{1}(x - c). Finally E(X)=∑xk∈XxkpX(xk)=c pX(c)=c.E(X) = \sum_{x_k\in\mathcal{X}}x_kp_X(x_k) = c\,p_X(c) = c. Since X(ω)≡cX(\omega) \equiv c for all ω\omega, the expectation can be written E(c)=cE(c) = c, trivial but useful.

Remark. For all r.v. XX and real numbers a,ba, b: E(aX+b)=aE(X)+bE(aX + b) = aE(X) + b, where bb is interpreted as a degenerate r.v.

3. Bounds. min⁡xk∈X{xk}≤E(X)≤max⁡xk∈X{xk}.\min_{x_k\in\mathcal{X}}\{x_k\} \le E(X) \le \max_{x_k\in\mathcal{X}}\{x_k\}. Proof. min⁡{xk}≤xk≤max⁡{xk}\min\{x_k\} \le x_k \le \max\{x_k\}; now multiply by pX(xk)p_X(x_k) everywhere and add over xk∈Xx_k \in \mathcal{X} (the weights add up to 1). □\square

Expected value of the binomial

Exercise. Compute E(X)E(X) for X∼Bin(n,p)X \sim \text{Bin}(n,p), with density pX(k)=Bin(n,p)(k)=(nk)pk(1−p)n−kp_X(k) = \text{Bin}(n,p)(k) = \binom nkp^k(1-p)^{n-k}. E(X)=∑k=0nk(nk)pk(1−p)n−k=∑k=0nkn!k!(n−k)!pk(1−p)n−k.E(X) = \sum_{k=0}^nk\binom nkp^k(1-p)^{n-k} = \sum_{k=0}^n k\frac{n!}{k!(n-k)!}p^k(1-p)^{n-k}. The term k=0k = 0 vanishes, so the sum starts from k=1k=1, where kk!=1(k−1)!\frac{k}{k!} = \frac{1}{(k-1)!}. Pull out npnp and write (n−k)=(n−1)−(k−1)(n-k) = (n-1)-(k-1): E(X)=np∑k=1n(n−1)!(k−1)! (n−k)!pk−1(1−p)(n−1)−(k−1)=np∑j=0n−1Bin(n−1,p)(j)=np,E(X) = np\sum_{k=1}^{n}\frac{(n-1)!}{(k-1)!\,(n-k)!}p^{k-1}(1-p)^{(n-1)-(k-1)} = np\sum_{j=0}^{n-1}\text{Bin}(n-1,p)(j) = np, since the last sum is the sum of a Bin(n−1,p)\text{Bin}(n-1,p) density over its whole alphabet, i.e. equal to 11.

Alternative derivation. Recall that X∼Bin(n,p)X\sim\text{Bin}(n,p) can be obtained as X=∑i=1nXiX = \sum_{i=1}^nX_i with Xi∼b(p)X_i\sim b(p) for i=1,…,ni=1,\dots,n. By additivity of the expected value, E(X)=E(∑i=1nXi)=∑i=1nE(Xi)=np.E(X) = E\Big(\sum_{i=1}^nX_i\Big) = \sum_{i=1}^nE(X_i) = np.

Mechanical interpretation of E(X)E(X)

Let X∼pX(xk)X \sim p_X(x_k), xk∈Xx_k \in \mathcal{X}. Consider the alternative graphical representation of the density: dots on the real line at the points xk∈Xx_k \in\mathcal{X}, with size proportional to pX(xk)p_X(x_k). Interpret the dots as masses of pX(xk)p_X(x_k) kg, for a total mass of 1 kg. The barycenter xˉ\bar x of the system of masses is found by imposing the condition that the algebraic sum of moments is zero, ∑xk∈X(xk−xˉ) pX(xk)=0,\sum_{x_k\in\mathcal{X}}(x_k - \bar x)\,p_X(x_k) = 0, therefore xˉ=E(X)=∑xk∈Xxk pX(xk).\bar x = E(X) = \sum_{x_k\in\mathcal{X}}x_k\,p_X(x_k). So E(X)E(X) is the center of mass of the density. See also Functions of Random Variables and LOTUSA function g(X) of a discrete random variable is again a discrete random variable whose density is obtained by summing p_X over the preimage, and the LOTUS computes E(g(X)) directly from p_X without finding the density of g(X).Functions of Random Variables and LOTUS → and VarianceThe variance is the expected squared deviation from the expected value and measures how spread out a random variable is; it is non-negative, zero only for constants, scales with the square of a multiplier, ignores shifts, and equals E(X^2) minus the square of E(X).Variance →.

Versione ripasso

Definition. E(X)=∑xk∈Xxk pX(xk)E(X)=\sum_{x_k\in\mathcal{X}}x_k\,p_X(x_k); always defined if X\mathcal{X} is finite, for countably infinite X\mathcal{X} if the series converges. It is the "center" of the density; it generalises the arithmetic mean ∑xkp^X(xk)\sum x_k\hat p_X(x_k) with empirical density.

Fundamental theorem. E(X)=∑ω∈ΩX(ω)P({ω})E(X)=\sum_{\omega\in\Omega}X(\omega)P(\{\omega\}) (group the ω\omega by the level sets [X=xk][X=x_k]).

Properties.

  1. E(aX)=aE(X)E(aX)=aE(X). 2. E(X+Y)=E(X)+E(Y)E(X+Y)=E(X)+E(Y). So E(aX+bY)=aE(X)+bE(Y)E(aX+bY)=aE(X)+bE(Y) (linear).
  • Degenerate X≡cX\equiv c: pX(c)=1p_X(c)=1, FX(x)=1(x−c)F_X(x)=\mathbb{1}(x-c), E(c)=cE(c)=c; E(aX+b)=aE(X)+bE(aX+b)=aE(X)+b.
  1. min⁡xk≤E(X)≤max⁡xk\min x_k\le E(X)\le\max x_k.

Examples. b(p)b(p): E=pE=p. U(X)\mathcal{U}(\mathcal{X}): E=1N∑xkE=\frac1N\sum x_k. Bin(n,p)\text{Bin}(n,p): E=npE=np, either by cancelling kk against k!k!, shifting the index (the remaining sum is a Bin(n−1,p)\text{Bin}(n-1,p) density, equal to 1) or by X=∑i=1nXiX=\sum_{i=1}^nX_i, Xi∼b(p)X_i\sim b(p), plus additivity. G(p)G(p): E=1pE=\frac1p.

Mechanical meaning: barycenter of masses pX(xk)p_X(x_k) at xkx_k: ∑(xk−xˉ)pX(xk)=0⇒xˉ=E(X)\sum(x_k-\bar x)p_X(x_k)=0\Rightarrow\bar x=E(X).

Typical mistakes: forgetting to check convergence of the series when X\mathcal{X} is infinite; dropping the constant when computing E(aX+b)E(aX+b).

Teoria collegata