转自个人微信公众号【Memo_Cleon】的统计学习笔记:R笔记:多重线性回归(四)_稳健回归。
【1-3】数据导入>>数据初步考察与处理>>拟合多重线性回归模型
【6】稳健回归
线性回归的参数估计主要采用的是最小二乘法(又称最小平方法),该法是将使观测值与模型预测值之差的平方达到最小的值作为参数估计值。如果数据存在异常点或者异方差,最小二乘法估计会存在偏差,常用的处理策略就是改用稳健回归(Robust Regression)。稳健回归就是采用更为稳健的参数估计方法来拟合模型,所谓稳健就是数据的波动对参数估计影响不大,比如不受异常值影响,或删除某一观测后对结果影响不大。稳健估计的方法有很多,主要有这么几类:最小绝对值回归(也称最小一乘法回归,lAV),最小中位数二乘法(LMS)、最小截尾二乘法(LTS)、M估计、S估计、MM估计,这些方法在R的软件包{robustbase}均有提供。在这些方法中既能保证高的估计效率,崩溃点又可以接受的是MM法。R中提供了大量的稳健估计方法,可参见介绍https://CRAN.R-project.org/view=Robust。在线性回归的稳健估计中,能实现高效率高崩溃点估计的常用函数有rlm{MASS}、lmrob{robustbase}、lmRob{robust},但因具体算法有差异,结果也会不同。lmrob() (robustbase) and lmRob() (robust) where the former uses the latest of the fast-S algorithms and heteroscedasticity and autocorrelation corrected (HAC) standard errors, the latter makes use of the M-S algorithm of Maronna and Yohai (2000), automatically when there are factors among the predictors (where S-estimators (and hence MM-estimators) based on resampling typically badly fail). rlm() from MASS had been the first widely available implementation for robust linear models, and also one of the very first MM-estimation implementations.
本次示例是在拟合多重线性回归模型lmfit,发现有异常点之后的操作。多重线性回归的拟合与诊断请参考《模型拟合》、《适用条件的考察》以及《模型评估与诊断》。采用函数lmrob{robustbase}来实现MM稳健估计. This function computes an MM-type regression estimator as described in Yohai (1987) and Koller and Stahel (2011). By default it uses a bi-square redescending score function, and it returns a highly robust and highly effificient estimator (with 50% breakdown point and 95% asymptotic effificiency for normal errors)
rlmfit<-lmrob(bwt~age+lwt+race+smoke+ptl+ht+ui+ftv,data=lmdata,method = "MM")
summary(rlmfit)
结果如下,前半部分是模型稳健回归的结果以及模型的决定系数、校正的决定系数,解读可参考《模型拟合》,模型经过11次的IWLS(iterated re-weighted least squares )迭代便收敛了。后半部分是模型采用的一些算法。
转自个人微信公众号【Memo_Cleon】的统计学习笔记:R笔记:多重线性回归(四)_稳健回归。
END