ArticleslgStudy

mathematics

Theil–Sen estimator

Theil–Sen estimator is a mathematics topic covered in the lgStudy science library. This page brings together a partial reference excerpt, illustrations, worked examples, real-world applications and a short study plan, so you can understand Theil–Sen estimator rather than just read about it. In short: In non-parametric statistics, the Theil–Sen estimator is a method for robustly fitting a line to sample points in the plane (a form of simple linear regression) by choosing the median of the slopes of all lines through pairs of points. It has also been called Sen's slope estimator, slope selection, the single median method, the Kendall robust line-fit method, and the Kendall–Theil robust line.

Theil–Sen estimator — main illustration
Theil–Sen estimator — illustration

Key takeaways

  • Theil–Sen estimator belongs to mathematics; place it in that map before memorising details.
  • Learn the definition first, then one example that makes the definition concrete.
  • Connect Theil–Sen estimator to a quantity you can measure, compute or draw — that is where exam questions come from.
  • Reproduce the core statement of Theil–Sen estimator from memory before moving on to harder problems.

Reference excerpt

In non-parametric statistics, the Theil–Sen estimator is a method for robustly fitting a line to sample points in the plane (a form of simple linear regression) by choosing the median of the slopes of all lines through pairs of points. It has also been called Sen's slope estimator, slope selection, the single median method, the Kendall robust line-fit method, and the Kendall–Theil robust line. It is named after Henri Theil and Pranab K. Sen, who published papers on this method in 1950 and 1968 respectively, and after Maurice Kendall because of its relation to the Kendall tau rank correlation coefficient. Theil–Sen regression has several advantages over Ordinary least squares regression. It is insensitive to outliers. It can be used for significance tests even when residuals are not normally distributed. It can be significantly more accurate than non-robust simple linear regression (least squares) for skewed and heteroskedastic data, and competes well against least squares even for normally distributed data in terms of statistical power. It has been called "the most popular nonparametric technique for estimating a linear trend". There are fast algorithms for efficiently computing the parameters.

Definition As defined by Theil (1950), the Theil–Sen estimator of a set of two-dimensional points (xi, yi) is the median m of the slopes (yj − yi)/(xj − xi) determined by all pairs of sample points. Sen (1968) extended this definition to handle the case in which two data points have the same x coordinate. In Sen's definition, one takes the median of the slopes defined only from pairs of points having distinct x coordinates. Once the slope m has been determined, one may determine a line from the sample points by setting the y-intercept b to be the median of the values yi − mxi. The fit line is then the line y = mx + b with coefficients m and b in slope–intercept form. As Sen observed, this choice of slope makes the Kendall tau rank correlation coefficient become approximately zero, when it is used to compare the values xi with their associated residuals yi − mxi − b. Intuitively, this suggests that how far the fit line passes above or below a data point is not correlated with whether that point is on the left or right side of the data set. The choice of b does not affect the Kendall coefficient, but causes the median residual to become approximately zero; that is, the fit line passes above and below equal numbers of points. A confidence interval for the slope estimate may be determined as the interval containing the middle 95% of the slopes of lines determined by pairs of points and may be estimated quickly by sampling pairs of points and determining the 95% interval of the sampled slopes. According to simulations, approximately 600 sample pairs are sufficient to determine an accurate confidence interval.

Variations A variation of the Theil–Sen estimator, the repeated median regression of Siegel (1982), determines for each sample point (xi, yi), the median mi of the slopes (yj − yi)/(xj − xi) of lines through that point, and then determines the overall estimator as the median of these medians. It can tolerate a greater number of outliers than the Theil–Sen estimator, but known algorithms for computing it efficiently are more complicated and less practical. A different variant pairs up sample points by the rank of their x-coordinates: the point with the smallest coordinate is paired with the first point above the median coordinate, the second-smallest point is paired with the next point above the median, and so on. It then computes the median of the slopes of the lines determined by these pairs of points, gaining speed by examining significantly fewer pairs than the Theil–Sen estimator. Variations of the Theil–Sen estimator based on weighted medians have also been studied, based on the principle that pairs of samples whose x-coordinates differ more greatly are more likely to have an accurate slope and therefore should receive a higher weight. For seasonal data, it may be appropriate to smooth out seasonal variations in the data by considering only pairs of sample points that both belong to the same month or the same season of the year, and finding the median of the slopes of the lines determined by this more restrictive set of pairs.

