|
7 | 7 | "# Lecture 14: Location, Scale and LOTUS\n",
|
8 | 8 | "\n",
|
9 | 9 | "\n",
|
10 |
| - "## Stat 110, Joe Blitzstein, Harvard University\n", |
| 10 | + "## Stat 110, Prof. Joe Blitzstein, Harvard University\n", |
11 | 11 | "\n",
|
12 | 12 | "----"
|
13 | 13 | ]
|
|
24 | 24 | "- PDF $\\frac{1}{\\sqrt{2\\pi}} ~~ e^{-\\frac{z^2}{2}}$\n",
|
25 | 25 | "- CDF $\\Phi$\n",
|
26 | 26 | "- Mean $\\mathbb{E}(\\mathcal{Z}) = 0$\n",
|
27 |
| - "- Variance $\\mathbb{Var}(\\mathcal{Z}) = \\mathbb{E}(\\mathcal{Z}^2) = 1$\n", |
| 27 | + "- Variance $\\operatorname{Var}(\\mathcal{Z}) = \\mathbb{E}(\\mathcal{Z}^2) = 1$\n", |
28 | 28 | "- Skew (3<sup>rd</sup> moment) $\\mathbb{E}(\\mathcal{Z^3}) = 0$ (odd moments are 0 since they are odd functions)\n",
|
29 | 29 | "- $-\\mathcal{Z} \\sim \\mathcal{N}(0,1)$ (by symmetry; this simply flips the bell curve about its mean)\n",
|
30 | 30 | "\n",
|
|
42 | 42 | "## Rules on Variance\n",
|
43 | 43 | "\n",
|
44 | 44 | "\\begin{align}\n",
|
45 |
| - " \\mathbb{Var}(X) &= \\mathbb{E}( (X - \\mathbb{E}X)^2 ) \\\\\n", |
46 |
| - " &= \\mathbb{E}X^2 - (\\mathbb{E}X)^2 \\\\\n", |
| 45 | + " & \\text{[1]} & \\operatorname{Var}(X) &= \\mathbb{E}( (X - \\mathbb{E}X)^2 ) \\\\\n", |
| 46 | + " & & &= \\mathbb{E}X^2 - (\\mathbb{E}X)^2 \\\\\n", |
47 | 47 | " \\\\\n",
|
48 |
| - " \\mathbb{Var}(X+c) &= \\mathbb{Var}(X) \\\\\n", |
| 48 | + " & \\text{[2]} & \\operatorname{Var}(X+c) &= \\operatorname{Var}(X) \\\\\n", |
49 | 49 | " \\\\\n",
|
50 |
| - " \\mathbb{Var}(cX) &= c^2 ~~ \\mathbb{Var}(X) \\\\\n", |
| 50 | + " & \\text{[3]} & \\operatorname{Var}(cX) &= c^2 ~~ \\operatorname{Var}(X) \\\\\n", |
51 | 51 | " \\\\\n",
|
52 |
| - " \\mathbb{Var}(X+Y) &\\neq \\mathbb{Var}(X) + \\mathbb{Var}(Y) ~~ \\text{in general} \n", |
| 52 | + " & \\text{[4]} & \\operatorname{Var}(X+Y) &\\neq \\operatorname{Var}(X) + \\operatorname{Var}(Y) ~~ \\text{in general} \n", |
53 | 53 | "\\end{align}\n",
|
54 | 54 | "\n",
|
55 |
| - "1. We already know this.\n", |
56 |
| - "1. Adding a constant $c$ has no effect on $\\mathbb{Var}(X)$.\n", |
57 |
| - "1. $\\mathbb{Var}(X) \\ge 0$; $\\mathbb{Var}(X)=0$ if and only if $P(X=a) = 1$ for some $a$... _variance can never be negative!_\n", |
58 |
| - "1. Unlike expected value, variance is _not_ linear. But if $X$ and $Y$ are independent, then $\\mathbb{Var}(X+Y) = \\mathbb{Var}(X) + \\mathbb{Var}(Y)$.\n", |
| 55 | + "* We already know $\\text{[1]}$\n", |
| 56 | + "* Re $\\text{[2]}$, adding a constant $c$ has no effect on $\\operatorname{Var}(X)$.\n", |
| 57 | + "* Re $\\text{[3]}$, pulling out a scaling constant $c$ means you have to square it.\n", |
| 58 | + "* $\\operatorname{Var}(X) \\ge 0$; $\\operatorname{Var}(X)=0$ if and only if $P(X=a) = 1$ for some $a$... _variance can never be negative!_\n", |
| 59 | + "* Re $\\text{[4]}$, unlike expected value, variance is _not_ linear. But if $X$ and $Y$ are independent, then $\\operatorname{Var}(X+Y) = \\operatorname{Var}(X) + \\operatorname{Var}(Y)$.\n", |
59 | 60 | "\n",
|
60 | 61 | "As a case in point for (4), consider\n",
|
61 | 62 | "\n",
|
62 | 63 | "\\begin{align}\n",
|
63 |
| - " \\mathbb{Var}(X + X) &= \\mathbb{Var}(2X) \\\\\n", |
64 |
| - " &= 4 ~~ \\mathbb{Var}(X) \\\\\n", |
65 |
| - " &\\neq 2 ~~ \\mathbb{Var}(X) & \\quad \\blacksquare \\\\\n", |
| 64 | + " \\operatorname{Var}(X + X) &= \\operatorname{Var}(2X) \\\\\n", |
| 65 | + " &= 4 ~~ \\operatorname{Var}(X) \\\\\n", |
| 66 | + " &\\neq 2 ~~ \\operatorname{Var}(X) & \\quad \\blacksquare \\\\\n", |
66 | 67 | "\\end{align}\n",
|
67 | 68 | "\n",
|
68 | 69 | "... and now we know enough about variance to return back to the general form of the normal distribution.\n",
|
|
98 | 99 | "From what we know about variance,\n",
|
99 | 100 | "\n",
|
100 | 101 | "\\begin{align}\n",
|
101 |
| - " \\mathbb{Var}(\\mu + \\sigma \\mathcal{Z}) &= \\sigma^2 ~~ \\mathbb{Var}(\\mathcal{Z}) \\\\\n", |
| 102 | + " \\operatorname{Var}(\\mu + \\sigma \\mathcal{Z}) &= \\sigma^2 ~~ \\operatorname{Var}(\\mathcal{Z}) \\\\\n", |
102 | 103 | " &= \\sigma^2\n",
|
103 | 104 | "\\end{align}\n",
|
104 | 105 | "\n",
|
|
165 | 166 | "collapsed": true
|
166 | 167 | },
|
167 | 168 | "source": [
|
168 |
| - "## Variance of $\\mathbb{Pois}(\\lambda)$\n", |
| 169 | + "## Variance of $\\operatorname{Pois}(\\lambda)$\n", |
169 | 170 | "\n",
|
170 | 171 | "### Intuition\n",
|
171 | 172 | "\n",
|
|
184 | 185 | " \\mathbb{E}(X^2) &= \\sum_x x^2 ~ P(X=x) \\\\\n",
|
185 | 186 | "\\end{align}\n",
|
186 | 187 | "\n",
|
187 |
| - "### The case for $Pois(\\lambda)$\n", |
| 188 | + "### The case for $\\operatorname{Pois}(\\lambda)$\n", |
188 | 189 | "\n",
|
189 |
| - "Let $X \\sim \\mathbb{Pois}(\\lambda)$. \n", |
| 190 | + "Let $X \\sim \\operatorname{Pois}(\\lambda)$. \n", |
190 | 191 | "\n",
|
191 |
| - "Recall that $\\mathbb{Var}(X) = \\mathbb{E}X^2 - (\\mathbb{E}X)^2$. We know that $\\mathbb{E}(X) = \\lambda$, so all we need to do is figure out what $\\mathbb{E}(X^2)$ is.\n", |
| 192 | + "Recall that $\\operatorname{Var}(X) = \\mathbb{E}X^2 - (\\mathbb{E}X)^2$. We know that $\\mathbb{E}(X) = \\lambda$, so all we need to do is figure out what $\\mathbb{E}(X^2)$ is.\n", |
192 | 193 | "\n",
|
193 | 194 | "\\begin{align}\n",
|
194 | 195 | " \\mathbb{E}(X^2) &= \\sum_{k=0}^{\\infty} k^2 ~ \\frac{e^{-\\lambda} \\lambda^k}{k!} \\\\\n",
|
|
204 | 205 | " &= e^{-\\lambda} \\lambda e^{\\lambda} (\\lambda + 1) \\\\\n",
|
205 | 206 | " &= \\lambda^2 + \\lambda \\\\\n",
|
206 | 207 | " \\\\\n",
|
207 |
| - " \\mathbb{Var}(X) &= \\mathbb{E}(X^2) - (\\mathbb{E}X)^2 \\\\\n", |
| 208 | + " \\operatorname{Var}(X) &= \\mathbb{E}(X^2) - (\\mathbb{E}X)^2 \\\\\n", |
208 | 209 | " &= \\lambda^2 + \\lambda - \\lambda^2 \\\\\n",
|
209 | 210 | " &= \\lambda & \\quad \\blacksquare\n",
|
210 | 211 | "\\end{align}\n",
|
|
216 | 217 | "cell_type": "markdown",
|
217 | 218 | "metadata": {},
|
218 | 219 | "source": [
|
219 |
| - "## Variance of $\\mathbb{Binom}(X)$\n", |
| 220 | + "## Variance of $\\operatorname{Binom}(X)$\n", |
220 | 221 | "\n",
|
221 |
| - "Let $X \\sim \\mathbb{Binom}(n,p)$.\n", |
| 222 | + "Let $X \\sim \\operatorname{Binom}(n,p)$.\n", |
222 | 223 | "\n",
|
223 | 224 | "$\\mathbb{E}(X) = np$. \n",
|
224 | 225 | "\n",
|
225 |
| - "Find $\\mathbb{Var}(X)$ using all the tricks you have at your disposal.\n", |
| 226 | + "Find $\\operatorname{Var}(X)$ using all the tricks you have at your disposal.\n", |
226 | 227 | "\n",
|
227 | 228 | "### The path of least resistance\n",
|
228 | 229 | "\n",
|
229 | 230 | "Let's try applying (4) from the above Rules of Variance. \n",
|
230 | 231 | "\n",
|
231 |
| - "We can do so because $X \\sim \\mathbb{Binom}(n,p)$ means that the $n$ trials are _independent Bernoulli_.\n", |
| 232 | + "We can do so because $X \\sim \\operatorname{Binom}(n,p)$ means that the $n$ trials are _independent Bernoulli_.\n", |
232 | 233 | "\n",
|
233 | 234 | "\\begin{align}\n",
|
234 |
| - " X &= I_1 + I_2 + \\dots + I_n & \\quad \\text{where } I_j \\text{ are i.i.d. } \\mathbb{Bern}(p) \\\\\n", |
| 235 | + " X &= I_1 + I_2 + \\dots + I_n & \\quad \\text{where } I_j \\text{ are i.i.d. } \\operatorname{Bern}(p) \\\\\n", |
235 | 236 | " \\\\\n",
|
236 | 237 | " \\Rightarrow X^2 &= I_1^2 + I_2^2 + \\dots + I_n^2 + 2I_1I_2 + 2I_1I_3 + \\dots + 2I_{n-1}I_n & \\quad \\text{don't worry, this is not as bad as it looks} \\\\\n",
|
237 | 238 | " \\\\\n",
|
|
240 | 241 | " &= n p + n (n-1) p^2 & \\quad \\text{since } I_1I_2 \\text{ is the event that both } I_1 \\text{ and } I_2 \\text{ are successes} \\\\\n",
|
241 | 242 | " &= np + n^2 p^2 - np^2 \\\\\n",
|
242 | 243 | " \\\\\n",
|
243 |
| - " \\mathbb{Var}(X) &= \\mathbb{E}(X^2) - (\\mathbb{E}X)^2 \\\\\n", |
| 244 | + " \\operatorname{Var}(X) &= \\mathbb{E}(X^2) - (\\mathbb{E}X)^2 \\\\\n", |
244 | 245 | " &= np + n^2 p^2 - np^2 - (np)^2 \\\\\n",
|
245 | 246 | " &= np - np^2 \\\\\n",
|
246 | 247 | " &= np(1-p) \\\\\n",
|
|
254 | 255 | "cell_type": "markdown",
|
255 | 256 | "metadata": {},
|
256 | 257 | "source": [
|
257 |
| - "## Variance of $\\mathbb{Geom}(p)$\n", |
| 258 | + "## Variance of $\\operatorname{Geom}(p)$\n", |
258 | 259 | "\n",
|
259 |
| - "Let $X \\sim \\mathbb{Geom}(p)$.\n", |
| 260 | + "Let $X \\sim \\operatorname{Geom}(p)$.\n", |
260 | 261 | "\n",
|
261 | 262 | "It has PDF $q^{k-1}p$.\n",
|
262 | 263 | "\n",
|
263 |
| - "Find $\\mathbb{Var}(X)$.\n", |
| 264 | + "Find $\\operatorname{Var}(X)$.\n", |
264 | 265 | "\n",
|
265 | 266 | "### Applying what we know of the Geometric Series\n",
|
266 | 267 | "\n",
|
|
285 | 286 | " &= p \\frac{q+1}{p^3} \\\\\n",
|
286 | 287 | " &= \\frac{q+1}{p^2} \\\\\n",
|
287 | 288 | " \\\\\n",
|
288 |
| - " \\mathbb{Var}(X) &= \\mathbb{E}(X^2) - (\\mathbb{E}X)^2 \\\\\n", |
| 289 | + " \\operatorname{Var}(X) &= \\mathbb{E}(X^2) - (\\mathbb{E}X)^2 \\\\\n", |
289 | 290 | " &= \\frac{q+1}{p^2} - \\left( \\frac{1}{p} \\right)^2 \\\\\n",
|
290 | 291 | " &= \\frac{q+1}{p^2} - \\frac{1}{p^2} \\\\\n",
|
291 | 292 | " &= \\boxed{\\frac{q}{p^2}} & \\quad \\blacksquare\n",
|
|
313 | 314 | "\n",
|
314 | 315 | "----"
|
315 | 316 | ]
|
| 317 | + }, |
| 318 | + { |
| 319 | + "cell_type": "markdown", |
| 320 | + "metadata": {}, |
| 321 | + "source": [ |
| 322 | + "View [Lecture 14: Location, Scale, and LOTUS | Statistics 110](http://bit.ly/2CyYFg4) on YouTube." |
| 323 | + ] |
316 | 324 | }
|
317 | 325 | ],
|
318 | 326 | "metadata": {
|
|
0 commit comments