scipy.stats.mstats.siegelslopes

scipy.stats.mstats.siegelslopes(y, x=None, method='hierarchical')[source]

Computes the Siegel estimator for a set of points (x, y).

siegelslopes implements a method for robust linear regression using repeated medians to fit a line to the points (x, y). The method is robust to outliers with an asymptotic breakdown point of 50%.

Parameters
yarray_like

Dependent variable.

xarray_like or None, optional

Independent variable. If None, use arange(len(y)) instead.

method{‘hierarchical’, ‘separate’}

If ‘hierarchical’, estimate the intercept using the estimated slope medslope (default option). If ‘separate’, estimate the intercept independent of the estimated slope. See Notes for details.

Returns
medslopefloat

Estimate of the slope of the regression line.

medinterceptfloat

Estimate of the intercept of the regression line.

See also

theilslopes

a similar technique without repeated medians

Notes

For more details on siegelslopes, see scipy.stats.siegelslopes.