Input Data :
Data set x = 5, 12, 18, 23, 45
Data set y = 2, 8, 18, 20, 28
Total number of elements = 5
Objective :
Find what is correlation coefficient for given input data?
Formula :
$\begin{align} s_{XY} &=\frac{\sum_{i=1}^n(x_i-\bar{X})(y_i-\bar{Y})}{n-1}\end{align}$
`x_i` | `x_i - \bar{X}` | `y_i` | `y_i - \bar{X}` | `(x_i - \bar{X})(y_i - \bar{Y})` |
---|---|---|---|---|
5 | -15.6 | 2 | -13.2 | `205.92` |
12 | -8.6 | 8 | -7.2 | `61.92` |
18 | -2.6 | 18 | 2.8 | `-7.28` |
23 | 2.4 | 20 | 4.8 | `11.52` |
45 | 24.4 | 28 | 12.8 | `312.32` |
`\sum x_i``= 103` | `\sum y_i``=76` | `\sum (x_i - \bar{X})(y_i - \bar{X})``=584.4` | ||
`\bar{X}``=103/5``=`20.6 | `\bar{Y}``=76/5``=`15.2 |
Covariance Calculator estimates the statistical relationship (linear dependence) between the two sets of population data `X` and `Y`. It's an online statistics and probability tool requires two sets of population data `X` and `Y` and measures of how much these data sets vary together, i.e. it helps us to understand how two sets of data are related to each other.
It is necessary to follow the next steps:
Covariance indicates whether two variables `X` and `Y` are related by measuring how the variables change in relation to each other. It tells us if there is a relationship between two variables and which direction that relationship is in.
A positive covariance means that the two variables are positively related, and they have the same direction. A negative covariance means that the variables are negatively related, and they have the opposite directions.
The variance is a special case of the covariance in which the two sets of data are identical. So, if $X\equiv Y$, then covariance becomes variance.
As we have mentioned, the covariance and correlation indicate whether non-identical variables are positively or negatively related.
Correlation gives the degree to which the variables tend to move together in the corresponding direction. Covariance can be used to measure variables that have no the same units of measurement. By using the covariance, we are able to determine whether units are increasing or decreasing, but we are unable to solidify the degree to which the variables are moving together because the covariance does not use one standardized unit of measurement.
Let us consider two samples $X=(x_1,\ldots,x_n)$ and $Y=(y_1,\ldots, y_n)$ of $n$ outcomes. The sample covariance, $s_{XY}$, of two samples `X` and `Y` is determined by the formula
The first application of covariance is in determining the correlation coefficient. If we divide the covariance by the standard deviation of `X` and the standard deviation of `Y`, we will get the correlation coefficient. Covariance is frequently used in statistics and probability theory since it refers to the measure of the directional relationship between two random variables `X` and `Y`. It is very useful in finance. The covariance describes the returns on two different investments over a period of time when compared to different variables.
Practice Problem 1:
Find the covariance between the given two sets of data $X: 13, 12, 15, 18, 21$ and $Y: 15, 29, 11, 14, 34$.
Practice Problem 2:
The given table shows the number of borrowed geometry and statistics books in week from Monday to Friday. Find the covariance between them.
Geometry | Statistics | |
Monday | 134 | 231 |
Tuesday | 156 | 127 |
Wednesday | 234 | 276 |
Thursday | 214 | 265 |
Friday | 301 | 124 |
Geometry | 65 | 43 | 89 | 76 | 34 |
Statistics | 46 | 78 | 89 | 56 | 100 |