skfolio.utils.stats.cs_rank_correlation#

skfolio.utils.stats.cs_rank_correlation(a, b, axis=0, min_count=3, eps=1e-12)[source]#

Cross-sectional Spearman rank correlation.

Ranks the jointly finite values of a and b along axis with cs_rank, then computes their Pearson correlation via cs_weighted_correlation (unweighted).

Parameters:
andarray

First array.

bndarray

Second array, same shape as a.

axisint, default=0

The cross-sectional axis along which correlation is computed.

min_countint, default=3

Minimum number of jointly finite observations along axis.

epsfloat, default=1e-12

Denominator threshold below which NaN is returned.

Returns:
corrfloat or ndarray

Scalar when inputs are 1D, otherwise an array with axis removed.