From 7ca7d65ad79f4a7d841b45637eaf6f53bfad338b Mon Sep 17 00:00:00 2001 From: Johannes Keyser <johannes.keyser@sport.uni-giessen.de> Date: Thu, 24 Mar 2022 16:54:57 +0100 Subject: [PATCH] Small fixes in documentation. --- README.md | 6 +++--- TheilSen.m | 4 ++-- example.m | 2 +- 3 files changed, 6 insertions(+), 6 deletions(-) diff --git a/README.md b/README.md index db7f470..bf5fd18 100644 --- a/README.md +++ b/README.md @@ -8,12 +8,12 @@ A stand-alone Theil-Sen estimator for robust regression in Matlab. ### Theil-Sen estimator -A [Theil-Sen estimator](https://en.wikipedia.org/wiki/Theil%E2%80%93Sen_estimator) provides robust linear regression in the 2D plane: +A [Theil-Sen estimator](https://en.wikipedia.org/wiki/Theil%E2%80%93Sen_estimator) provides robust, simple linear regression in the 2D plane: The resulting estimates of slope and intercept are relatively insensitive to outliers. -The present implementation of [TheilSen.m](TheilSen.m) is exact but "naive": +The implementation of [TheilSen.m](TheilSen.m) is exact but "naive": It generates the set of all pairs of the _n_ input samples, resulting in an overall complexity of _O(n²)_ in both speed and space. -The resulting slope and offset are the median slope and offset of all lines defined by the data point pairs. +The resulting slope and offset are the median slope and offset of the lines defined by all data point pairs. (Note that other implementations of the algorithm achieve better complexity, and are thus much faster for large amounts of data points.) diff --git a/TheilSen.m b/TheilSen.m index 60bba65..67897e7 100644 --- a/TheilSen.m +++ b/TheilSen.m @@ -1,8 +1,8 @@ function [b1, b0] = TheilSen(X, y) % THEILSEN performs Theil-Sen robust, simple linear regression(s) of X on y. % -% Note that multiple predictor variables in X are treated as independent -% simple regressions; don't confuse the output with multiple regression. +% Note that two or more predictor variables in X are treated as independent +% simple regressions; do not confuse the output with multiple regression. % % THEILSEN treats NaNs in X or y as missing values, and ignores them. % diff --git a/example.m b/example.m index b6c4cfb..2f792ed 100644 --- a/example.m +++ b/example.m @@ -30,7 +30,7 @@ data_y(outlr_idx) = outlr_y; est_ls = [ones(N_total, 1), data_x] \ data_y; % Estimate Theil-Sen parameters. -[m, b] = TheilSen([data_x, data_y]); +[m, b] = TheilSen(data_x, data_y); est_ts = [b, m]; % Plot everything and add comparison of estimates to title. -- GitLab