Re: [R] what is the purpose of an error message in uniroot?

2007-02-01 Thread Chris Andrews
Matt, Some time back I didn't like the uniroot restriction either so I wrote a short function manyroots that breaks an interval into many shorter intervals and looks for a single root in each of them. This function is NOT guaranteed to find all roots in an interval even if you specify many

[R] what is the purpose of an error message in uniroot?

2007-01-31 Thread Matthew Keller
Hi all, This is probably a blindingly obvious question: Why does it matter in the uniroot function whether the f() values at the end points that you supply are of the same sign? For example: f - function(x,y) {y-x^2+1} #this gives a warning uniroot(f,interval=c(-5,5),y=0) Error in uniroot(f,

Re: [R] what is the purpose of an error message in uniroot?

2007-01-31 Thread rolf
[EMAIL PROTECTED] wrote: This is probably a blindingly obvious question: Yes, it is. Why does it matter in the uniroot function whether the f() values at the end points that you supply are of the same sign? Plot some graphs. Think about the *name* of the function