Covariance
1. Covariance
Covariance measures how two random variables vary together. For example, height and weight of giraffes have positive covariance because when one is large, the other tends to be large too.
a) Definition
For random variables and with means and , the covariance is:
b) Key Properties of Covariance
| Property | Formula | Explanation |
|---|---|---|
| Linearity in each argument | Scaling and shifting constants affect covariance by the product of scale factors | |
| Additivity in first argument | Covariance distributes over sums | |
| Variance as covariance | Variance is covariance of a variable with itself | |
| Alternative formula | Useful for computation | |
| Variance of sum | Expresses variance of sum in terms of covariance | |
| Independence implies zero covariance | If and independent, then | But zero covariance does not imply independence |
Zero covariance means no linear relationship, but variables can still be dependent in other ways.
c) Computing Covariance: Sums and Integrals
- Discrete case: For joint pmf ,
- Continuous case: For joint pdf over ,
d) Example (Summary)
- Flip a fair coin 3 times.
- Define = number of heads in first 2 flips, = number of heads in last 2 flips.
- Compute using joint pmf and properties.
- Marginal means: .
- Use definition or properties to find covariance.
To remember: Covariance quantifies joint variability; zero covariance means no linear association but not necessarily independence. Use the formula for calculations.
Properties and Computation of Covariance
1. Computation of Covariance
-
Covariance definition:
-
Example calculation:
Given joint probabilities,
-
Using expectation of product:
Then,
2. Covariance via Properties of Covariance
-
If and , where are independent tosses, then:
-
Independence implies zero covariance for distinct tosses:
-
Only non-zero term is variance of :
3. Important Example: Zero Covariance Does Not Imply Independence
- Let take values each with probability , and define .
| Y \ X | -2 | -1 | 0 | 1 | 2 | Marginal |
|---|---|---|---|---|---|---|
| 0 | 0 | 0 | 1/5 | 0 | 0 | 1/5 |
| 1 | 0 | 1/5 | 0 | 1/5 | 0 | 2/5 |
| 4 | 1/5 | 0 | 0 | 0 | 1/5 | 2/5 |
| Marginal | 1/5 | 1/5 | 1/5 | 1/5 | 1/5 | 1 |
-
Means:
-
Not independent:
For example,
-
Covariance calculation:
4. Key Takeaways
| Concept | Result / Formula | Notes |
|---|---|---|
| Covariance | Measures linear relationship between and | |
| Covariance of sums | Use linearity and independence properties | |
| Independence implies zero covariance | If and independent, then | Converse is false (zero covariance ≠ independence) |
| Zero covariance ≠ independence | Example: with symmetric | Covariance misses nonlinear dependence |
Covariance measures only linear dependence; zero covariance does not guarantee independence.
Correlation
Correlation standardizes covariance to a dimensionless measure, allowing comparison regardless of units.
Definition:
The correlation coefficient between random variables and is
where and are the standard deviations of and .
1. Properties of correlation
-
is the covariance of the standardized variables:
-
Range:
-
Interpretation:
- means perfect positive linear relationship
- means perfect negative linear relationship
- means no linear relationship (but variables may still be dependent)
-
Scale invariance:
Correlation does not change if or are scaled or shifted by constants.
To remember: Correlation is the normalized covariance, measuring linear association independent of units.
Properties of Correlation and Bivariate Normal Distributions
Properties of Correlation
-
The correlation coefficient between two variables and is defined as the covariance normalized by the product of their standard deviations:
-
Key properties of :
-
is dimensionless (a pure ratio).
-
It satisfies the bounds:
-
if and only if with (perfect positive linear relationship).
-
if and only if with (perfect negative linear relationship).
-
-
Interpretation:
- Positive correlation: large values of tend to correspond to large values of .
- Negative correlation: large values of tend to correspond to small values of .
- Correlation measures linear relationships only; it can miss nonlinear dependencies.
Examples of Correlation Calculation
| Example | Given | Computation | Result | Interpretation |
|---|---|---|---|---|
| 1 | , | Moderate positive correlation due to shared toss in and | ||
| 2 | , , , known | Negative correlation | Weak negative linear relationship |
1. Bivariate Normal Distributions
-
The joint density of a bivariate normal with means , standard deviations , and correlation is:
-
Marginals: and are individually normal with parameters and respectively.
-
The correlation between and is exactly .
-
Geometric interpretation:
- Data points tend to cluster around the line .
- When , points lie almost perfectly on a line.
- Positive → points concentrate in 1st and 3rd quadrants relative to means.
- Negative → points concentrate in 2nd and 4th quadrants.
To remember: The correlation coefficient quantifies the strength and direction of a linear relationship between two variables, bounded between -1 and 1, with indicating perfect linear dependence.
2. Visualizing Correlation in Bivariate Normal Samples
- Scatter plots of simulated bivariate normal data with varying show:
- For , points are scattered without linear pattern.
- For , points cluster along an increasing line.
- For , points cluster along a decreasing line.
- As approaches 1, points align more tightly along a straight line.
3. Summary Table: Correlation Properties
| Property | Description |
|---|---|
| Range | |
| Dimension | Dimensionless (ratio) |
| Perfect positive linear relationship (, ) | |
| Perfect negative linear relationship (, ) | |
| Interpretation | Measures linear association only |
| Marginals in bivariate normal | , |
| Correlation in bivariate normal | Exactly |
4. Note on Limitations
- Correlation can fail to detect nonlinear relationships.
- Example: variables related by a quadratic or other nonlinear function may have zero correlation despite strong dependence.
Proofs of Covariance and Correlation Properties
1. Proofs of Covariance Properties
-
Covariance linearity and expectation properties imply:
- (symmetry)
- for constants
-
Variance as covariance with itself:
-
Covariance expressed via expectation:
-
Variance of sum:
-
Covariance of independent variables:
If and are independent, then
2. Proof of Correlation Bounds
-
Define correlation coefficient .
-
Using variance positivity:
-
Similarly,
-
Conclusion: Correlation coefficient satisfies
-
If , then