brunnermunzel

brunnermunzel(x: ndarray, y: ndarray, axis=None, nan_policy='omit')[source][source]

Compute the Brunner-Munzel test statistic for two independent samples.

The Brunner-Munzel test is used to compare the stochastic dominance of two independent samples and does not assume equal variances. It is a

nonparametric statistical test that operates using ranked data. This

implementation allows handling NaN values based on the specified policy.

Parameters:
  • x (np.ndarray) – The first input array representing sample data.

  • y (np.ndarray) – The second input array representing sample data.

  • axis (int or None, optional) – The axis along which to compute the test statistic. If None, the arrays are flattened before computation. Default is None.

  • nan_policy ({'propagate', 'raise', 'omit'}, optional) – Defines how to handle NaN values in the inputs: - ‘propagate’: Returns NaN in the result if NaN is present in the input - ‘raise’: Raises an error if NaN is detected in the input. - ‘omit’: Omits NaN values during the computation. Default is ‘omit’.

Returns:

The computed Brunner-Munzel statistic, returned as a scalar if the

input arrays are 1D and as an array otherwise.

Return type:

np.ndarray or float