Differential correlation refers to measuring how correlation patterns change across different groups or ranked samples. This is useful in fields like genomics, finance, and signal processing, where relationships between variables may vary across different conditions.
Key Concepts
-
Ranked Samples:
- Sort samples based on a particular variable (e.g., time, expression level, financial return).
- Divide them into groups (e.g., top $50 \%$ vs. bottom $50 \%$ ).
-
Compute Correlations in Each Group:
- Pearson or Spearman correlation between two variables in each group.
-
Differential Correlation ( $\Delta$ Corr):
- The difference in correlation between groups:
$$
\Delta \text { Corr }=\text { Corr }{\text {high }}-\text { Corr }{\text {low }}
$$
- Large $\Delta$ Corr suggests that the relationship between variables changes significantly across conditions.
Python Implementation
We'll:
- Generate synthetic ranked samples.
- Compute differential correlation between two variables.
https://gist.github.com/viadean/19418f69686c3febbfa96d4f277b6ed5
How It Works
- Generates synthetic ranked samples.
- Splits data into high-rank and low-rank groups.
- Computes Pearson correlation for each group.
- Calculates differential correlation ( $\Delta$Corr).
- Visualizes scatter plots with different correlations.
Why Use Differential Correlation?
- Identifies dynamic relationships (e.g., genes interacting differently in cancer vs. normal samples).
- Useful for ranking-based studies (e.g., financial asset relationships at different volatility levels).
- Enhances feature selection (detects variables with changing dependencies).