- 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

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.

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) 𝐸(𝑌 − \nu))}{𝑛 − 1}}$$

Where,

*X*is a random variableE(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 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

- Related Questions & Answers
- What is the relationship between correlation and covariance?
- How is Covariance and Correlation used in Portfolio Theory?
- Covariance and Contravariance in C#
- Signals and Systems – Relation between Convolution and Correlation
- Write a program in Python to compute grouped data covariance and calculate grouped data covariance between two columns in a given dataframe
- How to find the covariance between two vectors in R?
- Correlation and Regression in Python
- Cross Correlation Function and its Properties
- Difference between JCoClient and JCoDestination
- Difference between String and StringBuffer.
- Difference between StringBuffer and StringBuilder.
- Difference between C# and .Net
- Difference between Process and Thread
- Difference between Concurrency and Parallelism
- Difference between localhost and 127.0.0.1?

Advertisements