Re: [R] Solve f(x) = 0

2005-06-08 Thread Achim Zeileis
On Wed, 8 Jun 2005 17:08:35 +0200 Fredrik Thuring wrote: Hi! I´m need a function that solves the equation f(x) = 0 (i.e. the root of the function) when f is a nonlinear function. Is there any? I´ve tried nlm and optim on the square of the function but the solution is very unstable. Look

Re: [R] Solve f(x) = 0

2005-06-08 Thread Martyn Plummer
On Wed, 2005-06-08 at 17:08 +0200, Fredrik Thuring wrote: Hi! Im need a function that solves the equation f(x) = 0 (i.e. the root of the function) when f is a nonlinear function. Is there any? Ive tried nlm and optim on the square of the function but the solution is very unstable. Your

Re: [R] Solve f(x) = 0

2005-06-08 Thread Spencer Graves
Have you plotted f(x)? Plot(s) might help reveal why the solution is very unstable. If f is a function of a univariate x, this is trivial. If f is a function of a bivariate x, use something like contour or persp. If higher dimensions, I might use something like fit -