Covariance Vs Correlation

Article byWallstreetmojo Team
Edited bySheeba M
Reviewed byDheeraj Vaidya, CFA, FRM

Difference Between Covariance Vs Correlation

Covariance Vs Correlation gives us the differences between the two statistical concepts used to determine the relationship between two random variables and that are exactly opposite to each other. However, they both are used in statistics and regression analysis. Covariance shows us how the two variables vary or differ from each other, whereas Correlation shows us the relationship and how they are related, i.e., how modification of one variable impacts the other.

For example, let us express these concepts mathematically for two random variables, A and B, with mean values as Ua and Ub and standard deviation as Sa and Sb, respectively.

Effectively we can define the relationship between the two:

Both Correlations and Covariance find application in statistical and financial analysis fields. Since Correlation standardizes the connection, it is helpful in the comparison of any two variables. In addition, it helps analysts develop strategies like pair trade and hedging for efficient returns on the portfolio and safeguarding these returns in terms of adverse movements in the stock market.

We will consider some real-time values to understand the differences or the relation between them with specific examples.

Key Takeaways

What Is Covariance?

Covariance measures how the two variables move concerning each other and is an extension of the concept of variance (which tells about how a single variable varies). It can take any value from -∞ to +∞.

  • The higher this value, the more dependent the relationship is. A positive number signifies positive Covariance, that means that an increase or variation will correspondingly increase in the other variable, provided other conditions remain constant.
  • A negative number signifies negative Covariance, which denotes an opposite relationship between the two variables. Though Covariance is perfect for defining the type of relationship, it is not good for interpreting its magnitude.
Covariance vs Correlation

You are free to use this image on your website, templates, etc, Please provide us with an attribution linkHow to Provide Attribution?Article Link to be Hyperlinked
For eg:
Source: Covariance Vs Correlation (wallstreetmojo.com)

–>> If you want to learn Excel and VBA professionally, then ​Excel VBA All in One Courses Bundle​ (35+ hours) is the perfect solution. Whether you’re a beginner or an experienced user, this bundle covers it all – from Basic Excel to Advanced Excel, Macros, Power Query, and VBA.

Covariance Formula And Example

Let us understand the covariance formula to calculate and assess the movements of variables. The formula is,

where,

  • RAi =Return of stock A in the ith interval
  • RBi =Return of stock B in the ith interval
  • RA=Mean of the return of stock A
  • RB=Mean of the return of stock B
  • n = Sample size or the number of intervals

The covariance calculation between stock A and stock B can also be obtained by multiplying the standard deviation of returns of stock A, the standard deviation of returns of stock B, and the correlation between stock A’s and stock B’s returns.

Mathematically, it represents as,

Cov (RA, RB) = ρ(A, B) * ơA * ơB

where,

  • ρ(A, B) = Correlation between returns of stock A and stock B
  • ơA = Standard deviation of returns of stock A
  • ơB = Standard deviation of returns of stock B.

Let us consider an example to understand the Covariance.

Consider the data given below of stock A and stock B with the following daily returns for three days.

We will determine the covariance between stock A and stock B.

Given, RA1 = 1.2%, RA2 = 0.5%, RA3 = 1.0%

RB1= 1.7%, RB2 = 0.6%, RB3 = 1.3%

Therefore, the calculation will be as follows,

Now, mean return of stock A, RA= (RA1 + RA2 + RA3 ) / n

  • RA= (1.2% + 0.5% + 1.0%) / 3
  • RA0.9%

Next, Mean Return of Stock B, RB= (RB1 +RB2+ RB3 ) / n

  • RB= (1.7% + 0.6% + 1.3%) / 3
  • RB1.2%

Therefore, one can calculate the covariance between stock A and stock B as:

Covariance between Stock A and Stock B will be –

=((B2-C5)*(C2-C6)+(B3-C5)*(C3-C6)+(B4-C5)*(C4-C6))/(COUNT(A2:A4)-1)

= [(1.2 – 0.9) * (1.7 – 1.2) + (0.5 – 0.9) * (0.6 – 1.2) + (1.0 – 0.9) * (1.3 – 1.2)] / (3 -1)

0.200

  • Therefore, the Cov(RA, RB) 0.200

Therefore, the covariance between stock A and stock B is 0.200, as shown above, which is positive. As such, both returns move in the same direction, i.e., either with positive or negative returns.

What Is The Correlation?

Correlation is a step ahead of Covariance as it quantifies the relationship between two random variables. In simple terms, it is a unit measure of how these variables change concerning each other (normalized Covariance value).

  • The Correlation has an upper and lower cap on a range, unlike Covariance. It can only take values between +1 and -1. A Correlation of +1 indicates that random variables have a direct and strong relationship.
  • On the other hand, the Correlation of -1 indicates a strong inverse relationship, and an increase in one variable will lead to an equal and opposite decrease in the other variable. 0 means that the two numbers are independent.

Correlation Formula And Example

If we have two variables, x, and y, then the correlation coefficient between 2 variables can be found as:

Correlation Coefficient = ∑(x(i)- mean(x))*(y(i)-mean(y)) / √ (∑(x(i)-mean(x))2 * ∑(y(i)-mean(y))2)

where,

  • x(i)= value of x in the sample
  • Mean(x) = mean of all values of x
  • y(i) = value of y in the sample
  • Mean(y) = mean of all values of y

Let us consider an example to understand the Correlation.

Below are the values of x and y, with all the necessary details.

The calculation is as follows.

Basis Excel formula = CORREL (array(x), array(y))

Therefore, the Coefficient = +0.95

Since this coefficient is near +1, x and y are highly positively correlated.

Correlation Vs Covariance Infographics

Let us see the top differences between Correlation and Covariance.

Covariance vs Correlation Infographics

You are free to use this image on your website, templates, etc, Please provide us with an attribution linkHow to Provide Attribution?Article Link to be Hyperlinked
For eg:
Source: Covariance Vs Correlation (wallstreetmojo.com)

Correlation Vs Covariance Key Differences

Covariance Vs Correlation Comparative Table

BasisCovarianceCorrelation
MeaningCovariance indicates how two random variables are dependent on each other. A higher number denotes higher dependency.Correlation indicates how strongly these two variables are related, provided other conditions are constant. The maximum value is +1, representing a perfect dependent relationship.
RelationshipWe can deduct Correlation from a Covariance.Correlation provides a measure of Covariance on a standard scale. It is deduced by dividing the calculated Covariance by the standard deviation.
ValuesThe value of Covariance lies in the range of -∞ and +∞.Correlation is limited to values between the range -1 and +1.
ScalabilityCovariance is affected.Correlation is not affected by a change in scales or multiplication by a constant.
UnitsCovariance has a definite unit as deduced by the multiplication of two numbers and their units.Correlation is a unitless absolute number between -1 and +1, including decimal values.

Recommended Articles

This article is a guide to Covariance vs Correlation. Here we learn relation & difference between Covariance & Correlation, examples & downloadable templates. You may also have a look at the following articles: –

Reader Interactions

Comments

  1. Mike Geddes says

    Great article where information is presented in a simple, accurate, and concise manner.

Leave a Reply

Your email address will not be published. Required fields are marked *