nispace.stats.effectsize.logfc_nan
- nispace.stats.effectsize.logfc_nan(a, b)[source]
NaN-aware log fold-change log((a + c) / (b + c)), with an auto-computed shift c.
c is 0 for all-non-negative input (e.g. raw cortical thickness), or |global_min(a, b)| + 1e-6 when either array has negative values (e.g. z-scored/residualized data) – just enough to make every shifted value positive for the log. The shift makes the statistic symmetric under permutation: logfc(b, a) == -logfc(a, b) exactly, so its null distribution is always centered on 0.
- Parameters:
a (array_like, shape (n_obs, n_features)) – Paired values; must have identical shape.
b (array_like, shape (n_obs, n_features)) – Paired values; must have identical shape.
- Returns:
lfc – NaN wherever a or b is NaN (explicitly masked).
- Return type:
np.ndarray, shape (n_obs, n_features)
Notes
Not called anywhere in NiSpace’s internal pipeline: Y_transform= “logfc(a,b)” dispatches to the numba-jitted logfc_fast (core/transform_y.py), not this function.