Invest in equities, F&O and upcoming IPOs effortlessly by opening a demat account online. Enjoy a free subscription for the first year with Bajaj Broking
Know the benefits of a demat account
Free Demat account in minutes | Low brokerage | Online account opening
Covariance measures the relationship between two variables by showing whether they move together or move in opposite directions. It is widely used in statistics, portfolio construction, and risk analysis.
Key takeaways:
- A positive covariance means two variables generally move in the same direction.
- A negative covariance means two variables generally move in opposite directions.
- A covariance close to zero suggests little or no linear relationship.
- Investors use covariance to understand how different stocks interact within a portfolio.
- Covariance is a key input in portfolio risk and diversification analysis.
- The covariance formula compares each variable's deviation from its mean.
What is covariance?
What is covered call?
Covariance is a statistical measure that indicates the direction of the relationship between two variables. It shows whether the variables tend to increase and decrease together or move in opposite directions.
The magnitude of covariance alone may be difficult to interpret because it depends on the scale of the variables. However, the sign of covariance provides useful information about the relationship.
| Covariance value | Interpretation |
|---|---|
| Positive | Variables tend to move in the same direction |
| Negative | Variables tend to move in opposite directions |
| Zero or near zero | Little or no linear relationship |
For example, if two stocks frequently rise and fall together, they may have a positive covariance. If one stock generally rises when the other falls, their covariance may be negative.
The covariance formula in statistics
Covariance is calculated by measuring how each observation differs from its mean and then evaluating how those deviations move together.
The sample covariance formula is:
Cov(X,Y) = Σ[(Xi − X̄)(Yi − Ȳ)] ÷ (n − 1)
Where:
| Symbol | Meaning |
| Xi | Individual value of variable X |
| Yi | Individual value of variable Y |
| X̄ | Mean of variable X |
| Ȳ | Mean of variable Y |
| n | Number of observations |
| Σ | Sum of all observations |
The formula multiplies the deviations of the two variables from their respective means. The average of these products determines whether the variables generally move together or apart.
How to calculate the covariance of two stocks: worked example
Consider the monthly returns of two hypothetical stocks.
| Month | Stock A (%) | Stock B (%) |
| 1 | 4 | 5 |
| 2 | 6 | 7 |
| 3 | 5 | 4 |
| 4 | 7 | 8 |
Step 1: Calculate the mean return
| Stock | Mean return (%) |
| Stock A | 5.5 |
| Stock B | 6.0 |
Step 2: Calculate deviations from the mean
| Month | A − Mean A | B − Mean B |
| 1 | -1.5 | -1 |
| 2 | 0.5 | 1 |
| 3 | -0.5 | -2 |
| 4 | 1.5 | 2 |
Step 3: Multiply the deviations
| Month | Product of deviations |
| 1 | 1.5 |
| 2 | 0.5 |
| 3 | 1.0 |
| 4 | 3.0 |
Sum of products = 6.0
Step 4: Calculate covariance
Covariance = 6 ÷ (4 − 1)
Covariance = 2.0
The positive covariance indicates that the returns of the two stocks generally move in the same direction. When one stock's return increases, the other tends to increase as well.
Start investing today
Open Demat Account
Open Trading Account
Margin Trading Facility
Variance vs covariance vs correlation and why it matters
Variance, covariance, and correlation are related statistical concepts, but they measure different aspects of data behaviour.
| Measure | What it measures | Interpretation |
| Variance | Dispersion of a single variable around its mean | Measures individual volatility |
| Covariance | Joint movement of two variables | Shows direction of relationship |
| Correlation | Strength and direction of a relationship | Standardised relationship measure |
Variance vs covariance
Variance measures how much a single variable deviates from its average value. Covariance measures how two variables move relative to each other.
For example, variance can measure the volatility of a stock's returns, while covariance can measure how that stock moves relative to another stock.
Covariance vs correlation
Covariance indicates the direction of a relationship but does not provide a standardised measure of its strength. Correlation standardises the relationship and ranges from -1 to +1.
Because correlation is easier to interpret, analysts often use it alongside covariance when evaluating investment portfolios.
Why does covariance matter in investing?
Covariance helps investors understand how assets interact within a portfolio. Combining assets with different covariance characteristics can improve diversification.
For example, stocks with low or negative covariance may reduce overall portfolio volatility because they do not always move in the same direction. This makes covariance an important tool in portfolio construction and risk management.
Upcoming IPO
Conclusion
Covariance is a statistical measure that helps determine how two variables move in relation to each other. A positive covariance indicates that variables generally move together, while a negative covariance suggests they move in opposite directions.
In investing, covariance plays an important role in portfolio analysis, diversification, and risk management. Understanding covariance, along with variance and correlation, can help investors evaluate relationships between securities and make more informed investment decisions.
Pro Tip
Related Articles
Frequently Asked Questions
Covariance
What is covariance?
What is the covariance formula in statistics?
The sample covariance formula is Cov(X,Y) = Σ[(Xi − X̄)(Yi − Ȳ)] ÷ (n − 1). It measures how deviations from the mean of two variables move together across a set of observations.
How do you calculate the covariance of two stocks?
To calculate the covariance of two stocks, determine the average return of each stock, calculate deviations from those averages, multiply the deviations for each observation, add the results, and divide the total by n − 1.
What is the difference between variance and covariance?
Variance measures how much a single variable deviates from its mean. Covariance measures how two variables move relative to each other and indicates whether their movements are generally in the same or opposite directions.
Disclaimer
Standard Disclaimer
Investments in the securities market are subject to market risk, read all related documents carefully before investing.
Broking services offered by Bajaj Financial Securities Limited (Bajaj Broking). Reg Office: Bajaj Auto Limited Complex, Mumbai –Pune Road Akurdi Pune 411035. Corporate Office: Bajaj Financial Securities Limited, 1st Floor, Mantri IT Park, Tower B, Unit No 9 & 10, Viman Nagar, Pune, Maharashtra 411014. SEBI Registration No.: INZ000218931 | BSE Cash/F&O/CDS (Member ID:6706) | NSE Cash/F&O/CDS (Member ID: 90177) | DP registration No: IN-DP-418-2019 | CDSL DP No.: 12088600 | NSDL DP No. IN304300 | AMFI Registration No.: ARN –163403.
Details of Compliance Officer: Mr. Boudhayan Ghosh (For Broking/DP/Research) | Email: compliance_sec@bajajbroking.in | Contact No.: 020-4857 4486. For any investor grievances write to compliance_sec@bajajbroking.in/ compliance_dp@bajajbroking.in (DP related)
This content is for educational purpose only. Securities quoted are exemplary and not recommendatory.
Research Services are offered by Bajaj Broking as Research Analyst under SEBI Regn: INH000010043.
For more disclaimer, check here: https://www.bajajbroking.in/disclaimer