📘 Covariance and Correlation
🔹 Covariance
- Covariance measures how two variables move together.
- If both variables increase or decrease together, the covariance is positive.
- If one increases while the other decreases, the covariance is negative.
- Covariance does not tell us the strength of the relationship.
- It has no fixed range and is affected by the units of measurement.
Formula: Cov(X, Y) = Σ[(x − x̄)(y − ȳ)] / n
🔸 Correlation
- Correlation is a standardized measure of the relationship between two variables.
- It ranges between -1 and +1.
- +1: Perfect positive linear relationship
- -1: Perfect negative linear relationship
- 0: No linear relationship
- Correlation is not affected by units, unlike covariance.
- Correlation indicates both the direction and strength of a linear relationship.
Formula: r = Cov(X, Y) / (σx × Ïƒy)
📌 Key Differences
- Covariance shows the direction of a relationship; correlation shows both direction and strength.
- Covariance values are unbounded; correlation values are always between -1 and +1.
- Correlation is easier to interpret in most cases.
⚠️ Note
Correlation does not imply causation. Two variables might move together due to coincidence or a third factor.
📘 Covariance & Correlation (with Visuals)
🔸 Positive Correlation
🔸 Negative Correlation
🔸 Zero Correlation
Note: Covariance shows direction (positive/negative) like correlation, but not the strength.