**Covariance** and **Correlation** are two mathematical concepts which are commonly used in the field of probability and statistics. Both concepts describe the relationship between two variables.

**Covariance –**

- It is the relationship between a pair of random variables where change in one variable causes change in another variable.
- It can take any value between -infinity to +infinity, where the negative value represents the negative relationship whereas a positive value represents the positive relationship.
- It is used for the linear relationship between variables.
- It gives the direction of relationship between variables.

**Formula –**

**For Population:**

**For Sample**

Here,

x’ and y’ = mean of given sample set

n = total no of sample

xi and yi = individual sample of set

**Example –**

**Correlation –**

- It show whether and how strongly pairs of variables are related to each other.
- Correlation takes values between -1 to +1, wherein values close to +1 represents strong positive correlation and values close to -1 represents strong negative correlation.
- In this variable are indirectly related to each other.
- It gives the direction and strength of relationship between variables.

**Formula –**

Here,

x’ and y’ = mean of given sample set

n = total no of sample

xi and yi = individual sample of set

**Example –**

**Covariance versus Correlation –**

Covariance | Correlation |
---|---|

Covariance is a measure of how much two random variables vary together | Correlation is a statistical measure that indicates how strongly two variables are related. |

involve the relationship between two variables or data sets | involve the relationship between multiple variables as well |

Lie between -infinity and +infinity | Lie between -1 and +1 |

Measure of correlation | Scaled version of covariance |

provide direction of relationship | provide direction and strength of relationship |

dependent on scale of variable | independent on scale of variable |

have dimensions | dimensionless |

Attention reader! Don’t stop learning now. Get hold of all the important CS Theory concepts for SDE interviews with the CS Theory Course at a student-friendly price and become industry ready.

## Recommended Posts:

- Mathematics | Predicates and Quantifiers | Set 1
- Mathematics | Mean, Variance and Standard Deviation
- Mathematics | Sum of squares of even and odd natural numbers
- Mathematics | Eigen Values and Eigen Vectors
- Mathematics | Introduction and types of Relations
- Mathematics | Representations of Matrices and Graphs in Relations
- Mathematics | Predicates and Quantifiers | Set 2
- Mathematics | Closure of Relations and Equivalence Relations
- Mathematics | Partial Orders and Lattices
- Mathematics | Graph Isomorphisms and Connectivity
- Mathematics | Planar Graphs and Graph Coloring
- Mathematics | Euler and Hamiltonian Paths
- Mathematics | PnC and Binomial Coefficients
- Mathematics | Limits, Continuity and Differentiability
- Mathematics | Walks, Trails, Paths, Cycles and Circuits in Graph
- Mathematics | Power Set and its Properties
- Mathematics | Unimodal functions and Bimodal functions
- Mathematics | Sequence, Series and Summations
- Mathematics | Independent Sets, Covering and Matching
- Mathematics | Rings, Integral domains and Fields

If you like GeeksforGeeks and would like to contribute, you can also write an article using contribute.geeksforgeeks.org or mail your article to contribute@geeksforgeeks.org. See your article appearing on the GeeksforGeeks main page and help other Geeks.

Please Improve this article if you find anything incorrect by clicking on the "Improve Article" button below.