Variance and standard deviation
-
Variance of a population
-
Sample variance
-
Review and intuition why we divide by n-1 for the unbiased sample variance
-
Simulation showing bias in sample variance
-
Unbiased Estimate of Population Variance
-
Another simulation giving evidence that (n-1) gives us an unbiased estimate of variance
-
Simulation providing evidence that (n-1) gives us unbiased estimate
-
Will it converge towards -1?
-
Variance
-
Statistics: Standard Deviation
-
Exploring Standard Deviation 1 Module
-
Exploring standard deviation 1
-
Standard deviation
-
Statistics: Alternate Variance Formulas
Statistics: Alternate Variance Formulas Playing with the formula for variance of a population.
⇐ Use this menu to view and help create subtitles for this video in many different languages.
You'll probably want to hide YouTube's captions if using these subtitles.
- I think now's as good a time as any to play around a little bit
- with the formula for variance and see where it goes.
- And I think just by doing this, we'll also get a little bit
- better intuition of just manipulating sigma notation
- or even what it means.
- So we learned, several times, that the formula for
- variance-- and let's just do variance of a population.
- It's almost the same thing as variance of a sample.
- You just divide by n instead of n minus 1.
- Variance of a population is equal to-- Well you take each
- of the data points, x sub i.
- You subtract from that the mean.
- You square it.
- And then you take the average of all of these.
- So you add the squared distance for each of these points from i
- equals 1 to i is equal to N.
- And you divide it by N.
- Let's see what happens if we can-- Maybe we want to multiply
- out the squared term and see where it takes us.
- So let's see.
- And I think it'll take us someplace interesting.
- So this is the same thing as the sum from i is equal
- to 1 to N of-- Let's see.
- This, we just multiply it out.
- This is the same thing as x sub i squared minus-- This is your
- little algebra going on here.
- So when you square it-- I mean, we can multiply it out.
- We could write it x sub i minus mu times x sub i minus mu.
- So we have x sub i times x sub i.
- That's x sub i squared.
- Then you have x sub i times mu-- times minus mu.
- And then you have minus mu times x sub i.
- So when you add those two together, you get minus
- 2 x sub i mu, right?
- Because you have it twice. x sub i times mu.
- That's 1 minus x sub i mu.
- And then you have another one.
- Minus mu x sub i.
- When you add them together, you get minus 2 x sub i mu.
- I know it's confusing with me saying sub i and all of that.
- But it's really no different than when you did
- a minus b squared.
- Just the variables look a little bit more complicated.
- And then the last term is minus mu times minus mu, which
- is plus mu squared.
- Fair enough.
- Let me switch colors just to keep it interesting.
- Let me cordon that off.
- OK.
- So how can we-- Well the sum of this is the same thing as the
- sum of-- Because, if you think about it, we're going
- to take each x sub i.
- For each of the numbers in our population, we're going
- to perform this thing.
- And we're going to sum it up.
- But if you think about it, this is the same thing as-- If
- you're not familiar with a sigma notation, this is a good
- kind of thing to know in general.
- Just a little bit of intuition.
- This is the same thing as-- I'll do it here to have space
- --as the sum from i is equal to 1 to N of the first term, x sub
- i squared minus-- And actually, we can bring out the
- constant terms.
- You just can't take-- When you're summing, the only thing
- that matters is the thing that has the ith term.
- So in this case, it's x sub i.
- So x sub 1, x sub 2.
- So that's the thing that you'd have to leave on the right-hand
- side of the sigma notation.
- And if you've done the calculus playlist already, sigma
- notation is really kind of like a discrete integral
- on some level.
- Because in an integral, you're summing up a bunch of things.
- You're multiplying them times dx, which is a
- really small interval.
- But here, you're just taking a sum.
- And that's what-- Well we showed-- In the calculus
- playlist I said that an integral actually is kind of
- this infinite sum of infinitely small things, but I don't
- want to digress too much.
- But this is just a long way of saying that the second-- The
- sum from i equals 1 to N of the second term is the same thing
- as minus 2 times mu of the sum from i is equal to
- 1 to n of x sub i.
- And then finally you have plus-- Well this is just
- a constant term, right?
- This is just a constant term so you can take it out --times
- mu squared times the sum i sub-- from i equals 1 to N.
- And what's going to be here?
- What's going to-- It's going to be a 1, right?
- We just divided a 1.
- We just divided this by 1 to get out of the sigma
- sign, out of the sum.
- And you're just left with a 1 there, right?
- Actually we could have just left the mu squared there.
- But either way, let's just keep simplifying it.
- So this is-- This we can't really do.
- Well actually we could-- Well, no.
- We we don't know what the x sub i's are.
- So we just have to leave that the same.
- So that's the sum-- Oh sorry.
- This is just the numerator, right?
- This whole simplification.
- We're just simplifying the numerator.
- And later, we're just going to divide by N.
- So that is equal to that divided by N.
- Which is equal to this thing divided by N.
- I'll divide by N at the end.
- Because it's the numerator that's the confusing
- part, right?
- We just want to simplify this term up here.
- So let's keep doing this.
- So this is equal to the sum from i equals 1 to
- N of x sub i squared.
- And let's see.
- Minus 2 times mu.
- Sorry.
- That mu doesn't look good.
- Edit, undo.
- Minus 2 times mu times the sum from i is equal to 1 to N x i.
- And then what is this?
- What is another way to write this?
- Essentially we're going to add 1 to itself N times, right?
- This is kind of saying just whatever you have here just
- iterate through it N times.
- If you had an x sub i here, you would use the first x term,
- then the second x term.
- When you have a 1 here, this is just essentially saying add
- 1 to itself N times, right?
- Which is the same thing as N.
- So this is going to be plus mu squared times N.
- All right.
- Then-- See if there's anything else we can do here.
- Remember this is just the numerator.
- So this looks fine.
- We add up each of those terms.
- And we just have minus 2 mu, right?
- From i equals 1 to-- Oh.
- Well think about this.
- What is this?
- What is this thing right here?
- Well, actually let's bring back that N.
- So this is this simplified to that divided by N, which
- simplifies to that whole thing.
- Which simplifies by this whole thing divided by N, right?
- Which simplifies to this whole thing divided by N.
- Which is the same thing as each of the terms divided by N.
- Which is the same thing as that.
- Which is the same thing as that.
- Which is the same thing as that, right?
- And now, well how does this simplify?
- This is the interesting part.
- Well this-- Nothing much I can do here.
- So that just becomes the sum from i is equal to 1 to N x sub
- i squared divided by big N.
- Now this is interesting.
- What is-- If I take each of the terms in my population and I
- add them up and then I divide it by N, what is that?
- This thing right here.
- If I sum up all the terms in my population and divide by the
- number of terms there are, that's the mean, right?
- That's the mean of my population.
- So this thing right here is also mu.
- So this thing simplifies to what?
- Minus 2 times what?
- Mu times-- This whole thing is mu too.
- So times mu squared, right?
- Mu times mu.
- This is the mean of the population.
- So that was a nice simplification.
- And then plus-- What do you have here?
- Let's see.
- You have mu.
- Well you have n over n.
- Those cancel out.
- So you just have plus mu squared.
- So that was a very nice simplification.
- And then this simplifies to-- Can't do much on this side.
- So the sum from i is equal to 1 to N of x sub i squared over N.
- And then you see we have minus 2 mu squared plus mu squared.
- Well that's the same thing as minus mu squared, right?
- Minus the mean squared.
- So this, already, we've kind of come up with a neat way of
- writing the variance, right?
- You can essentially take the average of the squares of all
- of the numbers in your, in this case, a population.
- And then subtract from that the mean of your population--
- the mean squared of your population.
- So this could be, depending on how you're calculating things,
- may be a slightly faster way of calculating the variance.
- So just playing with a little algebra, we got from this
- thing, where you have to, each time, take each of your
- data points, subtract the mean from it.
- And then square it.
- And, of course, before you do anything, you have
- to calculate the mean.
- Then you take the square, then you sum it all up, then you
- take the average, essentially, when you divide it-- when
- you sum and divide it by N.
- We've simplified it, just using a little bit of algebra,
- to this formula.
- And this is-- We're getting to something called
- the raw score method.
- We could-- What we want to do is, write this right here
- just in terms of x i's.
- And then we really are at, what you call, the raw score method.
- Which is, oftentimes, a faster way of calculating
- the variance.
- So let's see.
- What is mu equal to?
- What is the mean?
- The mean is just equal to the sum from i is equal to 1 to N
- of each of the terms, right?
- You just take the sum of each of the terms.
- And you divide by the number of terms there are, right?
- So that is equal to-- So if we look at this thing.
- This thing can be written as-- Let me draw a line here.
- This thing can be written as the sum from i is equal to
- 1 to N of x sub i squared.
- All of that over N.
- Minus mu squared.
- Well mu is this.
- So this thing squared.
- So this thing squared is what?
- This is, let's see, x sub i-- take the sum --to N.
- i this is equal to 1.
- You're going to take-- You're going to square this thing.
- And then you're going to divide it by-- We squared right?
- You divide it by N squared.
- And what's-- This might seem like a more-- Out of all of
- them, this actually seems like the simplest formula for me.
- Where you, essentially, you just take-- If you know the
- mean of your population, right?
- You say OK.
- My mean is whatever and I can just square that and just
- put that aside for second.
- But first, I can take each of the numbers, square them,
- and then sum them up, and divide by the number of
- numbers I have, right?
- I don't know if I wrote-- No.
- I've erased the last set of numbers I had.
- But we could show you that you'll get to
- the same variance.
- So to me, this is almost the simplest formula.
- But this one's even faster in a lot of ways because you don't
- really have to even calculate the mean ahead of time.
- You can just say for each x i, I just perform this operation.
- And then I divide by N squared or N accordingly and I'll
- also get to the variance.
- You don't have to do this calculation before you figure
- out the whole variance.
- But anyway, I thought it would be instructive and hopefully
- give you a little bit more intuition behind the algebra
- dealing with sigma notations.
- If we kind of worked out these other ways to write variances.
- And frankly, some books will just kind of say,
- oh yeah you know what?
- The variance could be written like this or-- And we're
- talking about the variance of a population.
- Or it could be written like this.
- Or maybe they'll even write it like this.
- And it's good to know that you can just do a little bit of
- simple algebraic manipulation and get from one to the other.
- Anyway, I've run out of time.
- See you in the next video.
Be specific, and indicate a time in the video:
At 5:31, how is the moon large enough to block the sun? Isn't the sun way larger?
|
Have something that's not a question about this content? |
This discussion area is not meant for answering homework questions.
Discuss the site
For general discussions about Khan Academy, visit our Reddit discussion page.
Flag inappropriate posts
Here are posts to avoid making. If you do encounter them, flag them for attention from our Guardians.
abuse
- disrespectful or offensive
- an advertisement
not helpful
- low quality
- not about the video topic
- soliciting votes or seeking badges
- a homework question
- a duplicate answer
- repeatedly making the same post
wrong category
- a tip or feedback in Questions
- a question in Tips & Feedback
- an answer that should be its own question
about the site
Share a tip
Suggest a fix
Have something that's not a tip or feedback about this content?
This discussion area is not meant for answering homework questions.