- Trending Categories
- Data Structure
- Networking
- RDBMS
- Operating System
- Java
- iOS
- HTML
- CSS
- Android
- Python
- C Programming
- C++
- C#
- MongoDB
- MySQL
- Javascript
- PHP

- Selected Reading
- UPSC IAS Exams Notes
- Developer's Best Practices
- Questions and Answers
- Effective Resume Writing
- HR Interview Questions
- Computer Glossary
- Who is Who

# What is the relationship between correlation and covariance?

In simple words, both *correlation* and *covariance* show the relationship and the dependency between two variables.

Covariance shows the direction of the path of the linear relationship between the variables while a function is applied to them.

Correlation on the contrary measures both the power and direction of the linear relationship between two variables.

In simple terms, correlation is a function of the covariance. The fact that differentiates the two is that covariance values are not standardized while correlation values are. The correlation coefficient of two variables can be obtained by dividing the covariance values of these variables by the multiplication of the standard deviations of the given values.

Covariance is a quantitative calculation that shows the extent to which the deviation function of one variable from its mean matches the deviation of the other function from its mean. It is a mathematical relationship that is defined as −

$$\mathrm{Cov(X,Y) = E[(X − E[X])(Y − E[Y])]}$$

In the given equation above,

If X and Y are both valued above their respective means, or if X and Y are both valued below their respective means, the expression inside the outer expectation will be positive.

The term becomes negative if one value of the variables is above its mean and the other is below.

The two random variables will have a positive correlation if this expression is positive on average. The equation can be rewritten as −

$$\mathrm{Cov(X,Y) = E[XY] − E[Y]E[X]}$$

Using this equation and using the fact that the product of two independent random variables is equal to the multiplication of the expectations, it is easily seen that *if two random variables are independent, their covariance is 0*.

The reverse is not always true in general − *if the covariance value of two random variables is 0, they are not always independent!*

So, we can write −

$$\mathrm{Cov(X,Y) = Cov(Y, X)}$$

$$\mathrm{Cov(X, X) = E[X 2 ] − E[X]E[X] = Var(X)}$$

$$\mathrm{Cov(aX + b,Y) = aCov(X,Y)}$$

Correlation between two random variables, given by ρ(X, Y) is the covariance of the two variables that is normalized by the variance of each variable. This normalization removes the units and normalizes the measure so that it is always in the range [0, 1] −

$$\mathrm{ρ(X, Y) = Cov(X, Y)\sqrt{Var(X) Var(Y)}}$$

When ρ(X, Y) = 0, If two variables are independent from each other, then their correlation will be 0.

- Related Questions & Answers
- Difference between Covariance and Correlation
- How is Covariance and Correlation used in Portfolio Theory?
- What is the relationship between Cookies and Cybersecurity?
- What is the Relationship Between Data Privacy And Cybersecurity
- What is the relationship between CAPM and the Cost of Equity?
- What is the relationship between process states and the machine cycle?
- What is the relationship between JavaScript, CoffeeScript, TypeScript, ES5, and ES6?
- What's the relationship between Selenium RC and WebDriver?
- What is Correlation in Signals and Systems?
- What is the relationship between Address and Memory Space in a Virtual Memory System?
- What is meant by correlation?
- What is Entity-Relationship Modeling?
- Explain the relationship between Finite Automata and Regular Expression.
- Explain the relationship between grammar and language in TOC
- What is Is-a relationship in Java?