Statistical properties The Theil–Sen estimator is an unbiased estimator of the true slope in simple linear regression. For many distributions of the response error, this estimator has high asymptotic efficiency relative to least-squares estimation. Estimators with low efficiency require more independent observations to attain the same sample variance of efficient unbiased estimators. The Theil–Sen estimator is more robust than the least-squares estimator because it is much less sensitive to outliers. It has a breakdown point of

1 − 1 2 ≈ 29.3 % , {\displaystyle 1-{\frac {1}{\sqrt {2}}}\approx 29.3\%,}

meaning that it can tolerate arbitrary corruption of up to 29.3% of the input data-points without degradation of its accuracy. However, the breakdown point decreases for higher-dimensional generalizations of the method. A higher breakdown point, 50%, holds for a different robust line-fitting algorithm, the repeated median estimator of Siegel. The Theil–Sen estimator is equivariant under every linear transformation of its response variable, meaning that transforming the data first and then fitting a line, or fitting a line first and then transforming it in the same way, both produce the same result. However, it is not equivariant under affine transformations of both the predictor and response variables.

… excerpt ends here. Continue reading the full article.

Illustrations

Theil–Sen estimator: The Theil–Sen estimator of a set of sample points with outliers (black line) compared to the non-robust ordinary least squares line for the same set (blue). The dashed green line represents the ground truth from which the samples were generated.
The Theil–Sen estimator of a set of sample points with outliers (black line) compared to the non-robust ordinary least squares line for the same set (blue). The dashed green line represents the ground truth from which the samples were generated.

Worked examples

Example 1 — a first encounter with Theil–Sen estimator

Start with the simplest possible case. Write down what Theil–Sen estimator claims or describes in one sentence, then invent the smallest concrete situation in which that sentence is true. In mathematics, the smallest case is usually a single object, a single equation or a single measurement. Check that every symbol or term in your sentence has a meaning in that case.

Example 2 — changing one variable

Take the situation from Example 1 and change exactly one quantity: double it, halve it, or set it to zero. Predict what should happen to Theil–Sen estimator before you calculate. Comparing your prediction with the result is the fastest way to find out whether you understand the idea or only the words.

Example 3 — an exam-style question

Typical questions about Theil–Sen estimator ask you to (a) state it precisely, (b) apply it to given data, and (c) explain a limitation. Practise writing all three answers in under five minutes; the third part is what separates a full-mark answer from an average one.

Applications of Theil–Sen estimator

In research
Theil–Sen estimator appears in mathematics research whenever the underlying quantities have to be modelled precisely. Papers usually cite it as a starting assumption and then explore where it breaks down.
In technology and industry
Engineering practice reuses Theil–Sen estimator in design rules, simulations and safety margins. Knowing the idea lets you read a specification sheet and understand why the numbers look the way they do.
In the classroom
Theil–Sen estimator is common in secondary-school and first-year university syllabi. It links to neighbouring topics Computational geometry, Robust regression, so understanding it makes those chapters shorter.
In everyday life
Look for Theil–Sen estimator outside the textbook — in sport, cooking, traffic, electronics or the sky above you. An example you found yourself is remembered far longer than one you were given.
Ask Teacher Smith questions about this articleOpens your AI tutor with a question about “Theil–Sen estimator” →

Affiliate

Preply — study more efficiently by working with a personal tutor. 50% off.

How to study Theil–Sen estimator in 20 minutes

  1. Read the reference excerpt below once, without taking notes.
  2. Close the page and write down what Theil–Sen estimator means in your own words.
  3. Compare your version with the excerpt and mark what you missed.
  4. Work through the three examples above with pen and paper.
  5. Explain Theil–Sen estimator out loud to somebody else — or to Teacher Smith in the lgStudy chat.

Frequently asked questions

What is Theil–Sen estimator in simple terms?

In non-parametric statistics, the Theil–Sen estimator is a method for robustly fitting a line to sample points in the plane (a form of simple linear regression) by choosing the median of the slopes of all lines through pairs of points. It has also been called Sen's slope estimator, slope selection…

Why does Theil–Sen estimator matter?

Because it connects several mathematics ideas at once: it gives you a definition you can apply, a quantity you can calculate, and a way to check whether a result is plausible.

How should I study Theil–Sen estimator?

Read the excerpt, restate it from memory, then work through the examples and applications listed on this page. The five-step study plan above takes about twenty minutes.

What does this page cover?

It gives you a compact reference excerpt plus original lgStudy explanations, examples, applications and study material on Theil–Sen estimator.

Tags

  • Computational geometry
  • Robust regression

Keep exploring