Uses of the t-test and the z-test
The z-test The z-test is the ideal hypothesis test to conduct in a... Read More
Covariance is a measure of the degree of co-movement between two random variables. For instance, we could be interested in the degree of co-movement between interest rate and inflation rate. The general formula used to calculate the covariance between two random variables, X and Y, is:
$$ \ text {cov} [X,Y] = E [(X – E[X ])(Y – E[Y])] $$
While the formula for covariance given above is correct, we use a slightly modified formula to calculate the covariance of returns from a joint probability model. It is based on the probability-weighted average of the cross-products of the random variables’ deviations from their expected values for each possible outcome. Therefore, if we have two assets, I and J, with returns Ri and Rj respectively, then:
$$ { \sigma }_{ { R }_{ i },{ R }_{ j } }=\sum _{ i=1 }^{ n }{ P\left( { R }_{ i } \right) \left[ { R }_{ i }-E\left( { R }_{ i } \right) \right] \left[ { R }_{ j }-E\left( { R }_{ j } \right) \right] } $$
The covariance between two random variables can be positive, negative, or zero. A positive number indicates co-movement (i.e. the variables tend to move in the same direction); a value of zero indicates no relationship, and a negative value shows that the variables move in opposite directions.
Correlation is the ratio of the covariance between two random variables and the product of their two standard deviations i.e.
$$ { \text{Correlation} }\left( { R }_{ i },{ R }_{ j } \right) =\frac { \text{Covariance}\left( { R }_{ i },{ R }_{ j } \right) }{ \text{Standard deviation}\left( { R }_{ i } \right) \ast \text{Standard deviation}\left( { R }_{ j } \right) } $$
It measures the strength of the linear relationship between two variables. While the covariance can take on any value between negative infinity and positive infinity, the correlation is always a value between -1 and +1.
You should note the following:
First, -1 indicates a perfect inverse relationship (i.e., a unit change in one means that the other will have a unit change in the opposite direction). Secondly, +1 indicates a perfect linear relationship (i.e., the two variables move in the same direction with equal unit changes). Finally, if there is no linear relationship at all, then the correlation will be zero.
We anticipate a 15% chance that next year’s stock returns for ABC Corp will be 6%, a 60% probability that they will be 8%, and a 25% probability of 10% return. We already know that the expected value of returns is 8.2%, and the standard deviation is 1.249%.
We also anticipate that the same probabilities and states are associated with a 4% return for XYZ Corp, a 5% return, and a 5.5% return. Then the expected value of returns is 4.975, and the standard deviation is 0.46%.
Suppose we wish to calculate the covariance and the correlation between ABC and XYZ returns. Then:
$$ \begin{align*} \text{Covariance}, \text{cov}(\text R_{\text{ABC}},\text R_{\text{XYZ}}) & = 0.15(0.06 – 0.082)(0.04 – 0.04975) \\ & + 0.6(0.08 – 0.082)(0.05 – 0.04975) \\ & + 0.25(0.10 – 0.082)(0.055 – 0.04975) \\ & = 0.0000561 \\ \end{align*} $$
$$ { \text{Correlation} }\left( { R }_{ i },{ R }_{ j } \right) =\frac { \text{Covariance}\left( { R }_{ i },{ R }_{ j } \right) }{ \text{Standard deviation}\left( { R }_{ i } \right) \ast \text{Standard deviation}\left( { R }_{ j } \right) } $$
Therefore:
$$ \begin{align*} \text{Correlation} & =\cfrac {0.0000561}{(0.01249 * 0.0046)} \\ & = 0.976 \\ \end{align*} $$
Interpretation: the correlation between the returns of the two companies is very strong (almost +1) and the returns move linearly in the same direction.