Department of Information Technology
MINI PROJECT
Academic Year 2024-25
Engineering Mathematics-III-CSC301
Title: Covariance
Submitted By:
Roll no. Name
317 YASH JADHAV
305 SUJAL BEDEKAR
307 TANMAY CHAVAN
318 YASHODEEP JADHAV
349 VIPUL SAWANT
310 MOHISH GAVIT
Submitted to:
Prof.Sarala Yadav
Department of Information Technology
Introduction:
Covariance is a fundamental concept in statistics that measures how two random
variables change together. It is used to determine whether an increase in one
variable results in an increase or decrease in another variable. This relationship is
vital in many fields like finance, where covariance is used to assess the direction of
the relationship between assets or in research fields to study interdependence
between different variables.
For instance, in finance, when two stocks have a positive covariance, their prices
tend to move in the same direction. Conversely, a negative covariance indicates
that their prices move inversely. Covariance helps in analyzing datasets where the
dependency or association between two variables is important. The magnitude of
covariance tells us the strength of the association, but it is sensitive to the units of
the variables, which makes it challenging to compare across different datasets.
Covariance can be either:
i. Positive: When both variables tend to increase or decrease together.
ii. Negative: When one variable increases as the other decreases.
Covariance is an unstandardized measure of the relationship, making it difficult to
interpret without considering the units of measurement. Nonetheless, it is a useful
initial indicator when exploring the interdependence of variables.
Department of Information Technology
DEFINITION:
In mathematics and statistics, covariance is a measure of the relationship between
two random variables. The metric evaluates how much – to what extent – the
variables change together. In other words, it is essentially a measure of the variance
between two variables.
Formulation:
Formula:
Where,
● Xi and Yi are individual sample points.
● X̄ and Ȳ are the sample means of X and Y
● n is no. of sample terms
Department of Information Technology
TYPES OF COVARIANCE:
Covariance can have both positive and negative values. Based on this, it has two
types:
● Positive Covariance
● Negative Covariance
Positive Covariance:
If the covariance for any two variables is positive, that means, both the variables
move in the same direction. Here, the variables show similar behaviour. That
means, if the values (greater or lesser) of one variable corresponds to the values of
another variable, then they are said to be in positive covariance.
Negative Covariance:
If the covariance for any two variables is negative, that means, both the variables
move in the opposite direction. It is the opposite case of positive covariance, where
greater values of one variable correspond to lesser values of another variable and
vice-versa.
Department of Information Technology
Covariance vs. Correlation
Covariance is also distinct from correlation, another statistical metric often used to
measure the relationship between two variables. While covariance measures the
direction of a relationship between two variables, correlation measures the strength
of that relationship. This is usually expressed through a correlation coefficient,
which can range from -1 to +1.
Example of Covariance Calculation
The capital sigma symbol (Σ) signifies the summation of all of the calculations. So,
you need to calculate for each day and add the results. For example, to calculate
the covariance between two stocks, assume you have the stock prices for a period
of four days and use the formula:
Department of Information Technology
Properties:
1. Symmetry: Cov(X, Y) = Cov(Y, X)
This property indicates that the covariance between X and Y is the same
regardless of the order.
2. Scaling: If a and b are constants,
then Cov(aX, bY) = ab * Cov(X, Y), This shows that covariance scales
linearly with changes in the variables.
3. Variance: Cov(X, X) = Var(X)
The covariance of a variable with itself is the variance.
4. Independence: If X and Y are independent, then Cov(X, Y) = 0
However, a zero covariance does not imply independence unless the
variables are jointly normally distributed.
5. Additivity: For three random variables X, Y, and Z:
Cov(X + Y, Z) = Cov(X, Z) + Cov(Y, Z)
This property facilitates the analysis of composite variables.
Department of Information Technology
Covariance has key applications in various fields:
1. Finance: Helps in portfolio diversification by analyzing relationships between
asset returns.
2. Econometrics: Assesses the relationship between economic variables like
inflation and unemployment.
3. Machine Learning: Used in algorithms like PCA for data reduction and feature
extraction.
4. Engineering: Aids in signal processing, noise reduction, and system control.
5. Statistics: Measures how two variables move together, useful in time series
analysis.
6. Actuarial Science: Assesses risk dependencies for insurance pricing and
portfolio management.