Books Probability and Statistical Inference
The Correlation Coefficient
Putting in (4.1), we obtain a special mathematical expectation:
This is called the covariancecovariance, discrete bivariate distribution of and .
The correlation coefficientcorrelation coefficient, discrete bivariate distribution of and is defined as
By playing with (4.2) and (4.3), we can obtain some simple facts about the correlation coefficient:
- .
- . An interpretation of this is that the expected value of the product of and is roughly βthe product of the often assumed values of and plus a term that is proportional to the correlation coefficient .
Let and have a trinomial distribution with parameters , , and . Show that
and consequently,
We first prove this via brute force calculation and we will provide another more interesting and neater proof later.
Proof
By definition and the formula of the trinomial PMF,
Recall that and . We have
It then follows that
and
We now give the alternative proof alluded to above, trading lengthy manipulation of the trinomial PMF for a more structural point of view. The central moveβexpressing each count as a sum of i.i.d. Bernoulli (indicator) random variables, one for each of the independent trialsβmakes the calculation of a matter of bookkeeping over independent trials; the same random variable as a sum of pieces device is a standard and widely reusable first step in many problems.
Proof
Consider independent draws with replacement from an urn with three colors , , and , with probabilities , , and on each draw. For , let indicate whether the -th draw is , and let indicate whether the -th draw is . Then and , and the trials are mutually independent (for a given , of course, ).
The trinomial counts are
Thus
Split the double sum according to whether or :
The second sum is zero, because if then (the -th draw cannot be both and ). Hence
Whenever , the indicators and refer to different trials, so they are independent. Taking expectations,
And yet we will have another derivation of the covariance of trinomial distribution when we introduce the conditional distributions later in Example 4.4.
Consider the -dimensional space of the joint support of random variables and and a line, with finite slope , passing through the point . (If we sample the points randomly following the joint distribution and depict a scatter plot, then we will see that is roughly the centroid of this cluster.) The equation of such a line is . Randomly sample a point , the vertical distance between the point and the line is given by . We are now interested in the expected value of the square of this distance, i.e.,
As (4.4), this expectation can be regarded as a function of . The problem now is to find the value of that minimizes . Rearranging the terms and applying the linearity of expectations, we have
Differentiating,
Setting to zero, we solve for to get
Therefore, the equation of the optimal line is
Evaluated at , , or the minimum value of the expected value of the square of the vertical distance, is
We can gain a lot of insights from (4.5). First, since the expected value of a square is always non-negative, we clearly have , which yields
That is, the value of correlation coefficient is bounded by .
When , that is, is strongly correlated with either in the positive or negative direction, we get , which means that all the sampled points will lie on the line .
When , we have . The same quantity is , the mean squared error from predicting by the constant without using . Intuitively, pushing each sample onto the -axis discards , yet nothing is gained by retaining it in mean squared error; that is the geometric echo of and being uncorrelated.
Suppose that and are independent. Then they must be uncorrelated, i.e., or . Indeed, we have
The condition of independence is applied when we write . However, the converse is not true. That is, if two random variables are uncorrelated, they are not, in general, independent.
In fact, it was not necessary to parametrize the line as passing through in order to minimize the expected squared vertical error. Exercise 4.4 instead uses the general form and optimizes over and ; the same best line is obtained, and it still passes through .
Let and have the joint PMF
Figure 4.2 shows this joint PMF. From the plot, we can easily find that , and
Therefore, , which meas that and are uncorrelated. But clearly they are not independent since their support is not rectangular.
Exercises
Let and be random variables with respective means and , respective variances and and correlation coefficient . Fit the line by the method of least squares to the probability distribution by minimizing the expectation
with respect to and .
Solution
Expand the expression inside the expectation,
Differentiate with respect to and ,
Setting to zero, we get the system of equations
We solve by multiplying the first equation by and then subtract it from the second equation:
Then plugging back into the first equation, we get
Therefore, the line of the best fit is
Note that it indeed passes through the point .