WEBVTT
00:00:00.640 --> 00:00:04.260
In this segment, we discuss a
few algebraic properties of
00:00:04.260 --> 00:00:05.770
the covariance.
00:00:05.770 --> 00:00:08.710
There is nothing deep here, only
some observations that
00:00:08.710 --> 00:00:12.060
can be useful if we want
to carry out covariance
00:00:12.060 --> 00:00:13.520
calculations.
00:00:13.520 --> 00:00:16.040
We start by looking at this
quantity, the covariance of a
00:00:16.040 --> 00:00:17.940
random variable with itself.
00:00:17.940 --> 00:00:21.150
So it's a special case of this
definition but where Y is the
00:00:21.150 --> 00:00:25.090
same as X. And therefore, this
second term here is the same
00:00:25.090 --> 00:00:26.350
as the first term.
00:00:26.350 --> 00:00:30.620
And so what we're left with is
the expected value of the
00:00:30.620 --> 00:00:35.150
square deviation of the random
variable from its mean.
00:00:35.150 --> 00:00:39.130
And we recognize that this is
the same as the variance of X.
00:00:39.130 --> 00:00:41.410
So we conclude that the
covariance of a random
00:00:41.410 --> 00:00:44.780
variable with itself is the
same as the variance.
00:00:44.780 --> 00:00:48.560
Now, for the variance, we had an
alternative formula, which
00:00:48.560 --> 00:00:51.980
was often convenient in
simplifying variance
00:00:51.980 --> 00:00:53.370
calculations.
00:00:53.370 --> 00:00:58.260
Is there a similar formula for
the case of the covariance?
00:00:58.260 --> 00:01:01.860
Let us start from the definition
and use linearity.
00:01:01.860 --> 00:01:05.730
We have a product here of two
terms, and we expand that
00:01:05.730 --> 00:01:08.800
product to obtain four
different terms.
00:01:08.800 --> 00:01:11.850
The expected value of the sum
of these four terms is going
00:01:11.850 --> 00:01:14.770
to be the sum of their
expectations.
00:01:14.770 --> 00:01:17.520
So let us go through
the steps involved.
00:01:17.520 --> 00:01:20.780
We have the expected value
of the product of this
00:01:20.780 --> 00:01:22.260
term with that term.
00:01:22.260 --> 00:01:26.180
Gives us expected value of X
times Y. Then we take the
00:01:26.180 --> 00:01:30.520
expected value of the product
of this term with that term.
00:01:30.520 --> 00:01:33.930
And because we have a minus
sign, we put it out here.
00:01:33.930 --> 00:01:38.479
And we have the expected value
of X times the expected value
00:01:38.479 --> 00:01:41.770
of Y inside the expectation.
00:01:41.770 --> 00:01:46.530
The next term is going to be the
product of this expected
00:01:46.530 --> 00:01:53.610
value with Y. And that gives us
minus the expected value of
00:01:53.610 --> 00:02:00.320
X times Y. And finally, the last
term comes by multiplying
00:02:00.320 --> 00:02:02.870
this quantity with
that quantity.
00:02:07.110 --> 00:02:10.940
And this is what we have by
applying linearity to the
00:02:10.940 --> 00:02:13.630
definition of the covariance.
00:02:13.630 --> 00:02:16.350
Now, remember that the expected
value of a random
00:02:16.350 --> 00:02:19.090
variable is a number,
it's a constant.
00:02:19.090 --> 00:02:22.870
And constants can be pulled
outside expectations.
00:02:22.870 --> 00:02:28.520
So if we do that, what we
obtain is the following.
00:02:28.520 --> 00:02:31.310
We pull this constant outside
the expectation, and we're
00:02:31.310 --> 00:02:34.405
left with the expected value of
X times the expected value
00:02:34.405 --> 00:02:39.770
of Y. Similarly, for the next
term, by pulling a constant
00:02:39.770 --> 00:02:44.000
outside the expectation, we
obtain this expression.
00:02:44.000 --> 00:02:46.900
And finally, for the last term,
we have the expected
00:02:46.900 --> 00:02:49.900
value of a constant, and
this is the same as
00:02:49.900 --> 00:02:52.460
the constant itself.
00:02:52.460 --> 00:02:54.930
We recognize here that
the same term gets
00:02:54.930 --> 00:02:56.640
repeated three times.
00:02:56.640 --> 00:03:00.120
And because here we have a minus
sign, we can cancel this
00:03:00.120 --> 00:03:02.000
term with that term.
00:03:02.000 --> 00:03:05.670
And what we're left with is just
the difference of these
00:03:05.670 --> 00:03:08.620
two terms, and this is an
alternative form for the
00:03:08.620 --> 00:03:10.900
covariance of two random
variables.
00:03:10.900 --> 00:03:15.630
And this form is often easier
to work with to calculate
00:03:15.630 --> 00:03:18.105
covariances compared with
the original definition.
00:03:21.160 --> 00:03:23.630
Let us now continue with some
additional algebraic
00:03:23.630 --> 00:03:25.070
properties.
00:03:25.070 --> 00:03:28.550
Suppose that we know the
covariance of X with Y, and
00:03:28.550 --> 00:03:31.570
we're interested in the
covariance of this linear
00:03:31.570 --> 00:03:36.490
function of X with Y. What is
the covariance going to be?
00:03:36.490 --> 00:03:40.340
To simplify the calculations,
let us just assume zero means.
00:03:42.890 --> 00:03:48.710
Although, the final conclusion
will be the same as in the
00:03:48.710 --> 00:03:51.230
case of non-zero means.
00:03:51.230 --> 00:03:55.340
So in the case of zero means,
the covariance of two random
00:03:55.340 --> 00:03:59.000
variables is just the same as
the expected value of the
00:03:59.000 --> 00:04:01.550
product of the two
random variables.
00:04:05.370 --> 00:04:11.770
And using linearity, this is the
expected value times a of
00:04:11.770 --> 00:04:19.300
X times Y plus b times the
expected value of Y. Now, we
00:04:19.300 --> 00:04:22.800
assumed zero means, so
this term goes away.
00:04:22.800 --> 00:04:29.790
And what we're left with is a
times the covariance of X with
00:04:29.790 --> 00:04:35.280
Y. So we see that multiplying
X by a increases the
00:04:35.280 --> 00:04:37.600
covariance by a factor of a.
00:04:37.600 --> 00:04:40.530
But adding a constant
has no effect.
00:04:40.530 --> 00:04:43.120
The reason that it has no effect
is that if we take a
00:04:43.120 --> 00:04:46.030
random variable and add the
constant to it, the same
00:04:46.030 --> 00:04:48.270
constant gets added
to its mean.
00:04:48.270 --> 00:04:50.385
And so this difference
is not affected.
00:04:54.250 --> 00:04:57.830
As our final calculation, let us
look at the covariance of a
00:04:57.830 --> 00:05:02.370
random variable with the sum of
two other random variables.
00:05:02.370 --> 00:05:04.690
Again, we assume zero means.
00:05:04.690 --> 00:05:08.860
And so the calculation
is as follows.
00:05:08.860 --> 00:05:11.130
The covariance is the
product of the two
00:05:11.130 --> 00:05:13.390
random variables involved.
00:05:13.390 --> 00:05:17.030
And then we use linearity of
expectations to write this as
00:05:17.030 --> 00:05:22.270
the expected value of X times Y
plus the expected value of X
00:05:22.270 --> 00:05:23.790
times Z.
00:05:23.790 --> 00:05:27.320
And we recognize that this is
the same as the covariance of
00:05:27.320 --> 00:05:37.380
X with Y plus the covariance
of X with Z. So in this
00:05:37.380 --> 00:05:40.800
respect, covariances
behave linearly.
00:05:40.800 --> 00:05:44.490
They behave linearly with
respect to one of the
00:05:44.490 --> 00:05:45.740
arguments involved.