WEBVTT mathematics/probability/murray
00:00:00.000 --> 00:00:04.500
Hi, welcome back to the probability lectures here on www.educator.com.
00:00:04.500 --> 00:00:09.900
We are working through a chapter on Bivariate distribution functions and density functions,
00:00:09.900 --> 00:00:15.700
which means that there are two variables, there is a Y1 and Y2.
00:00:15.700 --> 00:00:21.800
In this section, we are also going to have sometimes more than two variables that might be N variables.
00:00:21.800 --> 00:00:29.000
We got a big section to cover today, it is going to cover covariance and correlation coefficient,
00:00:29.000 --> 00:00:32.200
and linear functions of random variables.
00:00:32.200 --> 00:00:39.800
I will be your guide today, my name is Will Murray, let us jump right on in.
00:00:39.800 --> 00:00:46.100
The main idea of this section is covariance, the correlation coefficient is not something that is quite as important.
00:00:46.100 --> 00:00:48.600
Let me jump right on in with the covariance.
00:00:48.600 --> 00:00:53.800
The definition of covariance is not necessarily very enlightening.
00:00:53.800 --> 00:00:59.200
Let me go ahead and show you the definition, but then I’m going to skip quickly to some formulas
00:00:59.200 --> 00:01:02.800
that are probably more useful in dealing with covariance.
00:01:02.800 --> 00:01:07.700
In the next slide, I will try to give you an intuition for what covariance means.
00:01:07.700 --> 00:01:14.900
The definition of the covariance is that, you will have to start with two random variables.
00:01:14.900 --> 00:01:18.300
You always have a Y1 and Y2.
00:01:18.300 --> 00:01:22.200
You always talk about the covariance of two random variables at once.
00:01:22.200 --> 00:01:31.400
By definition, it means the expected value of Y1 - μ1 and what × Y2 - μ2.
00:01:31.400 --> 00:01:37.700
Here, μ1 and μ2 are the means or the expected values of Y1 and Y2.
00:01:37.700 --> 00:01:45.100
I think that, that definition does not offer a lot of intuitive light onto what covariance means.
00:01:45.100 --> 00:01:48.300
I will talk about the intuition, maybe on the next slide.
00:01:48.300 --> 00:01:53.000
In the meantime, I will give you some useful formulas for calculating covariance,
00:01:53.000 --> 00:01:57.500
because that definition is also not very useful for calculating covariance.
00:01:57.500 --> 00:02:07.900
Often, the easiest way to calculate covariance is to use this formula right here, where you calculate the expected value of Y1 × Y2.
00:02:07.900 --> 00:02:13.900
And then, you subtract off expected value of Y1 × the expected value of Y2.
00:02:13.900 --> 00:02:16.200
That is usually the easiest way to calculate it.
00:02:16.200 --> 00:02:24.500
By the way, for each one of these, you are going to have to calculate the expected value of a function of random variables.
00:02:24.500 --> 00:02:26.900
We learned how to do that, in the previous lecture.
00:02:26.900 --> 00:02:33.000
If you are not sure how you would calculate the expected value for example of Y1 × Y2,
00:02:33.000 --> 00:02:41.100
what you want to do is watch the previous lecture here on the probability series on www.educator.com.
00:02:41.100 --> 00:02:46.500
I went through some examples where we practiced calculating things like that.
00:02:46.500 --> 00:02:49.000
You can see how you would calculate that.
00:02:49.000 --> 00:02:56.000
A useful point here is that, if you ever have to calculate the covariance of Y1 with itself,
00:02:56.000 --> 00:02:59.800
it is exactly equal to the variance of Y1.
00:02:59.800 --> 00:03:06.100
If you have to calculate the covariance of any single variable with itself, it is just the same as the variance.
00:03:06.100 --> 00:03:13.100
The way covariance behaves under scaling is that, if you multiply these variables by constants
00:03:13.100 --> 00:03:18.500
then those constants just pop out, and you just get C² coming out to the outside.
00:03:18.500 --> 00:03:23.000
That is a very useful if you have to deal with linear functions which is something
00:03:23.000 --> 00:03:27.700
we are going to talk about later on, in this lecture.
00:03:27.700 --> 00:03:31.700
That is the definition, which I do not really recommend that you use that often.
00:03:31.700 --> 00:03:35.800
The definition for me is not useful, when calculating covariance.
00:03:35.800 --> 00:03:41.200
These formulas are much more useful, specially this first one, it is the one that I used all the time,
00:03:41.200 --> 00:03:43.400
when I’m calculating covariance.
00:03:43.400 --> 00:03:47.500
That is definitely worth committing to memory.
00:03:47.500 --> 00:03:52.900
I have not really told you yet, what covariance means when you are measuring.
00:03:52.900 --> 00:03:55.800
Let me spend the next slide talking about that.
00:03:55.800 --> 00:04:05.500
The intuition for covariance is that, it is a measure of dependents between your two variables Y1 and Y2.
00:04:05.500 --> 00:04:13.800
It measures how closely Y1 and Y2 track each other.
00:04:13.800 --> 00:04:19.000
There is an easy mistake that students make, when you are first learning about probability,
00:04:19.000 --> 00:04:21.200
which is to think that dependence,
00:04:21.200 --> 00:04:25.300
If two variables are dependent that means that they do the same thing.
00:04:25.300 --> 00:04:33.600
That is not quite what dependence means, what dependence means is that knowing about what one variable does,
00:04:33.600 --> 00:04:38.600
gives you more information about what the other variable does.
00:04:38.600 --> 00:04:41.000
It does not necessarily mean that they move together.
00:04:41.000 --> 00:04:47.600
It just means that one variable gives you some kind of guide, as to what the other variable is doing.
00:04:47.600 --> 00:04:54.300
The way that behaves, in terms of covariance, is that if the variables do move together,
00:04:54.300 --> 00:04:55.900
then covariance will be positive.
00:04:55.900 --> 00:05:00.200
It shows that those variables are positively correlated.
00:05:00.200 --> 00:05:05.100
If one is big then you expect the other one to be big.
00:05:05.100 --> 00:05:11.900
If Y1 moves consistently against Y2, which means Y1 is big and the other one is small.
00:05:11.900 --> 00:05:14.100
Or if the first one is small the other one is big.
00:05:14.100 --> 00:05:22.200
They move like this, they move against each other, that is still dependence.
00:05:22.200 --> 00:05:27.000
That would be reflected in the covariance, you will get a negative value for the covariance.
00:05:27.000 --> 00:05:31.500
It means these variables are negatively correlated against each other.
00:05:31.500 --> 00:05:41.300
Let me emphasize here that both of these are still considered to be dependence, to be examples of dependence.
00:05:41.300 --> 00:05:49.000
Both of these show dependence.
00:05:49.000 --> 00:05:54.400
And that is sometimes a little confusing for students, when you are first learning about probability.
00:05:54.400 --> 00:05:57.300
Both of these are examples of dependence.
00:05:57.300 --> 00:06:02.700
You think, wait a second, if two variables are moving against each other, are not those independent,
00:06:02.700 --> 00:06:08.600
that kind of make you think of your intuition as being independent, if they are moving against each other.
00:06:08.600 --> 00:06:13.100
Not so, that is dependent, if they are moving against each other.
00:06:13.100 --> 00:06:18.500
The example that I use with my own students is, to imagine that you are a parent and
00:06:18.500 --> 00:06:23.200
you have 2 twin children, may be 2 twin boys.
00:06:23.200 --> 00:06:30.200
One of your children is just very well behaved, the boy does everything that you tell him to.
00:06:30.200 --> 00:06:34.000
That is dependence because you can sort of control what that boy does,
00:06:34.000 --> 00:06:37.400
by telling him to do something and he does it.
00:06:37.400 --> 00:06:41.200
Imagine that your other twin boy is very mischievous.
00:06:41.200 --> 00:06:44.400
He always does the opposite of what you tell him to do.
00:06:44.400 --> 00:06:47.100
Whatever you tell him to do, he does the opposite.
00:06:47.100 --> 00:06:50.900
If you tell him to go to bed, then he runs around and plays.
00:06:50.900 --> 00:06:56.300
If you tell him to runaround and play, then he goes to bed.
00:06:56.300 --> 00:07:02.400
You might think, that is a very independent child but that is not an independent child
00:07:02.400 --> 00:07:06.400
because you can still control that child by using reverse psychology.
00:07:06.400 --> 00:07:10.700
If you want him to go to bed, tell him to run around and play, and he will go to bed.
00:07:10.700 --> 00:07:16.300
If you want him to run around and play, tell him to go to bed and he will run around and play.
00:07:16.300 --> 00:07:21.700
You can still control that child because that child is still responding to your commands,
00:07:21.700 --> 00:07:24.400
he is just responding in the opposite fashion.
00:07:24.400 --> 00:07:28.500
You can still control that child, just by using reverse psychology.
00:07:28.500 --> 00:07:33.400
That is dependence and that is kind of the situation that you want to think of here,
00:07:33.400 --> 00:07:37.100
when you got two variables that move against each other.
00:07:37.100 --> 00:07:43.400
If you had a child that, if you tell him to go to bed, sometimes he goes to bed and sometimes he runs around and plays,
00:07:43.400 --> 00:07:49.900
that would be an independent child, that would be a child you could not control by any kind of psychology.
00:07:49.900 --> 00:07:52.100
That is really what you want think of independence.
00:07:52.100 --> 00:07:56.900
If you cannot control the actions then that would be independence.
00:07:56.900 --> 00:08:02.300
But, if two variables move together, that is dependence.
00:08:02.300 --> 00:08:11.700
If two variables move against each other consistently, that is still dependence.
00:08:11.700 --> 00:08:15.800
Finally, let me show you how independence enters this picture.
00:08:15.800 --> 00:08:23.900
The theorem is that if Y1 and Y2 are independent then their covariance is always going to be equal to 0.
00:08:23.900 --> 00:08:28.400
Remember, covariance is the measure of dependence.
00:08:28.400 --> 00:08:32.000
If they are independent then the covariance is 0.
00:08:32.000 --> 00:08:36.000
Unfortunately, the converse of that theorem is not true.
00:08:36.000 --> 00:08:41.200
You would like to say, if the covariance is 0 then the variables are independent.
00:08:41.200 --> 00:08:52.900
That is not true, you can have covariance of two variables being 0 and that still have some dependence between the variables.
00:08:52.900 --> 00:09:00.500
That is a rather unfortunate result of the mathematics, there is no way for me to fix that.
00:09:00.500 --> 00:09:09.300
I will give you an example of that and that is coming up in the problems that we are about to do, in example 2.
00:09:09.300 --> 00:09:16.100
If you just scroll down, scroll forward in this lecture, you will find an example
00:09:16.100 --> 00:09:24.400
where the covariance is going to come out to be 0, and the Y1 and Y2 will still be dependent.
00:09:24.400 --> 00:09:28.500
That is kind of unfortunate, it would be very nice if this theorem worked in both directions.
00:09:28.500 --> 00:09:34.800
It does work in one direction but it does not work in the other direction.
00:09:34.800 --> 00:09:39.900
One new concept for this lecture is the correlation coefficient.
00:09:39.900 --> 00:09:42.800
This is very closely related to covariance.
00:09:42.800 --> 00:09:50.500
In fact, if you are studying along in your book, they probably be mentioned in the same section with covariance in your book.
00:09:50.500 --> 00:09:54.100
You start out with random variables, you calculate their covariance.
00:09:54.100 --> 00:09:57.400
Remember, we learn about that a couple slides ago.
00:09:57.400 --> 00:10:00.200
You can go back and look at the definition of covariance.
00:10:00.200 --> 00:10:04.200
What you do is you just divide by their standard deviations.
00:10:04.200 --> 00:10:11.100
The correlation coefficient is really just a scaled version of the covariance.
00:10:11.100 --> 00:10:15.400
You just take the covariance and you scale it down, by a couple of constants.
00:10:15.400 --> 00:10:23.700
The point of the correlation coefficient is that, if you did multiply each one of your variables by a constant
00:10:23.700 --> 00:10:30.100
then the constant washes out of the definition of the correlation coefficient.
00:10:30.100 --> 00:10:36.600
You end up with the same correlation coefficient, that you would have in the first place.
00:10:36.600 --> 00:10:39.000
By the way, this Greek letter is pronounced ρ.
00:10:39.000 --> 00:10:47.800
This is the Greek letter ρ, ρ of a scale version of the variables comes out to be the same ρ.
00:10:47.800 --> 00:10:54.100
That is very nice, that means that ρ, the correlation coefficient is independent of scale.
00:10:54.100 --> 00:10:56.800
It is convenient, if you are taking measurements.
00:10:56.800 --> 00:11:00.600
It does not matter, if you are measuring in inches, feet, or meters, or whatever.
00:11:00.600 --> 00:11:04.200
You are still going to get the same correlation coefficient.
00:11:04.200 --> 00:11:09.800
In particular, the correlation coefficient will always be between -1 and 1.
00:11:09.800 --> 00:11:17.700
It is an absolute constant that, you can discuss correlation coefficients between different sets of data.
00:11:17.700 --> 00:11:22.200
You will always know that you are working on a scale between -1 and 1.
00:11:22.200 --> 00:11:29.100
That is not true with covariance, covariance can be as big or as be negative as you can imagine.
00:11:29.100 --> 00:11:36.100
But, correlation coefficient is always between -1 and 1, it is a sort of a universal scale.
00:11:36.100 --> 00:11:40.800
There is going to be an example in this lecture where we will calculate the correlation coefficient.
00:11:40.800 --> 00:11:46.000
At the end, we will actually translate into a decimal and we will just check if that it is between -1 and 1.
00:11:46.000 --> 00:11:52.700
If it does come out to be between -1 and 1, then that is a little signal that we have probably done our work right.
00:11:52.700 --> 00:11:57.400
If it comes out to be bigger than 1, we know that we have done something wrong.
00:11:57.400 --> 00:12:02.800
The next topic that we need to learn about is linear functions of random variables.
00:12:02.800 --> 00:12:07.300
Let us start out with a collection of random variables, Y1 through YN.
00:12:07.300 --> 00:12:15.400
We have means or expected values, remember expected value and mean are the exact same thing.
00:12:15.400 --> 00:12:23.100
Means are μ1 to μn and the variances are σ1² through σ N².
00:12:23.100 --> 00:12:31.600
What we want do is build up this linear combination, this linear function A1 Y1 up to AN YN.
00:12:31.600 --> 00:12:36.100
We are building a linear function out of the Yi.
00:12:36.100 --> 00:12:39.500
We want to find the expected value of that construction.
00:12:39.500 --> 00:12:43.800
It turns out to be just exactly what you would think and hope it would be,
00:12:43.800 --> 00:12:52.000
which is just A1 × expected value of Y1 up to AN × the expected value of YN.
00:12:52.000 --> 00:13:00.100
That is just because expectation is linear, it works very well and gives you what you would expect.
00:13:00.100 --> 00:13:03.900
The variance is not so nice, it is a little bit trickier.
00:13:03.900 --> 00:13:12.500
The variance of A1 Y1 up to AN YN, first of all, these coefficients get².
00:13:12.500 --> 00:13:16.300
You have A1² and AN².
00:13:16.300 --> 00:13:28.900
And then, the σ 1², remember that is the variance of Y1 up to σ N² is the variance of YN.
00:13:28.900 --> 00:13:33.200
That is not all, there is another term on this formula which is that,
00:13:33.200 --> 00:13:39.300
you have to look at all the covariances of all the variables with each other.
00:13:39.300 --> 00:13:50.500
You look at all the covariances of the i and j, and for each pair, if you have Y1 and Y3 or Y2 and Y5,
00:13:50.500 --> 00:13:55.700
for each one of those pairs, you take the coefficients of each one, the Ai and Aj.
00:13:55.700 --> 00:13:58.800
You add them up and you multiply all these by 2.
00:13:58.800 --> 00:14:04.500
The reason you are multiplying by 2 is because you are doing Y1 with Y3.
00:14:04.500 --> 00:14:08.500
And then, later on you will be doing Y3 with Y1.
00:14:08.500 --> 00:14:17.100
That is why we get that factor of 2 in there, it is because you get each pair in each order.
00:14:17.100 --> 00:14:24.100
That is what you would get for the variance of a linear combination of random variables.
00:14:24.100 --> 00:14:28.600
We will study some examples of that, so you got a chance to practice this.
00:14:28.600 --> 00:14:35.800
There is one more formula which is, when you want to calculate the covariance of two linear combinations.
00:14:35.800 --> 00:14:49.700
The covariance of A1 Y1 up to AN YN and B1 X1 up to BM XM, the covariance of those two things together.
00:14:49.700 --> 00:14:56.000
It actually behaves very nicely, you just take the covariance of all the individual pairs.
00:14:56.000 --> 00:15:01.600
You can factor out the coefficients and then you just add up that sum.
00:15:01.600 --> 00:15:13.800
All the pairs, YI × XJ or covariance of YI with XJ, and then you just put on the coefficients Ai and B sub J.
00:15:13.800 --> 00:15:20.600
The covariance behaves really quite nicely with respect to linear combinations.
00:15:20.600 --> 00:15:25.500
That is a lot of background material, I hope that I have not lost you yet.
00:15:25.500 --> 00:15:33.200
I want to jump in and we will solve some examples, and we will see how all these formulas play out in practice.
00:15:33.200 --> 00:15:37.900
In example 1, we have got a joint density function.
00:15:37.900 --> 00:15:42.200
This terminology might be a little unfamiliar to people who are just joining me.
00:15:42.200 --> 00:15:48.900
That colon means defined to be.
00:15:48.900 --> 00:15:59.300
We are defining the joint density to be and that = means always equal to.
00:15:59.300 --> 00:16:06.500
It is like equal but it is sort of saying that, no matter what Y1 and Y2 are, this is always equal to 1.
00:16:06.500 --> 00:16:15.200
Let us see, this is over the triangle with corners at -1, 0 and 0, 1 and 1,0.
00:16:15.200 --> 00:16:21.300
I will go ahead and graph that because we are going to end up calculating some double integrals here.
00:16:21.300 --> 00:16:29.600
Let me use the formulas that we learned in the previous lecture, on expected values of functions of random variables.
00:16:29.600 --> 00:16:39.500
If you did not watch that lecture, you really want to go back and watch that lecture before this example will make sense.
00:16:39.500 --> 00:16:46.900
There is the -1,0 and there is 0,1 and there is 1,0.
00:16:46.900 --> 00:16:54.100
The region we are talking about here, let me go ahead and put my scales on here.
00:16:54.100 --> 00:17:03.100
This is Y1 and this is Y2, there is -1, there is 1, there is 1, and 0.
00:17:03.100 --> 00:17:11.200
This region that we are talking about is this triangular region, that is sort of a triangle here.
00:17:11.200 --> 00:17:16.400
Since, I'm going to be using some double integrals to calculate these expected values,
00:17:16.400 --> 00:17:19.300
I want to describe this region.
00:17:19.300 --> 00:17:29.000
I think the best way to describe it, is by listing Y2 first and then listing Y1 as varying between these two lines.
00:17:29.000 --> 00:17:31.900
Otherwise, I would have to chop this up into two separate pieces.
00:17:31.900 --> 00:17:35.100
It is really more work than what I want to do.
00:17:35.100 --> 00:17:37.300
Let me try to find the equation of those lines.
00:17:37.300 --> 00:17:42.700
The sign back here is Y2 = Y1 + 1.
00:17:42.700 --> 00:17:49.700
That is just following slope intercept form, the slope is 1 and Y intercept is 1.
00:17:49.700 --> 00:17:52.000
It is like Y = X + 1.
00:17:52.000 --> 00:17:59.200
If I solve for that in terms of Y1, that is Y1 = Y2 -1.
00:17:59.200 --> 00:18:08.900
This line right here is, the slope Y2 is slope -1 - Y1 + 1.
00:18:08.900 --> 00:18:17.400
If I solve for Y1, I get Y1 would be 1 - Y2, that is that line.
00:18:17.400 --> 00:18:21.500
If I want to describe that region, I can describe it in terms of Y2 first.
00:18:21.500 --> 00:18:41.400
Y2 goes from 0 to 1 and Y1 goes from that left hand diagonal line Y2 -1, to the right hand diagonal line which is 1 - Y2.
00:18:41.400 --> 00:18:45.000
I got a description of the region, I need to set up some double integrals.
00:18:45.000 --> 00:18:50.200
Let me set up a double integral for expected value of Y1.
00:18:50.200 --> 00:18:54.700
All these double integrals will have the same bound, that is one small consolation.
00:18:54.700 --> 00:19:02.300
To get the value of Y1, will be the integral as Y2 goes from 0 to 1.
00:19:02.300 --> 00:19:15.400
Y1 goes from Y2 -1 to 1 - Y2, just following those limits there.
00:19:15.400 --> 00:19:17.900
I’m calculating the expected value of Y1.
00:19:17.900 --> 00:19:25.500
I will put Y1 here and I want to put the density function that is just 1.
00:19:25.500 --> 00:19:30.000
DY1, that is the inside one, and DY2.
00:19:30.000 --> 00:19:36.600
Notice here that, the function F = Y1 that is what I’m integrating.
00:19:36.600 --> 00:19:41.500
That is positive on the right hand triangle and negative on the left hand triangle.
00:19:41.500 --> 00:19:47.800
It is symmetric, and the shape of the region we are integrating over is symmetric too.
00:19:47.800 --> 00:19:53.400
This double integral is equal to 0, by symmetry.
00:19:53.400 --> 00:20:00.000
This thing is completely balanced around the Y2 axis.
00:20:00.000 --> 00:20:03.800
I can work out that double integral, it is not a very hard double integral.
00:20:03.800 --> 00:20:09.000
But, I'm feeling a little lazy today and I do not think I want to work that out.
00:20:09.000 --> 00:20:14.600
I’m just going to say by symmetry it is equal to 0, if I did work out that integral.
00:20:14.600 --> 00:20:19.100
It might not be a bad idea, if you are little unsure of this to work out the double integral and
00:20:19.100 --> 00:20:26.300
really make sure that you get 0, so that you believe this, if it seems a little suspicious to you.
00:20:26.300 --> 00:20:30.400
In the meantime, I will go ahead and calculate the expected value of Y2.
00:20:30.400 --> 00:20:48.400
Same double integral, at least the same limits, Y2 = 0, Y2 = 1, and Y1 = Y2 -1, and Y1 = 1 - Y2.
00:20:48.400 --> 00:20:58.000
I'm finding the expected value of Y2, I do Y2 × 1 DY1 DY2.
00:20:58.000 --> 00:21:04.400
Y2 is not symmetric over this region, because it ranges from 0 to 1.
00:21:04.400 --> 00:21:08.200
I can not get away with invoking symmetry, again.
00:21:08.200 --> 00:21:12.900
I have to actually do this double integral.
00:21:12.900 --> 00:21:15.200
I will go ahead and do it, it is not bad.
00:21:15.200 --> 00:21:18.300
I'm integrating Y2 with respect to Y1.
00:21:18.300 --> 00:21:25.100
Y2 is just a constant, that can give me Y2 × Y1.
00:21:25.100 --> 00:21:36.600
I’m integrating that or evaluate that from Y1 = Y2 - -1 to Y1 = 1 - Y2.
00:21:36.600 --> 00:21:54.300
I get Y2 × 1 - Y2 - Y2 -1 - (Y2-1).
00:21:54.300 --> 00:22:02.200
That is Y2 ×, it looks like -2Y2 -2.
00:22:02.200 --> 00:22:11.000
That is -2Y2² -2Y2².
00:22:11.000 --> 00:22:29.600
That was all just solving the inside integral, I need to integrate that from Y2 = 0 to Y2 = 1.
00:22:29.600 --> 00:22:36.800
This is all integrating DY2.
00:22:36.800 --> 00:22:41.300
I think I screwed up a negative sign in there.
00:22:41.300 --> 00:22:45.400
It is not -2, it is +2.
00:22:45.400 --> 00:22:51.700
That +2, when I multiply it by Y2, I made a couple of mistakes in there.
00:22:51.700 --> 00:22:59.300
That is 2Y2 - 2Y2², I think that is correct now.
00:22:59.300 --> 00:23:06.500
Let me go ahead and integrate that from Y2 = 0 to Y2 = 1.
00:23:06.500 --> 00:23:10.100
That looks like I’m spacing out on that line right there.
00:23:10.100 --> 00:23:12.400
I think I got it right now.
00:23:12.400 --> 00:23:19.800
I want to integrate that, the integral of 2Y2 is Y2².
00:23:19.800 --> 00:23:30.200
The integral of 2Y2² is -2/3 Y2³.
00:23:30.200 --> 00:23:37.600
I need to evaluate this from Y2 = 0 to Y2 = 1.
00:23:37.600 --> 00:23:47.700
If I plug in Y2 = 1, I will get 1 -2/3, plug in Y2 = 0, I just get nothing.
00:23:47.700 --> 00:23:54.000
I get 1 -2/3 is 1/3, that is my expected value for Y2.
00:23:54.000 --> 00:24:01.500
I should have boxed in my answer for expected value of Y1, because that was my first answer up there.
00:24:01.500 --> 00:24:06.200
I had a couple of hitches along the way there, but I think it worked out okay.
00:24:06.200 --> 00:24:12.500
I still need to find the expected value of Y1 Y2.
00:24:12.500 --> 00:24:30.500
Again, that is that same double integral Y2 = 0 to Y2 = 1 and Y1 = Y2 -1 to Y1 = 1 - Y2.
00:24:30.500 --> 00:24:43.100
Where is my function, it is Y1 × Y2 × the density function which is just 1 of DY1 DY2.
00:24:43.100 --> 00:24:49.600
If that is getting a little cut off there, then I will just say that that last symbol was DY2.
00:24:49.600 --> 00:24:53.000
In case, you have trouble reading that.
00:24:53.000 --> 00:25:00.500
This is not as bad as it seems, because the function that I’m integrating Y1 Y2,
00:25:00.500 --> 00:25:05.800
it is going to be positive on the right hand triangle and negative on the left hand triangle.
00:25:05.800 --> 00:25:20.700
They are exactly evenly balanced, is symmetric on this triangle.
00:25:20.700 --> 00:25:28.300
That means that whole integral will come out to 0, by symmetry.
00:25:28.300 --> 00:25:34.000
That is because, I had a function that is positive on the right hand part and negative on the left part.
00:25:34.000 --> 00:25:37.800
If that feels a little suspicious to you, go ahead and do the integral.
00:25:37.800 --> 00:25:42.300
It will be a little messy, it is likely the most fun integral in the world but it is possible.
00:25:42.300 --> 00:25:47.200
It is just tedious algebra, there is really nothing too dangerous in there.
00:25:47.200 --> 00:25:50.400
You can do the integral and you should get 0, at the end.
00:25:50.400 --> 00:25:55.300
It should agree with what I got by symmetry.
00:25:55.300 --> 00:26:05.200
That completes that problem, we will be using the same setup and the same values for example 2.
00:26:05.200 --> 00:26:08.600
I want to make sure that you understand everything we did here,
00:26:08.600 --> 00:26:14.500
because I’m going to take these answers and I’m going to use them for example 2.
00:26:14.500 --> 00:26:17.600
Just to make sure that you are very comfortable with all this stuff,
00:26:17.600 --> 00:26:22.800
before we move on and use these answers in example 2, let me recap the steps here.
00:26:22.800 --> 00:26:25.700
I wanted to look at this triangle.
00:26:25.700 --> 00:26:32.000
First of all, I graphed this triangle based on those 3 corner points that were given to me.
00:26:32.000 --> 00:26:36.800
I set up this triangle and colored in the region here.
00:26:36.800 --> 00:26:45.800
I know that I’m going to be doing a double integral, I was trying to describe the limits of this triangle.
00:26:45.800 --> 00:26:52.500
If I list Y2 first then I can do it just by doing one double integral.
00:26:52.500 --> 00:26:56.100
If I list Y1 first, then I have to chop this thing into two.
00:26:56.100 --> 00:26:59.300
That is why I listed Y2 first going from 0 to 1.
00:26:59.300 --> 00:27:04.500
And then, I had to describe Y1 in terms of these two lines.
00:27:04.500 --> 00:27:12.100
The way I got those two lines was, I found the equations of these two diagonal lines on the sides of the triangles.
00:27:12.100 --> 00:27:14.800
Then, I solve each one for Y1.
00:27:14.800 --> 00:27:19.600
That is where those limits right there came from, in terms of Y1.
00:27:19.600 --> 00:27:24.500
That let me set up my limits of integration on each of my three integrals.
00:27:24.500 --> 00:27:35.100
Those sets of limits, I use the same sets of limits on each one of those integrals.
00:27:35.100 --> 00:27:38.500
Each one of those integrals, I integrated something different.
00:27:38.500 --> 00:27:44.100
They all had this 1 in them, and that 1 came from this one right here, the density functions.
00:27:44.100 --> 00:27:48.800
That 1 manifested itself there, there, and there.
00:27:48.800 --> 00:27:52.400
I had the 1, then each one I was integrating something different because
00:27:52.400 --> 00:27:55.800
I was trying to find the expected value of something different.
00:27:55.800 --> 00:27:58.500
Expected value of Y1, integrate Y1.
00:27:58.500 --> 00:28:01.700
Expected value of Y2, integrate Y2.
00:28:01.700 --> 00:28:07.300
Expected value of Y1 Y2, integrate Y1 Y2.
00:28:07.300 --> 00:28:14.000
I know I have set up three integrals and two of them, I notice that the function I’m integrating is symmetric,
00:28:14.000 --> 00:28:21.200
in the sense that Y1 is going to be positive over here and negative over on this region.
00:28:21.200 --> 00:28:26.900
It exactly bounces each other out, I know that I’m going to get 0, if I do that integral.
00:28:26.900 --> 00:28:29.800
If you do not believe that, just do the integral, it would not be that hard.
00:28:29.800 --> 00:28:31.500
It should work out to be 0.
00:28:31.500 --> 00:28:39.900
Same thing over here, Y1 Y2 is positive in the positive region, negative in the second quadrant.
00:28:39.900 --> 00:28:42.600
It is going to give me 0, by symmetry.
00:28:42.600 --> 00:28:44.800
That is where I got these two 0’s from.
00:28:44.800 --> 00:28:49.100
If you do not like it, just do the integrals and you can work them out yourself.
00:28:49.100 --> 00:28:54.500
The expected value of Y2, Y2 is positive on both of those triangles.
00:28:54.500 --> 00:28:58.100
I cannot use symmetry, I actually have to do the integral.
00:28:58.100 --> 00:29:01.600
I integrated with respect to Y1, I got Y2 Y1.
00:29:01.600 --> 00:29:05.900
Plugged in my limits, I got an integral in terms of Y2.
00:29:05.900 --> 00:29:12.000
Integrated that, plug in my limits and got the expected value of Y2 to be 1/3.
00:29:12.000 --> 00:29:18.500
Hang onto these 3 answers, we are using it again right away in example 2.
00:29:18.500 --> 00:29:21.900
In example 2, we have the same setup from example 1.
00:29:21.900 --> 00:29:24.600
Let me go ahead and draw out that setup.
00:29:24.600 --> 00:29:33.600
It was this triangle with corners at -1,0 and 0,1 and 1,0.
00:29:33.600 --> 00:29:42.100
Let me draw that triangle, it is the same thing we had in example 1 and the same density function.
00:29:42.100 --> 00:29:48.800
A joint density function is always equal to 1 over that region.
00:29:48.800 --> 00:29:55.400
What we want to do here is, we want to calculate the covariance of Y1 of Y2.
00:29:55.400 --> 00:29:59.200
After that, we are going to ask whether Y1 and Y2 are independent.
00:29:59.200 --> 00:30:04.300
I’m going to use that formula that I gave you for covariance of Y1 and Y2.
00:30:04.300 --> 00:30:13.600
Not the original definition which I think is not very useful, is often cumbersome if you use the original definition of covariance.
00:30:13.600 --> 00:30:15.600
We have this great formula for covariance.
00:30:15.600 --> 00:30:31.500
What covariance of Y1 and Y2, is equal to the expected value of Y1 × Y2 - the expected value of Y1 × the expected value of Y2.
00:30:31.500 --> 00:30:36.400
You cannot necessarily separate the variables, it is not necessarily true that
00:30:36.400 --> 00:30:44.800
the expected value of Y1 × Y2 is equal to the expected value of Y1 × the expected value of Y2.
00:30:44.800 --> 00:30:47.900
The reason this formula is useful for us right now is,
00:30:47.900 --> 00:30:56.000
we already figured out each one of these quantities in example 1.
00:30:56.000 --> 00:31:02.500
The work here, it was quite a bit of work was done here in example 1.
00:31:02.500 --> 00:31:09.300
If you did not just watch example 1, if example 1 is not totally fresh in your mind, just go back and watch it right now.
00:31:09.300 --> 00:31:14.500
You will see where we work out all of these quantities individually.
00:31:14.500 --> 00:31:18.300
The expected value of Y1 × Y2 was 0.
00:31:18.300 --> 00:31:21.200
The expected value of Y1 was also 0.
00:31:21.200 --> 00:31:24.600
The expected value of Y2 was 1/3.
00:31:24.600 --> 00:31:26.600
That is what we did in example 1.
00:31:26.600 --> 00:31:30.300
This all simplifies down to be 0 here.
00:31:30.300 --> 00:31:35.900
That is our answer for the covariance, the covariance is 0.
00:31:35.900 --> 00:31:42.600
If Y1 and Y2 are independent, this is a very subtle issue here because you see that
00:31:42.600 --> 00:31:49.200
the covariance being 0 and you might think of independence, that is the converse of our theorem.
00:31:49.200 --> 00:31:55.000
Our theorem says that, if they are independent then the covariance is 0.
00:31:55.000 --> 00:31:57.900
It does not work the other way around.
00:31:57.900 --> 00:32:01.300
We cannot say necessarily that they are independent yet.
00:32:01.300 --> 00:32:14.100
In fact, I want to remind you of a theorem that we had back in another lecture on independent variables.
00:32:14.100 --> 00:32:22.200
From the lecture on independent variables, that was several lectures ago.
00:32:22.200 --> 00:32:24.900
You can go back and check this out, if you do not remember it.
00:32:24.900 --> 00:32:44.500
We have a theorem that the region must be a rectangle.
00:32:44.500 --> 00:32:55.300
And then, there was another condition that the joint density function must factor into two functions.
00:32:55.300 --> 00:33:01.600
One just of Y1 and one just of Y2.
00:33:01.600 --> 00:33:09.000
If both of those conditions were satisfied then the variables are independent, that was if and only if.
00:33:09.000 --> 00:33:12.900
In this case, we do not have a rectangle.
00:33:12.900 --> 00:33:24.100
This is not a rectangle, it is a triangle.
00:33:24.100 --> 00:33:38.400
That theorem tells us that Y1 and Y2 are not independent.
00:33:38.400 --> 00:33:49.200
That should kind of agree with your intuition, if you look at the region, if I tell you for example that Y1 is 0.
00:33:49.200 --> 00:33:51.000
Let me put some variables on here.
00:33:51.000 --> 00:33:56.100
This is Y1 on the horizontal axis and this is Y2 on the vertical axis.
00:33:56.100 --> 00:34:13.000
If I tell you that Y1 is 0 that means we are on this vertical axis, then Y2 could be anything from 0 to 1.
00:34:13.000 --> 00:34:24.500
If I tell you that Y1 is ½ then Y2 cannot be anything from 0 to 1, it could be only as big as ½.
00:34:24.500 --> 00:34:30.800
By changing the values of Y1, I’m changing the possible range of Y2,
00:34:30.800 --> 00:34:36.800
which suggests that knowing something about Y1 would give me new information about Y2.
00:34:36.800 --> 00:34:45.800
That is the intuition for dependents, for variables not being independent.
00:34:45.800 --> 00:34:51.900
You should suspect, by looking at that region, that the variables are not independent.
00:34:51.900 --> 00:34:57.300
This theorem from that old lecture confirms it.
00:34:57.300 --> 00:35:01.600
Just to recap here, we are asked to find the covariance.
00:35:01.600 --> 00:35:05.600
I'm using the formula that I gave you for covariance.
00:35:05.600 --> 00:35:11.000
I think it is on the first or second slide of this lecture, just scroll back and you will see it,
00:35:11.000 --> 00:35:13.100
the definition and formulas for covariance.
00:35:13.100 --> 00:35:16.700
It expands out into these three expected values.
00:35:16.700 --> 00:35:19.400
We calculated all these in example 1.
00:35:19.400 --> 00:35:25.200
I just grabbed the old values from example 1 and simplify down, just got 0,
00:35:25.200 --> 00:35:33.300
which might make you think independent because we had this theorem that if they are independent, then the covariance is 0.
00:35:33.300 --> 00:35:36.700
The converse of that theorem is not true.
00:35:36.700 --> 00:35:40.700
This is kind of the classical example of that.
00:35:40.700 --> 00:35:56.900
Variables can have a covariance equal to 0 and not be independent.
00:35:56.900 --> 00:36:01.000
This is really what this example is showing, not be independent.
00:36:01.000 --> 00:36:08.400
It is true that if their independent then the covariance is 0, but they can have covariance 0 and in this case,
00:36:08.400 --> 00:36:15.800
since the region is not a rectangle, they are not independent.
00:36:15.800 --> 00:36:19.500
In example 3, we have independent random variables.
00:36:19.500 --> 00:36:22.600
We have been given their means and their variances.
00:36:22.600 --> 00:36:30.500
We are given a couple of linear functions U1 is Y1 + Y2 and U2 is Y1 - Y2.
00:36:30.500 --> 00:36:34.800
We want to calculate the variance of U1 and U2.
00:36:34.800 --> 00:36:36.800
Let me show you how those work out.
00:36:36.800 --> 00:36:52.300
The variance of U1, U1 is, by definition is Y1 + 2Y2.
00:36:52.300 --> 00:37:01.500
I'm going to use the theorem that we had on linear functions of random variables.
00:37:01.500 --> 00:37:08.800
This was on the introductory slides, you can go back and just read back about that theorem,
00:37:08.800 --> 00:37:12.400
about linear functions of random variables.
00:37:12.400 --> 00:37:18.400
What that told me is that, a linear combination of random variables distributes out
00:37:18.400 --> 00:37:26.800
but you write the coefficients 1² × σ 1², the variance of Y1.
00:37:26.800 --> 00:37:36.900
Let me write that as the variance of Y1, 1² × the variance of Y1 + 2² × the variance of Y2.
00:37:36.900 --> 00:37:41.400
And then, there is this other term which is kind of obnoxious but we have to deal with it.
00:37:41.400 --> 00:38:01.600
It is 2 × the coefficient 1 × 2 × the variance of Y1 with the covariance of Y1 with Y2.
00:38:01.600 --> 00:38:10.200
That is by the theorem from the beginning of this.
00:38:10.200 --> 00:38:16.500
I think the title is linear functions of random variables.
00:38:16.500 --> 00:38:18.800
That was the theorem that we had.
00:38:18.800 --> 00:38:26.400
Let me plug in, 1² is just 1, the variance of Y1 we are given is 4 + 2² is 4.
00:38:26.400 --> 00:38:33.600
The variance of Y2 was given to be 9 + 4.
00:38:33.600 --> 00:38:40.100
The covariance of Y1 × Y2, what we are given is that Y1 and Y2 are independent.
00:38:40.100 --> 00:38:43.900
If they are independent, then the covariance is 0.
00:38:43.900 --> 00:38:46.600
Remember, in example 2, we learned the converse is not true.
00:38:46.600 --> 00:38:51.400
But, it is true that if they are independent then the covariance is 0.
00:38:51.400 --> 00:39:00.800
That right there is by independence and by the theorem that we learned earlier on in this lecture.
00:39:00.800 --> 00:39:09.200
We just simplify, 4 + 4 × 9 is 4 + 36 which is 40.
00:39:09.200 --> 00:39:20.400
That is the variance of U1, the variance of U2 is, by definition U2 is Y1 - Y2.
00:39:20.400 --> 00:39:24.700
I will just do the same thing, I’m going to expand it out using that theorem.
00:39:24.700 --> 00:39:35.500
We got 1Y1, 1² × the variance of Y1 + -1² × the variance of Y2, I’m using that theorem,
00:39:35.500 --> 00:39:38.000
you have to square the coefficients.
00:39:38.000 --> 00:39:49.700
+ 2 × 1 × -1, those are the coefficients × the covariance of Y1 with Y2 and 1.
00:39:49.700 --> 00:40:03.200
We just get 1 × the variance of Y1 which were given is 4 +, because -1² gives us a positive then Y2 is 9.
00:40:03.200 --> 00:40:08.300
Again, the covariance of Y1 Y2, by independence is 0.
00:40:08.300 --> 00:40:15.800
This just simplifies down to 13 is the variance of U2, and we are done.
00:40:15.800 --> 00:40:20.100
To recap the steps there, the variance of U1, expand that out.
00:40:20.100 --> 00:40:25.200
U1 was defined to be Y1 + 2Y2.
00:40:25.200 --> 00:40:28.400
We had this theorem on linear functions of random variables.
00:40:28.400 --> 00:40:34.700
Go back and check it out, it told us how to find the variance of a linear combination.
00:40:34.700 --> 00:40:39.200
You kind of expand out the variances, you have to square the coefficients.
00:40:39.200 --> 00:40:48.200
That 1² comes from the sort of a hidden 1 right there, and that 2² comes from there.
00:40:48.200 --> 00:40:51.400
This 2 comes from the theorem.
00:40:51.400 --> 00:40:56.500
This 1 and this 2 come from the coefficients, there and there.
00:40:56.500 --> 00:41:04.200
This covariance comes from the theorem as well.
00:41:04.200 --> 00:41:10.900
We are given that Y1 and Y2 are independent, independence tells us that their covariance is equal to 0.
00:41:10.900 --> 00:41:16.300
That was a theorem that we also had earlier on in this lecture.
00:41:16.300 --> 00:41:21.000
The variance of Y1 is 4, that came from here.
00:41:21.000 --> 00:41:26.000
The variance of Y2 is 9, that came from the stem of the problem here.
00:41:26.000 --> 00:41:33.000
We drop those in, simplify down, and we get 4 + 4 × 9 is 40.
00:41:33.000 --> 00:41:37.900
The variance of U2 works exactly the same way, except that there are coefficients now.
00:41:37.900 --> 00:41:41.300
Instead of being 1 and 2, are 1 and -1.
00:41:41.300 --> 00:41:44.900
The covariance drops out because they are independent.
00:41:44.900 --> 00:41:52.100
We get 4 and 9, remember the -1 squares because you always square the coefficients with variance.
00:41:52.100 --> 00:41:57.300
That makes a positive and 4 + 9 is 13.
00:41:57.300 --> 00:42:04.900
By the way, we are going to use these values again, in example 4.
00:42:04.900 --> 00:42:10.800
Make sure you understand these values very well, before you move on to example 4.
00:42:10.800 --> 00:42:13.700
We will need them again.
00:42:13.700 --> 00:42:20.500
Example 4, we are going to carry on with the same sets of data that we had from examples 3.
00:42:20.500 --> 00:42:26.800
Y1 Y2 are independent variables, we have been given their means and their variances.
00:42:26.800 --> 00:42:31.500
We are going to let U1 and U2 be these linear combinations.
00:42:31.500 --> 00:42:36.700
I want to find the covariance of U1 and U2.
00:42:36.700 --> 00:42:41.000
And then, I'm also going to find this ρ here, is the correlation coefficient.
00:42:41.000 --> 00:42:44.800
We learn about that, at the beginning of this lecture.
00:42:44.800 --> 00:42:49.100
Let me expand out the covariance of U1 and U2.
00:42:49.100 --> 00:43:04.600
U1 and U2 is the covariance of Y1 + 2Y2 and Y1 - Y2, that is just the definition of U1 and U2.
00:43:04.600 --> 00:43:10.200
And then, there was a theorem that we had to back at the beginning of this lecture
00:43:10.200 --> 00:43:18.300
on how you can expand covariances of combinations of a random variables.
00:43:18.300 --> 00:43:24.600
It says, it expands out linearly so it kind of expands out.
00:43:24.600 --> 00:43:28.000
You can almost think of foil, first outer, inner last.
00:43:28.000 --> 00:43:49.600
It is the covariance of Y1 with Y1 - the covariance of Y1 with Y2 + 2 × the covariance of Y2 with Y1.
00:43:49.600 --> 00:44:00.400
I’m just expanding it out, first outer and inner last, -2 × the covariance of Y2 with Y2.
00:44:00.400 --> 00:44:04.700
It is just expanding out each term with each term.
00:44:04.700 --> 00:44:06.700
We are going to use a couple other facts here.
00:44:06.700 --> 00:44:13.000
Remember that, the covariance on Y1 with itself is just the variance of Y1.
00:44:13.000 --> 00:44:20.400
That was something we learned on the very first slide of this lecture,
00:44:20.400 --> 00:44:22.900
it was the one where we introduced covariance.
00:44:22.900 --> 00:44:27.200
I gave you, first the definition of covariance and a couple useful formulas.
00:44:27.200 --> 00:44:32.100
One useful formula was the covariance of a variable itself is just the variance.
00:44:32.100 --> 00:44:39.300
We also have theorem that said, if Y1 Y2 are independent and they are given to be independent here,
00:44:39.300 --> 00:44:41.100
then the covariance is 0.
00:44:41.100 --> 00:44:48.800
This is 0 by independence.
00:44:48.800 --> 00:44:53.300
This covariance is also 0, by independence.
00:44:53.300 --> 00:45:03.200
Covariance of Y2 with itself is the variance of Y2, that same formula that we had on the first slide.
00:45:03.200 --> 00:45:08.600
This is the variance of Y1 -2 × the variance of Y2.
00:45:08.600 --> 00:45:16.900
Where is the variance of Y1, there it is, it is 4 -2 × the variance of Y2 is 9.
00:45:16.900 --> 00:45:25.900
That is 4 -18 which is -14, that is our covariance.
00:45:25.900 --> 00:45:28.800
We also have to find the correlation coefficient.
00:45:28.800 --> 00:45:34.500
Let me remind you that the correlation coefficient, how that is defined.
00:45:34.500 --> 00:45:50.500
The correlation coefficient, ρ of U1 U2, by definition is the covariance of U1 with U2
00:45:50.500 --> 00:45:57.900
divided by the standard deviation of U1 and the standard deviation of U2.
00:45:57.900 --> 00:46:04.200
I’m going to use σ for the standard deviation of U1 × the standard deviation of U2.
00:46:04.200 --> 00:46:08.900
That σ is the σ for U1, it is not the σ for Y1.
00:46:08.900 --> 00:46:16.600
It is not the σ 1 right here, that σ U2 is not the σ 2 there.
00:46:16.600 --> 00:46:21.100
That was a mistake that I accidentally made, when I was making a rough draft of these notes.
00:46:21.100 --> 00:46:24.900
Do not make the same mistake I did.
00:46:24.900 --> 00:46:30.300
The covariance of U1 U2 is –14, we just figure that out.
00:46:30.300 --> 00:46:41.100
The standard deviation of U1, I’m going to invoke what I figured out on the previous example.
00:46:41.100 --> 00:46:50.300
The standard deviation of U1 is just the square root of the variance of U1, and the same for U2,
00:46:50.300 --> 00:46:51.400
the square root of the variance.
00:46:51.400 --> 00:46:57.300
The standard deviation is always the square root of the variance, that is the definition.
00:46:57.300 --> 00:47:06.500
I figured out the variance of U1 and U2, in the previous example, in examples 3.
00:47:06.500 --> 00:47:11.200
I’m trying to look up those values right there.
00:47:11.200 --> 00:47:19.300
We work this out in examples 3.
00:47:19.300 --> 00:47:21.600
We solved -14 in the numerator.
00:47:21.600 --> 00:47:28.500
In example 3, we figure out that the variance of U1 was 40, we have √ 40.
00:47:28.500 --> 00:47:36.000
The variance of U2 was 13, that is what we figured out in example 3.
00:47:36.000 --> 00:47:40.200
If you did not just watched example 3 and you think those numbers appeared magically,
00:47:40.200 --> 00:47:44.500
go back and watch example 3, and you will see where they came from.
00:47:44.500 --> 00:47:54.200
This does not get much better, this is -14, √ 40 we can pullout a 4, make that 2 √ 10.
00:47:54.200 --> 00:48:05.700
√ 13 in the denominator and that turns into, if we cancel 2, we get -7/10 × 13 is 130.
00:48:05.700 --> 00:48:12.200
Not a particularly nice number, I could not find figure out a way rake up these numbers to behave nicely.
00:48:12.200 --> 00:48:21.900
I did throw this into a calculator and what did I get there, when I plugged in a calculator.
00:48:21.900 --> 00:48:31.300
This was 0 × 0.614, actually that was an approximation and it is negative.
00:48:31.300 --> 00:48:37.400
That is what I got when I plug that number into a calculator, nothing very revealing there.
00:48:37.400 --> 00:48:43.200
Let me mention that one thing we knew about the correlation coefficient,
00:48:43.200 --> 00:48:48.800
I gave you this way back on the third slide of this lecture.
00:48:48.800 --> 00:48:59.800
When I talked about correlation coefficient is that, the whole point of correlation coefficient is its scale independent.
00:48:59.800 --> 00:49:09.500
It is always between -1 and 1, and this is between -1 and 1 because it is -0.6.
00:49:09.500 --> 00:49:14.700
That is slightly reassuring, if it had been outside of that range then
00:49:14.700 --> 00:49:17.800
I would have known that I have made a mistake, somewhere through here.
00:49:17.800 --> 00:49:22.100
The fact that I got a number in between -1 and 1, does not guarantee that right
00:49:22.100 --> 00:49:26.400
but it makes me feel a little more confident in my work here.
00:49:26.400 --> 00:49:30.200
We got answers for both of those, let me show you how I got those.
00:49:30.200 --> 00:49:41.700
The covariance of U1 and U2, I expanded out the definition of U1 and U2 which is Y1 + 2Y2 and Y1 -Y2.
00:49:41.700 --> 00:49:46.700
We had this theorem on one of the introductory slides to this lecture which said,
00:49:46.700 --> 00:49:51.200
how you can expand out covariances of linear combinations.
00:49:51.200 --> 00:49:56.100
It is very well behaved, it just expands out the same way you would multiply together binomial.
00:49:56.100 --> 00:49:59.300
You can think of foiling things together.
00:49:59.300 --> 00:50:08.300
We did the first Y1 and Y1, the outer Y1 and Y2, subtracted because of the coefficient there.
00:50:08.300 --> 00:50:13.500
Let me write out foil here, if you remember your high school algebra, first outer, inner last.
00:50:13.500 --> 00:50:23.400
The inner term is 2Y2 × Y1, the covariance of it and the last term is -2Y2 Y2.
00:50:23.400 --> 00:50:29.700
These mixed terms, the Y1 and Y2, remember they were given that the variables are independent.
00:50:29.700 --> 00:50:33.300
Independent variables have covariance 0.
00:50:33.300 --> 00:50:39.300
That is not true in the other direction, just because they have covariance 0, does not mean they are independent.
00:50:39.300 --> 00:50:45.400
If they are independent, then the covariance is definitely 0, which is great, those two terms dropout.
00:50:45.400 --> 00:50:52.100
The other thing we learned by an early formula, when I first taught you about covariance
00:50:52.100 --> 00:51:00.900
is that the covariance of Y1 with itself is just the variance of Y1 and same thing for Y2.
00:51:00.900 --> 00:51:04.300
I can just drop in my value for the variance, there it is right there.
00:51:04.300 --> 00:51:14.200
The variance of Y1 is 4, variance of Y2 is 9, and drop those in and simplifies down to -14.
00:51:14.200 --> 00:51:23.200
The correlation coefficient ρ, by definition, is the covariance of those two variables divided by their standard deviations.
00:51:23.200 --> 00:51:26.400
I just figure out the covariance, that is the -14.
00:51:26.400 --> 00:51:32.700
The standard deviations are always the square root of their variances, that is the definition of standard deviation.
00:51:32.700 --> 00:51:36.300
Take their variance and take the square root.
00:51:36.300 --> 00:51:43.500
The variance of U1 and U2, that is what I calculated back in example 3.
00:51:43.500 --> 00:51:49.300
Just go back and watch example 3, you will see where these numbers 40 and 13 are coming from.
00:51:49.300 --> 00:51:57.700
It is not these numbers right here, the σ 1² and σ 2² because those were the variances for Y1 and Y2.
00:51:57.700 --> 00:52:02.600
Here, we want the variances of U1 and U2.
00:52:02.600 --> 00:52:09.400
Once, I got those numbers in there, I reduce the square roots a little bit, but it did not end up being a very nice number.
00:52:09.400 --> 00:52:14.800
The reassuring thing was that when I found the decimal, it was between -1 and 1,
00:52:14.800 --> 00:52:21.300
which is the range that a correlation coefficient should always landed.
00:52:21.300 --> 00:52:27.800
Last example here, we got independent variables but they all have the same mean and the same variance.
00:52:27.800 --> 00:52:31.900
We want to find the mean and the variance of the average of those variables.
00:52:31.900 --> 00:52:38.400
The average just means, you add them up and divide by the number of variables you have.
00:52:38.400 --> 00:52:42.200
It is 1/N Y1 up to 1/N YN.
00:52:42.200 --> 00:52:49.600
I wrote it that way to really suggest that, that is a linear combination of the original random variables.
00:52:49.600 --> 00:53:02.900
This is a linear function and we can use our theorem on how you calculate means and variances of linear combinations.
00:53:02.900 --> 00:53:04.700
That is what I'm going to use.
00:53:04.700 --> 00:53:08.100
The expected value is the same as the mean.
00:53:08.100 --> 00:53:15.300
Remember, the expected value of Y bar, the mean and variance of the average.
00:53:15.300 --> 00:53:28.600
The expected value of Y bar is just the expected value of 1/N Y1 up to 1/N YN.
00:53:28.600 --> 00:53:37.100
I can distribute by linearity of expectation, that was a theorem that we had.
00:53:37.100 --> 00:53:50.900
I can distribute and pull out those coefficients 1/N × E of Y1 up to 1/N × E of YN.
00:53:50.900 --> 00:53:56.500
That is 1/N × μ up to 1/N × μ.
00:53:56.500 --> 00:53:59.200
They all have the same mean μ.
00:53:59.200 --> 00:54:09.100
If you add up N copies of 1/N × μ, you just get a single copy of μ.
00:54:09.100 --> 00:54:12.500
That is my expected value of the average.
00:54:12.500 --> 00:54:24.900
The variance of the average, variance of Y bar, again is the variance of 1/N Y1 + up to 1/N YN.
00:54:24.900 --> 00:54:30.500
Variance is not linear, expectation is linear.
00:54:30.500 --> 00:54:37.400
There is a nastier theorem that tells you what to do with variance.
00:54:37.400 --> 00:54:40.300
I gave you that theorem in one of the introductory slides.
00:54:40.300 --> 00:54:44.400
I said linear functions of random variables.
00:54:44.400 --> 00:54:50.000
The way this works is, you pull out the coefficients but you square them.
00:54:50.000 --> 00:55:00.100
1/N² × the variance of Y1 up to 1/N² × the variance of YN.
00:55:00.100 --> 00:55:09.800
There is the cross terms, there is this cross term which is 2 × the sum as i is bigger than j
00:55:09.800 --> 00:55:21.300
of the coefficients 1/N × 1/N × the covariance of YI with YJ.
00:55:21.300 --> 00:55:31.000
That looks pretty dangerous there but, let us remember that we are given that we have independent variables.
00:55:31.000 --> 00:55:42.000
Any Y and J, if you take their covariance, since they are independent, this covariance will be 0, by independence.
00:55:42.000 --> 00:55:50.300
That is a really nice, that means I can just focus on the first few terms here, 1/N²
00:55:50.300 --> 00:56:00.200
the variance of Y1 is σ² + up to 1/N² × σ².
00:56:00.200 --> 00:56:07.900
Let me write that a little more clearly, that is 1/N² in the denominator there.
00:56:07.900 --> 00:56:14.600
What I have is N terms here of 1N² × σ².
00:56:14.600 --> 00:56:19.600
That simplifies down to σ²/N.
00:56:19.600 --> 00:56:25.000
By the way, this is a very fundamental result in statistics.
00:56:25.000 --> 00:56:30.100
This is something that you use very often, as you get into statistics.
00:56:30.100 --> 00:56:35.500
The variance of the mean is equal to σ² divided by N.
00:56:35.500 --> 00:56:42.500
This is where it comes from, this is where the magic starts to happen is right here with this example.
00:56:42.500 --> 00:56:45.200
Let me make sure that you understand every step here.
00:56:45.200 --> 00:56:48.600
We want to find the expected value of Y bar.
00:56:48.600 --> 00:56:55.500
Remember that, Y bar the average is just can be written as a linear combination of these variables.
00:56:55.500 --> 00:56:59.100
Expectation is linear, that is what we learned in that theorem.
00:56:59.100 --> 00:57:06.400
You can just separate it out into the expected values of Y1 up to YN, then just pull out the constants.
00:57:06.400 --> 00:57:16.900
And then, each one of those E of Yi is μ because we are given that in the problem right there.
00:57:16.900 --> 00:57:20.800
We are adding up N copies of 1/N × μ.
00:57:20.800 --> 00:57:23.500
At the end, we just get a whole μ.
00:57:23.500 --> 00:57:30.400
The variance is a little bit messier, the variance of a linear combination.
00:57:30.400 --> 00:57:36.900
Again, you can split up into all the separate variances but when you pull it out, pull out the coefficients, it get².
00:57:36.900 --> 00:57:41.900
That is why we get 1/N² on each of these coefficients.
00:57:41.900 --> 00:57:47.500
There is this cross term, 2 × the sum of the coefficients.
00:57:47.500 --> 00:57:51.500
That is a little messy there but that is 1/N × 1/N.
00:57:51.500 --> 00:58:00.100
That is coming from these coefficients right here, the covariance of Yi × Yj.
00:58:00.100 --> 00:58:08.200
The fortunate thing is that, we have a theorem that says when two variables are independent, their covariance is 0.
00:58:08.200 --> 00:58:13.400
Converse of that is not true, it could be covariance is 0 without independence.
00:58:13.400 --> 00:58:16.700
But if they are independent, their covariance is definitely 0.
00:58:16.700 --> 00:58:19.700
We are given that they are independent here.
00:58:19.700 --> 00:58:27.300
All those cross terms dropout and we are just left with N copies of 1/N².
00:58:27.300 --> 00:58:32.500
We are given that the variance of each individual variable σ².
00:58:32.500 --> 00:58:38.300
N × 1/N² is just 1/N, we still have that σ².
00:58:38.300 --> 00:58:41.900
The variance of the mean is σ²/N.
00:58:41.900 --> 00:58:45.300
Essentially, this means if you take the average of many things,
00:58:45.300 --> 00:58:50.700
it is not going to vary as much as individual members of the population will,
00:58:50.700 --> 00:58:56.800
because the variance shrinks down, as you take a larger and larger sample.
00:58:56.800 --> 00:59:01.700
That is a very classic result in statistics, now you know where it comes from.
00:59:01.700 --> 00:59:05.700
Now, you know where this classic formula comes from.
00:59:05.700 --> 00:59:14.500
That wraps up our lecture, a kind of a big one today on correlation and covariance, and linear functions of random variables.
00:59:14.500 --> 00:59:22.200
This is all part of the chapter on Bivariate distribution functions and Bivariate density functions.
00:59:22.200 --> 00:59:28.500
In fact, this wraps up our chapter on Bivariate density functions and distribution functions.
00:59:28.500 --> 00:59:33.000
We will come back later and talk about distributions of random variables.
00:59:33.000 --> 00:59:34.800
We still have one more chapter to go.
00:59:34.800 --> 00:59:41.300
In the meantime, it is nice to finish our chapter on Bivariate density and distribution functions.
00:59:41.300 --> 00:59:46.300
This is all part of the probability lecture series here on www.educator.com.
00:59:46.300 --> 00:59:50.000
I'm your host and guide, my name is Will Murray, thank you for joining me today, bye now.