Introduction
This module includes implementations of codependence metrics. According to Lopez de Prado:
“Two random variables are codependent when knowing the value of one helps us determine the value of the other. This should not be confounded with the notion of causality.”
Pearson correlation coefficient is the most famous and widely used measure of codependence, however, it has some drawbacks.
Warning
Pearson correlation suffers from 3 major drawbacks:
-
It captures linear effects, but if two variables have strong non-linear dependency (squared or abs for example) Pearson correlation won’t find any pattern between them.
-
Correlation is not a distance metric: it does not satisfy non-negativity and subadditivity conditions.
-
Financial markets have non-linear patterns, which Pearson correlation fails to capture.
Pearson correlation is not the only way of measuring codependence. There are alternative and more modern measures of codependence, which are described in the parts of this module.
Note
For some methods in this module, it’s discussed whether they are true metrics. According to Arkhangel’skii, A. V. and Pontryagin, L. S. (1990), General Topology I: A metric on a set \(X\) is a function (called a distance):
for which the following three axioms are satisfied:
-
\(d(x, y) = 0 \iff x = y\) — identity of indiscernibles;
-
\(d(x,y) = d(y,x)\) — symmetry;
-
\(d(x,y) \le d(x,z) + d(z,y)\) — triangle inequality;
and these imply \(d(x,y) \ge 0\) — non-negativity.