简体   繁体   English

使用 rlm 计算稳健回归的 r 平方是否合适

[英]Is it appropriate to calculate r-squared of robust regression using rlm

I am using rlm function from MASS to perform a robust regression.我正在使用 MASS 的 rlm 函数来执行稳健的回归。 Unlike lm,the summary function does not return a valure for r-squared.与 lm 不同,summary 函数不返回 r 平方的值。

Is therefore appropriate to calculate this using 1 - sum(residual^2)/(sum((Y-mean(Y))^2)?因此,使用1 - sum(residual^2)/(sum((Y-mean(Y))^2)?计算这个是否合适1 - sum(residual^2)/(sum((Y-mean(Y))^2)?

(apologies for the equation, I could not figure how to write this in a better formatted way) (为等式道歉,我不知道如何以更好的格式编写它)

Robust Linear Regression(rlm) is used instead of Linear Regression(lm) when data has many outliers;当数据有很多异常值时,使用稳健线性回归(rlm)代替线性回归(lm); also it can be used for detecting influential observations.它还可以用于检测有影响的观察结果。 Robust regression uses Iteratively Reweighted Least Squares(IRLS) for Maximum Likelihood Estimation(MLE) whereas linear regression uses Ordinary Least Squares(OLS), which is the reason R-squared(coefficient of determination) is returned by lm() and not by rlm().稳健回归使用迭代重加权最小二乘法 (IRLS) 进行最大似然估计 (MLE),而线性回归使用普通最小二乘法 (OLS),这就是 lm() 而不是 rlm 返回 R 平方(确定系数)的原因()。

Now coming to the appropriateness, it is not an appropriate measure to assess the fit for robust regression since it involves computing squared loss=sum(residual^2)=sum(predicted values-observed values)^2 in the formula for r-squared.现在谈到适当性,它不是评估稳健回归拟合的适当措施,因为它涉及计算平方损失=总和(残差^ 2)=总和(预测值 - 观察值)^ 2 在r平方的公式中. Since robust regression involves dealing with data containing many outliers, the metric will result in absurd value due to large values produced from residuals for outliers which are large and also squared!由于稳健回归涉及处理包含许多异常值的数据,因此该度量将导致荒谬的值,因为由异常值的残差产生的大值是大且平方的!
This is the reason why absolute loss=(predict-actual) is used to asses fit when outliers are involved.这就是为什么在涉及异常值时使用绝对损失=(预测 - 实际)来评估拟合的原因。

Hope this helps.希望这可以帮助。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM