Correlations
Correlations
Centralized implementation of correlation measures used in NewBestSub.
Features:
Single source of truth for both Pearson and Kendall τ-b.
Primitive DoubleArray implementations (no boxing) for hot paths.
Boxed Array
implementations for legacy branches (e.g., Average mode). Factory helpers to select by method token (Constants.CORRELATION_PEARSON, Constants.CORRELATION_KENDALL).
Design notes:
Pearson correlation uses allocation-free streaming accumulators.
Kendall τ-b is implemented in O(n²) with tie correction and no temporary pairs.
Boxed correlation paths exist for compatibility; internally, they may copy into primitive arrays.
Functions
Computes Pearson correlation on two primitive arrays.
Computes Kendall’s τ-b correlation on primitive arrays, with tie correction.
Returns a boxed correlation function for the given method token.
Returns a primitive correlation function for the given method token.