nispace.stats.effectsize.zscore

nispace.stats.effectsize.zscore(a, b=None)[source]

Standard (mean/SD) z-score of a, optionally against a reference b.

Parameters:
  • a (array_like, shape (n_obs_a, n_features)) – Values to standardize.

  • b (array_like, shape (n_obs_b, n_features), optional) – Reference sample supplying the mean/SD (e.g. a null distribution); n_obs_b need not match n_obs_a since mean/std are computed along axis=0 before broadcasting against a. If None (default), a is standardized against its own mean/SD.

Returns:

z

Return type:

np.ndarray, shape (n_obs_a, n_features)

Notes

Uses plain np.mean/np.std (ddof=1) – NaN in a or b propagates; use zscore_nan for NaN-aware columns. Not called by the Y_transform=”zscore(…)” formula path (which dispatches to the numba-jitted zscore_nan_fast), but zscore_nan (the NaN-aware sibling) is called directly by api.NiSpace.normalize_colocalizations() to z-score observed colocalizations against permutation null distributions.