In quantitative portfolio management, risk analytics, and income distribution studies, Pearson correlation coefficients measure linear co-movement between variables. However, Pearson correlation is vulnerable to heavy-tailed distributions and extreme outliers. The Schechtman-Yitzhaki Gini Correlation coefficient provides an asymmetric, non-parametric alternative grounded in the covariance between a variable and the cumulative rank distribution of another. By utilizing dynamic array functions—specifically VSTACK, HSTACK, LAMBDA, LET, and MAKEARRAY—analysts can construct dynamic Gini correlation matrices in Microsoft Excel without legacy VBA macros.
Mathematical Foundations of the Gini Correlation
For two continuous random variables X and Y with cumulative distribution functions FX(x) and FY(y), the Gini correlation of X with respect to Y, denoted Γ(X, Y), is defined as:
Γ(X, Y) = Cov(X, F_Y(Y)) / Cov(X, F_X(X))
Unlike standard Pearson correlation, the Gini correlation is asymmetric: Γ(X, Y) does not generally equal Γ(Y, X). Γ(X, Y) measures how closely the values of X follow the ranking of Y, normalised by the maximum possible rank-covariance of X with its own ranks. This asymmetric property allows analysts to detect whether asset returns drive benchmark rankings or vice versa.
Authoring the Pairwise Gini Correlation LAMBDA
In Excel (Microsoft 365 or Excel 2024), navigate to Formulas > Name Manager and create a defined name titled GINI_CORR with the following dynamic formula:
=LAMBDA(x_vals, y_vals,
LET(
n, ROWS(x_vals),
rank_y, (RANK.EQ(y_vals, y_vals, 1) + (COUNTIF(y_vals, y_vals) - 1) / 2) / n,
rank_x, (RANK.EQ(x_vals, x_vals, 1) + (COUNTIF(x_vals, x_vals) - 1) / 2) / n,
cov_xy, COVARIANCE.S(x_vals, rank_y),
cov_xx, COVARIANCE.S(x_vals, rank_x),
IF(cov_xx = 0, 0, cov_xy / cov_xx)
)
)
This formula accurately resolves fractional tied ranks and computes sample covariances dynamically.
Constructing the Full Dynamic Correlation Matrix with VSTACK
Suppose your asset returns for three series (Asset A, Asset B, Asset C) are stored across columns A2:C21. In cell E2, input this self-contained matrix generation formula:
=LET(
data, A2:C21,
col_names, {"Asset A", "Asset B", "Asset C"},
k, COLUMNS(data),
matrix, MAKEARRAY(k, k, LAMBDA(r, c,
LET(
x, CHOOSECOLS(data, r),
y, CHOOSECOLS(data, c),
ROUND(GINI_CORR(x, y), 3)
)
)),
top_header, HSTACK("Gini Corr Γ(Row, Col)", col_names),
matrix_with_row_labels, HSTACK(TRANSPOSE(col_names), matrix),
VSTACK(top_header, matrix_with_row_labels)
)
Analytical Advantages in Financial Modeling
- Asymmetric Insight: Observing Γ(Asset A, Asset B) = 0.72 while Γ(Asset B, Asset A) = 0.48 reveals that Asset A’s returns are strongly monotonic to Asset B’s performance, but Asset B maintains independent variance in the opposite direction.
- Robust Outlier Invariance: Because rank transformations govern the denominator and covariance weighting, black swan outliers do not distort the relationship as severely as in quadratic Pearson correlation.
- Full Dynamic Spilling: Adding new rows of data immediately recomputes the entire matrix across Excel without manual formula editing.