[R] making uniroot a bit more robust?

Tamas K Papp tpapp at Princeton.EDU
Fri Oct 27 22:11:46 CEST 2006


Hi,

I wonder if it would make sense to make uniroot detect zeros at the
endpoints, eg

if f(lower)==0, return lower as the root, else
if f(upper)==0, return upper as the root, else
stop if f(upper)*f(lower) > 0 (currently it stops if >=), else
proceed to the algorithm proper.

Currently I am using a wrapper function to implement this, and I found
it useful.  But I didn't want to send a (wishlist) bug report before
asking on the list...

Thanks,

Tamas



More information about the R-help mailing list