pyhctsa.robust.bf_half_sample_mode

pyhctsa.robust.bf_half_sample_mode(y)

Half-sample mode: a robust, bin-free estimate of the mode (hctsa BF_HalfSampleMode).

Repeatedly keeps the ceil(n/2) consecutive sorted values that span the shortest interval (the first, lowest, on ties) until three or fewer values remain; the mode is then the mean of the two closest of them (the middle one if equally close).

Reference: Bickel and Fruhwirth, Comput. Stat. Data Anal. 50(12), 3500 (2006).

Parameters:
y : array-like

The data (NaNs are ignored).

Returns:

The estimated mode.

Return type:

float