curiosity---given that vector operations are so much faster than
scalar operations, would it make sense to make uniroot vectorized?  if
I read the uniroot docs correctly, uniroot() calls an external C
routine which seems to be a scalar function.  that must be slow.  I am
thinking a vectorized version would be useful for an example such as

  of <- function(x,a) ( log(x)+x+a )
  uniroot( of, c( 1e-7, 100 ), a=rnorm(1000000) )

I would have timed this, but I would have used a 'for' loop, which is
probably not the "R way" of doing this.  has someone already written a
package that does this?

/iaw

----
Ivo Welch (ivo.we...@brown.edu, ivo.we...@gmail.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.

Reply via email to