YouTube2Text

Random Sampling in Statistics: Expected Value and Variance of the Sample Mean — Transcript

by Steve Brunton · 2,334 words · 345 segments · language en · Watch on YouTube

Full transcript

  1. 0:00welcome back okay so we're talking about
  2. 0:03the theory of random sampling to say
  3. 0:06something about a large but unknown
  4. 0:08population in terms of a random smaller
  5. 0:11sample of that population this is useful
  6. 0:14all over in statistics and this is kind
  7. 0:16of an entry point to more advanced uh
  8. 0:19topics so we showed last time that you
  9. 0:22can have this population um which is
  10. 0:24kind of a large population its PDF may
  11. 0:27or may not even be known but it a mean
  12. 0:30and and a variance and then um the
  13. 0:34sample statistics if I take a subsample
  14. 0:36a little n subsample of that big n
  15. 0:40population those samples become random
  16. 0:43variables and the average of those
  17. 0:46random variables
  18. 0:47xbar um is hopefully an estimate of the
  19. 0:52population mean mu so the kind of uh
  20. 0:55sample mean should be a good estimate of
  21. 0:58the population mean under some circum
  22. 1:00ances and we can also compute things
  23. 1:02like the sample variance and so on and
  24. 1:04so forth so this opens up a ton of
  25. 1:06questions um all kinds of questions come
  26. 1:08up
  27. 1:09so question one um does the expectation
  28. 1:14of xar does
  29. 1:17xar equal mu we we've kind of hinted
  30. 1:21that this sample mean should converge uh
  31. 1:25to me in the as as little n gets bigger
  32. 1:27and bigger as my sample size gets bigger
  33. 1:29but can I actually show that the
  34. 1:31expectation of this random variable is
  35. 1:33in fact the population mean mu that
  36. 1:35would be very useful we're going to do
  37. 1:36that today another question um what is
  38. 1:40the variance of xbar meaning we we have
  39. 1:45a pretty good gut feeling that this
  40. 1:48sample mean should be gausian
  41. 1:51distributed for reasonably large n we
  42. 1:54know that from the central limit theorem
  43. 1:55this should be kind of normally
  44. 1:57distributed hopefully with a center
  45. 1:59around the true mean mu but what's the
  46. 2:02variance of that distribution is it a
  47. 2:04fat distribution is it skinny we want
  48. 2:06the variance of xar to be really really
  49. 2:08small because that means xar is a really
  50. 2:11really tight estimate of mu so this has
  51. 2:14implications um about the convergence of
  52. 2:17these values with n how fast is xar
  53. 2:20converged to me how efficient is it
  54. 2:23things like that there's questions you
  55. 2:24know are is there a bias is it is the
  56. 2:27expectation of xar mu plus some constant
  57. 2:30Offset you know is there any bias in my
  58. 2:35estimates those are all powerful
  59. 2:38statistics questions we're going to ask
  60. 2:41and answer those for this very very
  61. 2:43simple case of simple random sampling to
  62. 2:46iner things about a population but these
  63. 2:49questions hold much more generally in
  64. 2:51statistics in data analysis and even in
  65. 2:54machine learning okay does my you know
  66. 2:56if I sample data do I converge to a good
  67. 3:00model of a much bigger complex process
  68. 3:03okay good so we're going to jump in uh
  69. 3:06and we're going to start with the
  70. 3:07expectation value because that's always
  71. 3:08easier to work within the variance
  72. 3:10because the formula is simpler than the
  73. 3:12formula for variance so we want to show
  74. 3:16that um the expectation value of
  75. 3:19xar equals mu meaning that xar is an
  76. 3:24unbiased estimate of mu so we say that
  77. 3:28xbar is an
  78. 3:34unbiased
  79. 3:36estimate
  80. 3:38of mu this is statistics language for
  81. 3:41the expectation value of xar equals mu
  82. 3:44and there's no constant error so the x
  83. 3:47xar is unbiased meaning it it converges
  84. 3:50its expectation value is exactly mu okay
  85. 3:53so we're going to prove this now this is
  86. 3:55pretty easy to prove uh maybe I will do
  87. 3:57this in green so the expectation of xar
  88. 4:03um is literally I'm just going to plug
  89. 4:05this in to the expectation this is equal
  90. 4:08to the
  91. 4:09expectation of 1 / n sum I = 1 to n of
  92. 4:14each of my random variables
  93. 4:17XI now we know that we can pop this
  94. 4:19constant out and this the expectation of
  95. 4:21a sum is the sum of expectations so this
  96. 4:24equals 1 / n sum I = 1 to
  97. 4:30n um
  98. 4:33expectation of each of these
  99. 4:37XIs here's a really important fact that
  100. 4:41I need you to to believe and to know and
  101. 4:44I'm just going to write it down here the
  102. 4:47E for any uh for any
  103. 4:51individual X for any
  104. 4:54individual uh
  105. 4:56indiv individual
  106. 5:01sample
  107. 5:03XI the expected value of
  108. 5:07XI is equal to
  109. 5:09Mu uh and the
  110. 5:13variance of
  111. 5:15x i is equal to Sigma squ where mu is
  112. 5:20the true population mean and sigma squar
  113. 5:22is the true population variance this is
  114. 5:25super important any one of these
  115. 5:27individual samples it's expected value
  116. 5:30is mean mu and its expected variance is
  117. 5:33Sigma squar where those are the
  118. 5:35population values you can actually
  119. 5:38convince yourself of this pretty easily
  120. 5:40you can write down this expectation
  121. 5:42value um this I'll just do it for for
  122. 5:44the expected value and you can convince
  123. 5:46yourself also for the variance um this
  124. 5:50is the sum over every single possible n
  125. 5:53over all of the big n uh J equal 1 of
  126. 5:57all of the little values X J times the
  127. 6:01probability that my random variable x i
  128. 6:03equals little
  129. 6:05XJ that's just the definition of
  130. 6:07expected value of this random variable
  131. 6:08it's the sum over all the possible
  132. 6:10things it could be times the probability
  133. 6:11that it is actually that
  134. 6:13thing and there are each of these um the
  135. 6:18chance that I drew any one of these for
  136. 6:20x i is just 1 over n that's the
  137. 6:23probability so this equals the sum over
  138. 6:26uh big n of little X J * a probability
  139. 6:30of 1 over big n this is the definition
  140. 6:34of
  141. 6:35my population mean it's 1 / n times the
  142. 6:40sum of all of those little XIs so you
  143. 6:42can convince yourself anyway that each
  144. 6:44of these random variables each of these
  145. 6:46XIs their expected value is Mu and their
  146. 6:49expected variance their variance is
  147. 6:52Sigma squar you can think about it
  148. 6:54because each of these X's is pulled from
  149. 6:56this population so you can kind of say
  150. 6:59that uh x i is
  151. 7:03distributed according to whatever the
  152. 7:06distribution of my
  153. 7:09population was okay whatever my
  154. 7:11population distribution is each of these
  155. 7:13XIs is randomly sampled from that
  156. 7:15population distribution so anyway this
  157. 7:18let's go back to to what we're trying to
  158. 7:20show we're trying to show that the
  159. 7:21expectation of xar equals mu so we take
  160. 7:24our sample mean xar we plug it into this
  161. 7:27expectation and it's the sum of all of
  162. 7:30these little the the these random
  163. 7:31variables x i * 1 over little n the
  164. 7:35constant pops out the sum of an expect
  165. 7:38the expectation of a sum is the sum of
  166. 7:39the expectations and now each of these
  167. 7:42expectation
  168. 7:43values is Mu so I have um essentially
  169. 7:49this
  170. 7:50equals uh 1/ n time the sum of IAL 1 to
  171. 7:55little n of mu each of these is equal to
  172. 7:58Mu this is n * mu * 1/ n this whole
  173. 8:02thing just equals mu the expected value
  174. 8:06of xar is equal to Mu very very cool
  175. 8:10this means that xar the sample mean is
  176. 8:13an unbiased estimate uh of the
  177. 8:16population mean mu and hopefully as n
  178. 8:20gets bigger and bigger this expected
  179. 8:23value um sorry the this distribution of
  180. 8:26xar gets Tighter and Tighter and Tighter
  181. 8:28around this expected value you good um
  182. 8:31maybe I'll just draw a little picture so
  183. 8:34um probably I have some population
  184. 8:38distribution and I'm actually going to
  185. 8:39draw it to be kind of gnarly um but
  186. 8:42let's say it has some mean value some
  187. 8:46mu the sample mean
  188. 8:50xar by the central limit theorem we'll
  189. 8:52prove this later but by the central
  190. 8:54limit theorem xar is going to be a
  191. 8:57normally distributed variable about its
  192. 8:59expected value of
  193. 9:02mu so
  194. 9:05xar should be normally distributed with
  195. 9:08its expectation value centered around mu
  196. 9:13and we want xar to get Tighter and
  197. 9:16Tighter and Tighter we want the spread
  198. 9:19of possible X bars to be really really
  199. 9:21small around this value of mu as n gets
  200. 9:24larger that spread of course is related
  201. 9:26to the variance of this uh of this xar
  202. 9:30quantity so now let's talk about what's
  203. 9:33the
  204. 9:35variance of xar okay variance of xar
  205. 9:38tells me how good this estimate is for
  206. 9:42um increasing sample size little n okay
  207. 9:46good um this result makes intuitive
  208. 9:48sense now let's talk about the variance
  209. 9:51uh of
  210. 9:52xar so I'm going to actually
  211. 9:55prove a slight approximation what I'm
  212. 9:58going to write down is not the exact
  213. 10:01variance of xar it's an approximation to
  214. 10:03the variance of xar making an assumption
  215. 10:07that each of these X's is
  216. 10:10independent now remember we sampled
  217. 10:13without replacement so every time I drew
  218. 10:16a sample my population got a little
  219. 10:18smaller that technically builds in a
  220. 10:21small amount of dependence between these
  221. 10:22variables but for really really big and
  222. 10:26for really really big populations you
  223. 10:28can kind of assume that these are are
  224. 10:29independent and that's what I'm going to
  225. 10:30write down here and then I'm going to
  226. 10:32write down the correction for finite n
  227. 10:35for finite population size so this is an
  228. 10:39approximation uh this equals again I'm
  229. 10:42going to plug in this expression into
  230. 10:44xar this equals the variance of the sum
  231. 10:47VAR of 1 / n * X1 plus dot dot dot plus
  232. 10:53X little
  233. 10:55n and I'm just going to again remind you
  234. 10:58this is uh
  235. 10:59um this is if if these are independent
  236. 11:05samples then I can say this this is
  237. 11:10um actually sorry if they're independent
  238. 11:13samples then I can split these into the
  239. 11:14sum of a bunch of variances so I'll wait
  240. 11:16I'll I'll I'll wait to write down my
  241. 11:18Independence assumption in a minute um
  242. 11:21so my 1/n pops out as a 1 over n^ 2
  243. 11:25that's how variance of a constant times
  244. 11:27a variable you can pop that constant
  245. 11:29squared out so this equals 1 over n^
  246. 11:34squar times the variance of this sum and
  247. 11:38that is the sum of the individual
  248. 11:39variances that is VAR
  249. 11:43X1 plus dot dot dot plus VAR
  250. 11:49xn now I've used this assumption this is
  251. 11:53true if my X eyes are independent
  252. 12:00and that's true for very very large
  253. 12:04population size and much much greater
  254. 12:06than one like n a million or 100,000 or
  255. 12:1010,000 this is going to be a very good
  256. 12:12approximation technically there is joint
  257. 12:16co-variance between these variables and
  258. 12:18so this step is actually not exactly
  259. 12:20true it's really kind of this is
  260. 12:21approximately equal to this for very
  261. 12:24large population size so be on the watch
  262. 12:27for me making those kinds of approx IM
  263. 12:30again we're trying to compute the
  264. 12:31variance of our sample mean we want that
  265. 12:34variance to be small it's equal now
  266. 12:36approximately to 1 n^ 2times the sum of
  267. 12:39the variances of all of those individual
  268. 12:40elements and the sum of those variances
  269. 12:43each of those variances are the
  270. 12:45population variance Sigma squar so I can
  271. 12:48write this
  272. 12:49now as you know each of these this is
  273. 12:52just um let's
  274. 12:55say
  275. 12:56uh this is n * Sigma
  276. 13:00s and so this whole thing is
  277. 13:03approximately equal to n / n^ 2 * Sigma
  278. 13:06squ that's Sigma squar over n and
  279. 13:11actually this is the result from the
  280. 13:13central limit theorem so I want you to
  281. 13:14go back and and check out that Central
  282. 13:17limit theorem uh video this is the
  283. 13:21result from the central limit
  284. 13:23theorem um that that if you have the sum
  285. 13:27of a bunch of independent random
  286. 13:29variables each with their own variance
  287. 13:31Sigma squar then the sum of those
  288. 13:33variables would have um this uh variance
  289. 13:37okay so this is actually all coming from
  290. 13:40the central limit theorem this is um I
  291. 13:42guess law of large numbers this is
  292. 13:44Central limit theorem
  293. 13:48good now I'll show this in the next
  294. 13:50video I'll actually go through the Gory
  295. 13:51details of deriving this in the next
  296. 13:53video but remember this is only true for
  297. 13:56very very large n very large population
  298. 14:00so for
  299. 14:03finite uh population
  300. 14:05size Big N technically this VAR X bar
  301. 14:12there is a correction and again I'm
  302. 14:13going to derive this in the next lecture
  303. 14:15there's a correction it's Sigma 2ar over
  304. 14:20n * 1 - little n minus1 over big n minus
  305. 14:27one okay and again
  306. 14:29and this is approximately equal to Sigma
  307. 14:332 over little
  308. 14:34n when uh little n is much less than big
  309. 14:39n when I have a really big
  310. 14:41population um and my sample size is
  311. 14:44small compared to that really big
  312. 14:45population then I recover this this very
  313. 14:48very good approximation to the variance
  314. 14:50of xar so for small populations and
  315. 14:53small samples you need this this finite
  316. 14:55size correction most of the time we're
  317. 14:57going to end up using this result from
  318. 14:58the Central limit theorem we're going to
  319. 15:00assume that our sample mean xar is a
  320. 15:04normally distributed random variable
  321. 15:06with mean mu and variance Sigma squ Over
  322. 15:10N where Sigma squar and mu are the
  323. 15:13variance and mean of our overall
  324. 15:15population so this xbar tells us a lot
  325. 15:18about this unknown
  326. 15:20population um so measuring this xar
  327. 15:23measuring all of this sample taking this
  328. 15:25random sample and Computing this xar the
  329. 15:27sample mean tells me a ton about the
  330. 15:30population and as n gets bigger and
  331. 15:32bigger and bigger this variance gets
  332. 15:35smaller and smaller and smaller meaning
  333. 15:36we
  334. 15:38converge uh to the true population mean
  335. 15:42with a relatively small sample n okay
  336. 15:46super cool stuff in the next lecture
  337. 15:48this is going to be a technical lecture
  338. 15:49I'm actually going to derive this finite
  339. 15:51n correction uh to the variance of xar
  340. 15:54it's pretty technical you can probably
  341. 15:55skip it if you like but if you want to
  342. 15:57know where it comes from um all write
  343. 15:59this out in terms of the co-variances um
  344. 16:01for the shrinking without replacement
  345. 16:03population okay thank you

About this transcript

This page contains the full transcript of Random Sampling in Statistics: Expected Value and Variance of the Sample Mean by Steve Brunton, generated from the public captions YouTube serves with the video. The transcript has 2,334 words across 345 segments, with the original timestamps preserved so you can click any line to jump to that moment in the embedded player.

What you can do with it

Use the transcript to take notes, quote the speaker, build a study guide, generate a summary with ChatGPT or Claude via the YouTube Summary tool, or export it as a timed subtitle file with YouTube to SRT. You can also re-open it in the transcriber to choose a caption track available on the video.

Free YouTube transcript tool

YouTube2Text is a free YouTube transcript generator — no signup, no daily limit. Paste any YouTube link and get the full transcript instantly, with timestamps, click-to-jump, caption language selection, AI prompts for ChatGPT, Claude, and Gemini, and exports to TXT, SRT, VTT, or Markdown.