# Difference between Covariance and Correlation

Covariance is the mutual relationship between two variables regarding their variance. In statistics, the covariance formula is generally used to assess the relationship between the variables. It is essentially a measure of the variance according to a relationship between two variables. Covariance is computed in units and is measured by multiplying the units of the two variables.

Note − The covariance formula is like the correlation formula. It deals with the measurement of data points from the average value in a dataset.

Covariance can take both positive or negative values. The difference between the two types of covariance are −

• Positive covariance − It indicates that two variables will move in the same direction.

• Negative covariance − It means that two variables will move in different (inverse) directions.

In finance, the concept of covariance is mainly used in portfolio theory. One of its most popular and common applications in portfolio theory is the "diversification method", where the covariance between assets in a portfolio is measured. By choosing the assets that do not show a high positive covariance with each other, the unsystematic risky investments can be partially eliminated.

## What is Covariance Formula?

In the covariance formula, two random variables X and Y can be denoted as Cov(X, Y). The relationship between the two is represented as −

$$\mathrm{Cov(X, Y) =\sum\frac{𝐸((𝑋 − \mu) 𝐸(𝑌 − u))}{𝑛 − 1}}$$

Where,

• X is a random variable

• E(X) = µ is the expected value (the mean) of the random variable X

• E(Y) = ν is the expected value (the mean) of the random variable Y

• n = the number of items in the data set.

## Covariance vs. Correlation

Covariance measures the variation of two random variables from the given expected values. Covariance only lets us gauge the direction of the relationship (whether the variables tend to move in tandem or show an inverse relationship). However, it does not indicate any value of the relationship, or whether the two variables have any relativity or dependence.

On the other hand, correlation measures the power or relationship between two variables. Correlation can be termed as the scaled measure of covariance. It does not have any dimension. In other words, the correlation coefficient is an absolute value, and it is not measured in any units.

The relationship between the two concepts can be expressed using the following formula −

$$\mathrm{\rho(𝑋, 𝑌) =\frac{Cov(𝑋, 𝑌)}{\sigma_{𝑋 }\:\sigma_{𝑌}}}$$

Where −

• ρ(𝑋, 𝑌) − the correlation between the variables X and Y

• Cov(𝑋, 𝑌) − the covariance between the variables X and Y

• σ𝑋 − the standard deviation of the X-variable

• σ𝑌 − the standard deviation of the Y-variable