Covariance | Definition, Formula, Correlation, & Properties (2024)

statistics

verifiedCite

While every effort has been made to follow citation style rules, there may be some discrepancies.Please refer to the appropriate style manual or other sources if you have any questions.

Select Citation Style

Feedback

Thank you for your feedback

Our editors will review what you’ve submitted and determine whether to revise the article.

Print

verifiedCite

While every effort has been made to follow citation style rules, there may be some discrepancies.Please refer to the appropriate style manual or other sources if you have any questions.

Select Citation Style

Feedback

Thank you for your feedback

Our editors will review what you’ve submitted and determine whether to revise the article.

Written by

Michael McDonough Michael McDonough was a media team intern at Encyclopaedia Britannica. He is expected to graduate in 2023 from Northwestern University.

Michael McDonough

Fact-checked by

The Editors of Encyclopaedia Britannica Encyclopaedia Britannica's editors oversee subject areas in which they have extensive knowledge, whether from years of experience gained by working on that content or via study for an advanced degree. They write new content and verify and edit content received from contributors.

The Editors of Encyclopaedia Britannica

Last Updated: Article History

Related Topics:
Pearson’s correlation coefficient
distribution function
Spearman rank correlation coefficient

See all related content →

covariance, measure of the relationship between two random variables on the basis of their joint variability. Covariance primarily indicates the direction of a relationship and can be calculated by finding the expected value of the product of each variable’s deviations from its mean. Although its properties make covariance useful in calculating other statistical values, covariance is outclassed by measures such as correlation that show more precise information about the relationship between two variables. Despite its shortcomings, covariance still has applications in finance and science.

Covariance measures the joint variability of two random variables—that is, how much variables change together. This attribute is used to determine the direction of a relationship between two variables. However, the nature of the association does not come from the covariance’s magnitude but from its sign. If the covariance is positive, then the association between the two variables X and Y is positive, and greater values of X tend to occur along with greater values of Y. Conversely, if the covariance is negative, then the association between the two variables is negative, and they have an inverse relationship in which greater values of X tend to correspond with smaller values of Y. When the covariance is zero, the magnitude of a covariance is expressed in terms of the variables’ units and has no upper or lower bound, which limits its use as an indicator of the strength of the relationship between two variables.

If two variables have a nonzero covariance, they are considered to be dependent, wherein one variable has an effect on the other variable’s probability distribution. However, much care must be taken when using covariance to draw conclusions about independence. Although two independent variables always have a covariance of zero, the converse does not hold true. Simply because the covariance of two variables is equal to zero does not mean that they are independent of each other.

The covariance between two variables X and Y, Cov(X, Y), can be calculated by taking the expected value, or mean, E of the product of two values: the deviation of X from its mean μX and the deviation of Y from its mean μY. That is, Cov(X, Y) = E[(X − μX)(Y − μY)].The covariance can be also expressed as the expected value of the variables’ product minus the product of each variable’s expected value: Cov(X, Y) = E(XY) − E(X)E(Y).

Covariance is intrinsically related to correlation, another measure of the relationship between two variables. The correlation coefficient r, also known as Pearson’s r, is defined in terms of the covariance. Correlation is a normalized version of covariance and falls within the range of −1 and 1. The correlation coefficient is generally a better measure of the relationship between two variables. Not only does Pearson’s r use its sign to convey the direction of an association, but its magnitude also indicates the strength of the relationship between two variables, with 1 showing a perfect correlation between the two variables and −1 showing a perfect anticorrelation. Correlation does not depend on the variables’ units of measurement, which often makes it a more useful measure of association than covariance, whose magnitude is expressed in the product of the variables’ units. (For example, if one measured children’s ages in years and height in centimetres, the covariance would have the unusual and uninformative units of centimetre-years.)

While covariance may not be the most effective tool for conveying information about relationships between two variables, its properties allow it to be used to calculate other important statistical measures. The variance Var of a single variable can be expressed through the covariance between the variable and itself:Cov(X, X) = Var(X).Covariance can be also used to calculate the variance of a combination of two variables:Var(X + Y) = Var(X) + Var(Y) + 2Cov(X, Y).The previous property is a result of the covariance of linear combinations, which can be generally expressed as the following, where V, W, X, and Y are random variables and a, b, c, and d are constants:Cov(aX + bY, cW + dV) = acCov(X, W) + adCov(X, V) + bcCov(Y, W) + bdCov(Y, V).The correlation coefficient r even includes covariance in its numerator: r = Cov(X, Y)/Square root ofVar(X)Var(Y).

Special 67% offer for students! Finish the semester strong with Britannica.

Learn More

The applications of covariance extend outside pure mathematics. In finance, covariance is used to help diversify security holdings by determining whether stocks are closely related. Covariance matrices can also be used in principal component analysis, which is used to simplify the complexity of datasets. Covariance is also used in a variety of scientific fields. For example, in the Price equation, which describes evolutionary change, the covariance between a trait and fitness is used to define the action of selection.

Michael McDonough

Covariance | Definition, Formula, Correlation, & Properties (2024)

FAQs

Covariance | Definition, Formula, Correlation, & Properties? ›

Intuitively, the covariance between X and Y indicates how the values of X and Y move relative to each other. If large values of X tend to happen with large values of Y, then (X−EX)(Y−EY) is positive on average. In this case, the covariance is positive and we say X and Y are positively correlated.

What are the properties of correlation and covariance? ›

