Image for Theil-Sen estimator

Theil-Sen estimator

The Theil-Sen estimator is a method for finding the best straight-line fit through a set of data points, especially useful when data has outliers or isn't perfectly linear. Instead of averaging slopes between points, it calculates the slopes between all pairs of points and then takes the median of these slopes as the estimate. This approach makes it robust against unusual data points that can skew traditional methods like least squares. In essence, it provides a reliable, resistant way to determine the trend or relationship between variables in a dataset.