Can scipy.stats identify and mask obvious outliers?

后端 未结 4 643
终归单人心
终归单人心 2020-12-07 19:44

With scipy.stats.linregress I am performing a simple linear regression on some sets of highly correlated x,y experimental data, and initially visually inspecting each x,y sc

4条回答
  •  死守一世寂寞
    2020-12-07 20:09

    scipy.stats doesn't have anything directly for outliers, so as answer some links and advertising for statsmodels (which is a statistics complement for scipy.stats)

    for identifying outliers

    http://jpktd.blogspot.ca/2012/01/influence-and-outlier-measures-in.html

    http://jpktd.blogspot.ca/2012/01/anscombe-and-diagnostic-statistics.html

    http://statsmodels.sourceforge.net/devel/generated/statsmodels.stats.outliers_influence.OLSInfluence.html

    instead of masking, a better approach is to use a robust estimator

    http://statsmodels.sourceforge.net/devel/rlm.html

    with examples, where unfortunately the plots are currently not displayed http://statsmodels.sourceforge.net/devel/examples/generated/tut_ols_rlm.html

    RLM downweights outliers. The estimation results have a weights attribute, and for outliers the weights are smaller than 1. This can also be used for finding outliers. RLM is also more robust if the are several outliers.

提交回复
热议问题