pyhctsa.robust.bf_theil_sen

pyhctsa.robust.bf_theil_sen(x, y)

Theil-Sen robust straight-line fit (hctsa BF_TheilSen).

The slope is the median of the slopes of the lines through all pairs of points with different x; the intercept is the median of y - slope*x. (This is not scipy.stats.theilslopes, whose default intercept differs.)

Returns:

[slope, intercept], in the order of np.polyfit(x, y, 1); both NaN if there are fewer than two distinct x values.

Return type:

numpy.ndarray

Parameters:
x : _Buffer | _SupportsArray[dtype[Any]] | _NestedSequence[_SupportsArray[dtype[Any]]] | complex | bytes | str | _NestedSequence[complex | bytes | str]

y : _Buffer | _SupportsArray[dtype[Any]] | _NestedSequence[_SupportsArray[dtype[Any]]] | complex | bytes | str | _NestedSequence[complex | bytes | str]