Solveeit Logo

Question

Question: How do you calculate the covariance between two discrete variables?...

How do you calculate the covariance between two discrete variables?

Explanation

Solution

We need to find the formula to calculate the covariance between two discrete variables. Covariance in probability and statistics is used to calculate the joint probability of two random variables. For the given question, we find the formula of covariance for the variables X, Y in terms of variables x, y.

Complete step by step solution:
A random variable is a variable whose value is unknown. The value of a random variable depends on the outcomes of the random event.
The random variables are of two types namely,
1. Continuous random variable
2. Discrete random variable
The continuous random variable can take infinitely many values.
The discrete random variable can only take a countable number of values.
Covariance, in mathematics, tells us how the two random variables vary together. It is the same as variance except for that variance deals with only a single variable.
The larger the values of random variables the larger the covariance and vice versa. The larger value of covariance means a strong relationship between the variables.
According to our question,
Let us consider two discrete random variables X, Y.
The covariance of the discrete random variables X, Y is given as follows,
Cov(X,Y)=1ni=1nxiyi(1ni=1nxi)(1ni=1nyi)\Rightarrow Cov(X,Y)=\dfrac{1}{n}\sum\nolimits_{i=1}^{n}{{{x}_{i}}{{y}_{i}}}-\left( \dfrac{1}{n}\sum\nolimits_{i=1}^{n}{{{x}_{i}}} \right)\left( \dfrac{1}{n}\sum\nolimits_{i=1}^{n}{{{y}_{i}}} \right)
Here,
n = no of data terms;
xi{{x}_{i}} = The values of the variable X;
yi{{y}_{i}} = The values of the variable Y

Note: The significant application of covariance is to check the linear relationship between the random variables. The concept of Covariances is widely used in finance theory, data embedding, and feature extraction.