function for robust regression:% % res: vector of residualspublic static double Hueber(double[] residuals, double scale, double param) //Calculation offor a given range using Huber's weights
我正在使用朗教授()的小组讨论包中的来拟合介于(混合效应)的模型。par(mfrow=c(3,2))plot(fit1, which = 5, type = "deviance", sub.caption = "")
plot(fit1, which = 1, type = "deviance", sub.caption = "
权重应该是残差的倒数,但由于-1 < residuals < 1,这只是一个例子,我同意使用残差作为权重。divided by the total sum of the inverse of the squared residuals.& WEIGHTS alpha, intercept, residuals= res.x[0], res.x[1], res.fun
weights