Correlations

We've talked about correlations in the past and remarked on some definitions found on the Internet:

The correlation coefficient is calculated as:

and, in particular, some common misconceptions, like:
The correlation coefficient of two stocks characterizes the price interdependence between them. This value ranges from -1 to 1. A coefficient near 1 (Correlated) signifies similarity in price behavior, whereas a value near -1 (Anti-correlated) signifies inverse price behavior
(i.e. when one stock goes up the other goes down and vice versa).
and
Correlation is computed into what is known as the correlation coefficient, which ranges between -1 and +1. Perfect positive correlation (a correlation co-efficient of +1) implies that as one security moves, either up or down, the other security will move in lockstep, in the same direction. Alternatively, perfect negative correlation means that if one security moves in either direction the security that is perfectly negatively correlated will move by an equal amount in the opposite direction.

>So?
Here are the returns for two stocks:

As you can see, they both have positive returns, hence move up together ... yet the correlation is (surprise!) -1.

In fact, it is NOT the stock prices that tend to move together (for a correlation near +1).
Or, to put it differently, it is NOT the returns that tend to be positive (or negative) together.

In fact, a positive correlation (near +1) means that the returns tend to move together above and below their Mean
In the example above, when a return in the first set is above the Mean, the corresponding member of the second set is below the Mean ... and vice versa.

>And that makes the correlation is -1, right?
Right.

>But what would I calculate if I want to recognize when stock prices go up and down together?
Then you wouldn't include the Mean in your calculations.

In fact, you just calculate a Stock Comparison, like so:
 gSC = [A1 B1 + A2 B2 + ... + An Bn ] / SQRT[A12+A22+...+An2] SQRT[B12+B22+...+Bn2] = ΣAj Bj / SQRT[ ΣAj2] SQRT[ ΣBj2]
where the As and Bs are the returns ... and their Means are ignored.

>That don't look like the standard garden-variety correlation.
It's the same as the standard garden-variety correlation (or Pearson product-moment Correlation Coefficient) except that we set the Mean = 0 in the magic formula and ...

>But is it a number between -1 and +1? I mean, that'd be required, eh?
Uh ... yes. You can check that out here.

>What about that example, above, where the correlation is -1? What's the gSC for them two sets of returns? I'd say close to +1 because ...?
Close, but no cigar. It's gSC = 0.77

>And if I want to compare real stock returns?

You do this:

• Type in up to 30 Yahoo stock symbols in column M.