pyhctsa.operations.distribution.trimmed_mean

pyhctsa.operations.distribution.trimmed_mean(x, p_exclude=0.0)

Mean of the trimmed time series.

Returns the mean of the time series after removing a specified total percentage of values, half from the highest and half from the lowest. The number removed from each end is N*p_exclude/200, rounded to the nearest integer (halves round down), so small percentages can remove nothing (e.g., 1% removes no values for N <= 100).

Parameters:
x : array-like

The input time series or data vector

p_exclude : float, optional

The total percentage of values to exclude from the mean calculation, half from the highest and half from the lowest values (e.g., 10 excludes the highest 5% and the lowest 5%). Default is 0.0, which gives the standard mean.

Returns:

The mean of the trimmed time series.

Return type:

float