Skip to content
Prev 45984 / 63424 Next

RFC: a "safe" uniroot() function for future R

Indeed.  You are entirely right, and my note was wrong.
so the above is moot.
discuss the following issues:

1) the goal is to remain with one function uniroot()

2) Instead of the 'Sig' = "sign(f'(x_0))" {not quite, but typically}
   with 4 different value classes, namely
   NULL, -1, 0, 1,  (where +/- 1  are equivalent to any positive
   or negative finite number respectively),

   we should either use a string with 4 different possible values
   or a {logical or NULL}, say 'upcrossing' 
   (which also gives 4 values, NULL, NA, FALSE, TRUE).


3) [I'm not sure about this:]
   The new default of the 'Sig' replacement would correspond to
   the current  Sig = NULL  which does extend the search
   interval when that does not constitute a sign change.

   Alternatively, implicitly proposed by Ravi Varadhan, the
   default would correspond to  Sig = 0, i.e. to the current
   uniroot() behavior which signals an error as soon as the initial
   interval is not large enough.

Further opinions and suggestions for  '2)' and '3)' are still
very welcome!

Martin