Covariance is an indicator of the extent to which 2 random variables are dependent on each other. A higher number denotes higher dependency. Correlation is a statistical measure that indicates how strongly two variables are related.

What is the formula for correlation and covariance? ›

Similarly, covariance is frequently “de-scaled,” yielding the correlation between two random variables: Corr(X,Y) = Cov[X,Y] / ( StdDev(X) ∙ StdDev(Y) ) . The correlation between two random variables will always lie between -1 and 1, and is a measure of the strength of the linear relationship between the two variables.

What is the formula for covariance properties? ›

The variance Var of a single variable can be expressed through the covariance between the variable and itself:Cov(X, X) = Var(X). Covariance can be also used to calculate the variance of a combination of two variables:Var(X + Y) = Var(X) + Var(Y) + 2Cov(X, Y).

How do you calculate covariance? ›

Covariance is calculated by analyzing at-return surprises (standard deviations from the expected return) or multiplying the correlation between the two random variables by the standard deviation of each variable.

What are the properties of correlation? ›

Such properties of correlation include: It ranges from -1 to 1. Its sign (positive, negative, or zero) matches the sign of the slope of the line of best fit, corresponding to the type of correlation (positive, negative, or neutral). The further from zero it is, the stronger the correlation is.

What is correlation and covariance for dummies? ›

Covariance and correlation show that variables can have a positive relationship, a negative relationship, or no relationship at all. With covariance and correlation, there are three cases that may arise: If two variables increase or decrease at the same time, the covariance and correlation between them is positive.

Why use covariance instead of correlation? ›

Covariance indicates the direction of the linear relationship between variables while correlation measures both the strength and direction of the linear relationship between two variables. Correlation is a function of the covariance.

What is the other formula for covariance? ›

The covariance between X and Y is defined as Cov(X,Y)=E[(X−EX)(Y−EY)]=E[XY]−(EX)(EY). Note that E[(X−EX)(Y−EY)]=E[XY−X(EY)−(EX)Y+(EX)(EY)]=E[XY]−(EX)(EY)−(EX)(EY)+(EX)(EY)=E[XY]−(EX)(EY).

What is the formula to calculate correlation? ›

Pearson Correlation Coefficient Formula:

where cov is the covariance and (cov(X,Y)= ∑Ni=1(Xi−¯X)(Yi−¯Y)N ∑ i = 1 N ( X i − X ¯ ) ( Y i − Y ¯ ) N , σX is standard deviation of X and σY is standard deviation of Y. Given X and Y are two random variables.

What is the rule of covariance? ›

Covariance in probability theory and statistics is a measure of the joint variability of two random variables. The sign of the covariance of two random variables X and Y. The sign of the covariance, therefore, shows the tendency in the linear relationship between the variables.

What is the shortcut to calculate covariance? ›

Theorem 29.2 (Shortcut Formula for Covariance) The covariance can also be computed as: Cov[X,Y]=E[XY]−E[X]E[Y].

How do you calculate covariance quickly? ›

To calculate covariance, you can use the formula:Cov(X, Y) = Σ(Xi-µ)(Yj-v) / nWhere the parts of the equation are: Cov(X, Y) represents the covariance of variables X and Y. Σ represents the sum of other parts of the formula.

How to do covariance by hand? ›

How to calculate sample covariance
  1. Gather the data from both samples. ...
  2. Calculate the mean for both the X and Y samples. ...
  3. Find the difference between each mean value. ...
  4. Multiply the difference for X and the difference for Y and perform the summation. ...
  5. Subtract one from the number of data points.
Jun 24, 2022

What is covariance in simple terms? ›

Covariance is a measure of the relationship between two random variables and to what extent, they change together. Or we can say, in other words, it defines the changes between the two variables, such that change in one variable is equal to change in another variable.

What's the difference between covariance and correlation? ›

Both covariance and correlation measure the relationship and the dependency between two variables. Covariance indicates the direction of the linear relationship between variables. Correlation measures both the strength and direction of the linear relationship between two variables. Correlation values are standardized.

What is the property of variance and covariance? ›

Theorem 30.1 (Properties of Covariance) Let X,Y,Z X , Y , Z be random variables, and let c be a constant. Then: Covariance-Variance Relationship: Var[X]=Cov[X,X] Var [ X ] = Cov [ X , X ] (This was also Theorem 29.1.) Constants cannot covary: Cov[X,c]=0 Cov [ X , c ] = 0 .

What is the difference between covariance and correlation quizlet? ›

Covariance tests to see whether there is a linear relationship between two variables and whether this is positive or negative. Correlation extends this idea by testing the linear relationship between two variables for their STANDARDISED DATA (z score) and looking at how strong this relationship is.

Top Articles
Latest Posts
Article information

Author: Lidia Grady

Last Updated:

Views: 5435

Rating: 4.4 / 5 (65 voted)

Reviews: 88% of readers found this page helpful

Author information

Name: Lidia Grady

Birthday: 1992-01-22

Address: Suite 493 356 Dale Fall, New Wanda, RI 52485

Phone: +29914464387516

Job: Customer Engineer

Hobby: Cryptography, Writing, Dowsing, Stand-up comedy, Calligraphy, Web surfing, Ghost hunting

Introduction: My name is Lidia Grady, I am a thankful, fine, glamorous, lucky, lively, pleasant, shiny person who loves writing and wants to share my knowledge and understanding with you.