pyhctsa.operations.distribution.outlier_test

pyhctsa.operations.distribution.outlier_test(y, p=2, just_me=None)

How distributional statistics depend on distributional outliers.

Removes the p% of highest and lowest values in the time series (i.e., 2*p% removed in total; values strictly between the p-th and (100-p)-th percentiles are kept) and returns the mean of the remaining values and their standard deviation divided by the standard deviation of the full series.

Parameters:
y : array-like

The input data vector.

p : float

The percentage of values to remove beyond upper and lower percentiles. Default is 2.

just_me : {'mean', 'std'}, optional

If specified, just returns a number:

  • ’mean’: returns the mean of the middle portion of the data

  • ’std’: returns the std of the middle portion of the data, divided by the std of the full series

If None (default), returns a dictionary.

Returns:

If just_me is specified, returns the mean of the middle portion of the data, or its std divided by the std of the full series. Otherwise, returns a dictionary with both (keys mean and std).

Return type:

float or dict