View License

Download apps, toolboxes, and other File Exchange content using Add-On Explorer in MATLAB.

» Watch video

Highlights from
Theil–Sen estimator

Join the 15-year community celebration.

Play games and win prizes!

» Learn more

4.5 | 3 ratings Rate this file 12 Downloads (last 30 days) File Size: 1.35 KB File ID: #34308 Version: 1.0
image thumbnail

Theil–Sen estimator



Robust regression for slope estimation between 1dimensional X and y

| Watch this File

File Information

the Theil–Sen estimator, also known as Sen's slope estimator,slope selection,the single median method, or the Kendall robust line-fit method, is a method for robust linear regression that chooses the median slope among all lines through pairs of two-dimensional sample points. It is named after Henri Theil and Pranab K. Sen, who published papers on this method in 1950 and 1968 respectively. It can be computed efficiently, and is insensitive to outliers; it can be significantly more accurate than simple linear regression for skewed and heteroskedastic data, and competes well against simple least squares even for normally distributed data. It has been called "the most popular nonparametric technique for estimating a linear trend".

PS: Example code on how to use can be found in .mfile

Note: This code can only be used for the twodimensional case.

This was a response to ==>


This file inspired Rfitslm and Theil Sen Robust Linear Regression.

Required Products MATLAB
MATLAB release MATLAB 7.12 (R2011a)
Tags for This File   Please login to tag files.
Please login to add a comment or rating.
Comments and Ratings (4)
09 May 2016 t

t (view profile)

15 Apr 2016 t

t (view profile)


04 May 2015 Patricia

It requires the Statistics Toolbox

Comment only
22 Apr 2014 Felipe G. Nievinski

Line 12:


can be replaced by:


(otherwise the value assigned to deltax and deltay would be unused.

Contact us