Skip to content
Back to formatted view

Raw Message

Message-ID: <1324654862746-4229016.post@n4.nabble.com>
Date: 2011-12-23T15:41:02Z
From: Pascal A. Niklaus
Subject: nlrob problem
In-Reply-To: <4EEF94B1.8080009@ieu.uzh.ch>

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.