Please ignore my previous posting, in the meanwhile I have realised that I did not look carefully enough how nlrob works (irls), although this is pretty obvious from the code.
The only issue that remains is the case of zero weight for redescending M estimators, in which case NaN's are produced. I think it would be better if one could avoid the NaN's produced by dividing by zero when psi becomes zero. Something along the line of replacing resid <- -residuals(out)/sqrt(w) by resid <- ifelse(w>0,-residuals(out)/sqrt(w),0); There probably is a more elegant way to do this. This would avoid that one has to use na.action=na.exclude for cases where there are no NAs in the data set originally passed to nlrob (and the NAs only occur 'internally' in the code of nlrob). Hope I haven't missed something else this time... Pascal Niklaus -- View this message in context: http://r.789695.n4.nabble.com/nlrob-problem-tp4215473p4229016.html Sent from the R help mailing list archive at Nabble.com. ______________________________________________ R-help@r-project.org mailing list https://stat.ethz.ch/mailman/listinfo/r-help PLEASE do read the posting guide http://www.R-project.org/posting-guide.html and provide commented, minimal, self-contained, reproducible code.