Random Sampling in Statistics: Expected Value and Variance of the Sample Mean — Transcript
Full transcript
- 0:00welcome back okay so we're talking about
- 0:03the theory of random sampling to say
- 0:06something about a large but unknown
- 0:08population in terms of a random smaller
- 0:11sample of that population this is useful
- 0:14all over in statistics and this is kind
- 0:16of an entry point to more advanced uh
- 0:19topics so we showed last time that you
- 0:22can have this population um which is
- 0:24kind of a large population its PDF may
- 0:27or may not even be known but it a mean
- 0:30and and a variance and then um the
- 0:34sample statistics if I take a subsample
- 0:36a little n subsample of that big n
- 0:40population those samples become random
- 0:43variables and the average of those
- 0:46random variables
- 0:47xbar um is hopefully an estimate of the
- 0:52population mean mu so the kind of uh
- 0:55sample mean should be a good estimate of
- 0:58the population mean under some circum
- 1:00ances and we can also compute things
- 1:02like the sample variance and so on and
- 1:04so forth so this opens up a ton of
- 1:06questions um all kinds of questions come
- 1:08up
- 1:09so question one um does the expectation
- 1:14of xar does
- 1:17xar equal mu we we've kind of hinted
- 1:21that this sample mean should converge uh
- 1:25to me in the as as little n gets bigger
- 1:27and bigger as my sample size gets bigger
- 1:29but can I actually show that the
- 1:31expectation of this random variable is
- 1:33in fact the population mean mu that
- 1:35would be very useful we're going to do
- 1:36that today another question um what is
- 1:40the variance of xbar meaning we we have
- 1:45a pretty good gut feeling that this
- 1:48sample mean should be gausian
- 1:51distributed for reasonably large n we
- 1:54know that from the central limit theorem
- 1:55this should be kind of normally
- 1:57distributed hopefully with a center
- 1:59around the true mean mu but what's the
- 2:02variance of that distribution is it a
- 2:04fat distribution is it skinny we want
- 2:06the variance of xar to be really really
- 2:08small because that means xar is a really
- 2:11really tight estimate of mu so this has
- 2:14implications um about the convergence of
- 2:17these values with n how fast is xar
- 2:20converged to me how efficient is it
- 2:23things like that there's questions you
- 2:24know are is there a bias is it is the
- 2:27expectation of xar mu plus some constant
- 2:30Offset you know is there any bias in my
- 2:35estimates those are all powerful
- 2:38statistics questions we're going to ask
- 2:41and answer those for this very very
- 2:43simple case of simple random sampling to
- 2:46iner things about a population but these
- 2:49questions hold much more generally in
- 2:51statistics in data analysis and even in
- 2:54machine learning okay does my you know
- 2:56if I sample data do I converge to a good
- 3:00model of a much bigger complex process
- 3:03okay good so we're going to jump in uh
- 3:06and we're going to start with the
- 3:07expectation value because that's always
- 3:08easier to work within the variance
- 3:10because the formula is simpler than the
- 3:12formula for variance so we want to show
- 3:16that um the expectation value of
- 3:19xar equals mu meaning that xar is an
- 3:24unbiased estimate of mu so we say that
- 3:28xbar is an
- 3:34unbiased
- 3:36estimate
- 3:38of mu this is statistics language for
- 3:41the expectation value of xar equals mu
- 3:44and there's no constant error so the x
- 3:47xar is unbiased meaning it it converges
- 3:50its expectation value is exactly mu okay
- 3:53so we're going to prove this now this is
- 3:55pretty easy to prove uh maybe I will do
- 3:57this in green so the expectation of xar
- 4:03um is literally I'm just going to plug
- 4:05this in to the expectation this is equal
- 4:08to the
- 4:09expectation of 1 / n sum I = 1 to n of
- 4:14each of my random variables
- 4:17XI now we know that we can pop this
- 4:19constant out and this the expectation of
- 4:21a sum is the sum of expectations so this
- 4:24equals 1 / n sum I = 1 to
- 4:30n um
- 4:33expectation of each of these
- 4:37XIs here's a really important fact that
- 4:41I need you to to believe and to know and
- 4:44I'm just going to write it down here the
- 4:47E for any uh for any
- 4:51individual X for any
- 4:54individual uh
- 4:56indiv individual
- 5:01sample
- 5:03XI the expected value of
- 5:07XI is equal to
- 5:09Mu uh and the
- 5:13variance of
- 5:15x i is equal to Sigma squ where mu is
- 5:20the true population mean and sigma squar
- 5:22is the true population variance this is
- 5:25super important any one of these
- 5:27individual samples it's expected value
- 5:30is mean mu and its expected variance is
- 5:33Sigma squar where those are the
- 5:35population values you can actually
- 5:38convince yourself of this pretty easily
- 5:40you can write down this expectation
- 5:42value um this I'll just do it for for
- 5:44the expected value and you can convince
- 5:46yourself also for the variance um this
- 5:50is the sum over every single possible n
- 5:53over all of the big n uh J equal 1 of
- 5:57all of the little values X J times the
- 6:01probability that my random variable x i
- 6:03equals little
- 6:05XJ that's just the definition of
- 6:07expected value of this random variable
- 6:08it's the sum over all the possible
- 6:10things it could be times the probability
- 6:11that it is actually that
- 6:13thing and there are each of these um the
- 6:18chance that I drew any one of these for
- 6:20x i is just 1 over n that's the
- 6:23probability so this equals the sum over
- 6:26uh big n of little X J * a probability
- 6:30of 1 over big n this is the definition
- 6:34of
- 6:35my population mean it's 1 / n times the
- 6:40sum of all of those little XIs so you
- 6:42can convince yourself anyway that each
- 6:44of these random variables each of these
- 6:46XIs their expected value is Mu and their
- 6:49expected variance their variance is
- 6:52Sigma squar you can think about it
- 6:54because each of these X's is pulled from
- 6:56this population so you can kind of say
- 6:59that uh x i is
- 7:03distributed according to whatever the
- 7:06distribution of my
- 7:09population was okay whatever my
- 7:11population distribution is each of these
- 7:13XIs is randomly sampled from that
- 7:15population distribution so anyway this
- 7:18let's go back to to what we're trying to
- 7:20show we're trying to show that the
- 7:21expectation of xar equals mu so we take
- 7:24our sample mean xar we plug it into this
- 7:27expectation and it's the sum of all of
- 7:30these little the the these random
- 7:31variables x i * 1 over little n the
- 7:35constant pops out the sum of an expect
- 7:38the expectation of a sum is the sum of
- 7:39the expectations and now each of these
- 7:42expectation
- 7:43values is Mu so I have um essentially
- 7:49this
- 7:50equals uh 1/ n time the sum of IAL 1 to
- 7:55little n of mu each of these is equal to
- 7:58Mu this is n * mu * 1/ n this whole
- 8:02thing just equals mu the expected value
- 8:06of xar is equal to Mu very very cool
- 8:10this means that xar the sample mean is
- 8:13an unbiased estimate uh of the
- 8:16population mean mu and hopefully as n
- 8:20gets bigger and bigger this expected
- 8:23value um sorry the this distribution of
- 8:26xar gets Tighter and Tighter and Tighter
- 8:28around this expected value you good um
- 8:31maybe I'll just draw a little picture so
- 8:34um probably I have some population
- 8:38distribution and I'm actually going to
- 8:39draw it to be kind of gnarly um but
- 8:42let's say it has some mean value some
- 8:46mu the sample mean
- 8:50xar by the central limit theorem we'll
- 8:52prove this later but by the central
- 8:54limit theorem xar is going to be a
- 8:57normally distributed variable about its
- 8:59expected value of
- 9:02mu so
- 9:05xar should be normally distributed with
- 9:08its expectation value centered around mu
- 9:13and we want xar to get Tighter and
- 9:16Tighter and Tighter we want the spread
- 9:19of possible X bars to be really really
- 9:21small around this value of mu as n gets
- 9:24larger that spread of course is related
- 9:26to the variance of this uh of this xar
- 9:30quantity so now let's talk about what's
- 9:33the
- 9:35variance of xar okay variance of xar
- 9:38tells me how good this estimate is for
- 9:42um increasing sample size little n okay
- 9:46good um this result makes intuitive
- 9:48sense now let's talk about the variance
- 9:51uh of
- 9:52xar so I'm going to actually
- 9:55prove a slight approximation what I'm
- 9:58going to write down is not the exact
- 10:01variance of xar it's an approximation to
- 10:03the variance of xar making an assumption
- 10:07that each of these X's is
- 10:10independent now remember we sampled
- 10:13without replacement so every time I drew
- 10:16a sample my population got a little
- 10:18smaller that technically builds in a
- 10:21small amount of dependence between these
- 10:22variables but for really really big and
- 10:26for really really big populations you
- 10:28can kind of assume that these are are
- 10:29independent and that's what I'm going to
- 10:30write down here and then I'm going to
- 10:32write down the correction for finite n
- 10:35for finite population size so this is an
- 10:39approximation uh this equals again I'm
- 10:42going to plug in this expression into
- 10:44xar this equals the variance of the sum
- 10:47VAR of 1 / n * X1 plus dot dot dot plus
- 10:53X little
- 10:55n and I'm just going to again remind you
- 10:58this is uh
- 10:59um this is if if these are independent
- 11:05samples then I can say this this is
- 11:10um actually sorry if they're independent
- 11:13samples then I can split these into the
- 11:14sum of a bunch of variances so I'll wait
- 11:16I'll I'll I'll wait to write down my
- 11:18Independence assumption in a minute um
- 11:21so my 1/n pops out as a 1 over n^ 2
- 11:25that's how variance of a constant times
- 11:27a variable you can pop that constant
- 11:29squared out so this equals 1 over n^
- 11:34squar times the variance of this sum and
- 11:38that is the sum of the individual
- 11:39variances that is VAR
- 11:43X1 plus dot dot dot plus VAR
- 11:49xn now I've used this assumption this is
- 11:53true if my X eyes are independent
- 12:00and that's true for very very large
- 12:04population size and much much greater
- 12:06than one like n a million or 100,000 or
- 12:1010,000 this is going to be a very good
- 12:12approximation technically there is joint
- 12:16co-variance between these variables and
- 12:18so this step is actually not exactly
- 12:20true it's really kind of this is
- 12:21approximately equal to this for very
- 12:24large population size so be on the watch
- 12:27for me making those kinds of approx IM
- 12:30again we're trying to compute the
- 12:31variance of our sample mean we want that
- 12:34variance to be small it's equal now
- 12:36approximately to 1 n^ 2times the sum of
- 12:39the variances of all of those individual
- 12:40elements and the sum of those variances
- 12:43each of those variances are the
- 12:45population variance Sigma squar so I can
- 12:48write this
- 12:49now as you know each of these this is
- 12:52just um let's
- 12:55say
- 12:56uh this is n * Sigma
- 13:00s and so this whole thing is
- 13:03approximately equal to n / n^ 2 * Sigma
- 13:06squ that's Sigma squar over n and
- 13:11actually this is the result from the
- 13:13central limit theorem so I want you to
- 13:14go back and and check out that Central
- 13:17limit theorem uh video this is the
- 13:21result from the central limit
- 13:23theorem um that that if you have the sum
- 13:27of a bunch of independent random
- 13:29variables each with their own variance
- 13:31Sigma squar then the sum of those
- 13:33variables would have um this uh variance
- 13:37okay so this is actually all coming from
- 13:40the central limit theorem this is um I
- 13:42guess law of large numbers this is
- 13:44Central limit theorem
- 13:48good now I'll show this in the next
- 13:50video I'll actually go through the Gory
- 13:51details of deriving this in the next
- 13:53video but remember this is only true for
- 13:56very very large n very large population
- 14:00so for
- 14:03finite uh population
- 14:05size Big N technically this VAR X bar
- 14:12there is a correction and again I'm
- 14:13going to derive this in the next lecture
- 14:15there's a correction it's Sigma 2ar over
- 14:20n * 1 - little n minus1 over big n minus
- 14:27one okay and again
- 14:29and this is approximately equal to Sigma
- 14:332 over little
- 14:34n when uh little n is much less than big
- 14:39n when I have a really big
- 14:41population um and my sample size is
- 14:44small compared to that really big
- 14:45population then I recover this this very
- 14:48very good approximation to the variance
- 14:50of xar so for small populations and
- 14:53small samples you need this this finite
- 14:55size correction most of the time we're
- 14:57going to end up using this result from
- 14:58the Central limit theorem we're going to
- 15:00assume that our sample mean xar is a
- 15:04normally distributed random variable
- 15:06with mean mu and variance Sigma squ Over
- 15:10N where Sigma squar and mu are the
- 15:13variance and mean of our overall
- 15:15population so this xbar tells us a lot
- 15:18about this unknown
- 15:20population um so measuring this xar
- 15:23measuring all of this sample taking this
- 15:25random sample and Computing this xar the
- 15:27sample mean tells me a ton about the
- 15:30population and as n gets bigger and
- 15:32bigger and bigger this variance gets
- 15:35smaller and smaller and smaller meaning
- 15:36we
- 15:38converge uh to the true population mean
- 15:42with a relatively small sample n okay
- 15:46super cool stuff in the next lecture
- 15:48this is going to be a technical lecture
- 15:49I'm actually going to derive this finite
- 15:51n correction uh to the variance of xar
- 15:54it's pretty technical you can probably
- 15:55skip it if you like but if you want to
- 15:57know where it comes from um all write
- 15:59this out in terms of the co-variances um
- 16:01for the shrinking without replacement
- 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.