[R] nls problem: singular gradient

2012-07-12 Thread John C Nash
ace=TRUE) -- Best, JN On 07/12/2012 06:00 AM, r-help-requ...@r-project.org wrote: > From: Jonas Stein > To: > Subject: [R] nls problem: singular gradient > Message-ID: > Content-Type: text/plain > > Why fails nls with "singular gradient&qu

Re: [R] nls problem: singular gradient

2012-07-12 Thread peter dalgaard
On Jul 11, 2012, at 20:34 , Jonas Stein wrote: >> Take a look at the predicted values at your starting fit: there's a >> discontinuity at 0.4, which sure makes it look as though overflow is >> occurring. I'd recommend expanding tanh() in terms of exponentials and >> rewrite the prediction in

Re: [R] nls problem: singular gradient

2012-07-12 Thread Jonas Stein
On 07/12/2012 01:39 AM, Duncan Murdoch wrote: On 12-07-11 2:34 PM, Jonas Stein wrote: Take a look at the predicted values at your starting fit: there's a discontinuity at 0.4, which sure makes it look as though overflow is occurring. I'd recommend expanding tanh() in terms of exponentials and re

Re: [R] nls problem: singular gradient

2012-07-11 Thread Duncan Murdoch
On 12-07-11 2:34 PM, Jonas Stein wrote: Take a look at the predicted values at your starting fit: there's a discontinuity at 0.4, which sure makes it look as though overflow is occurring. I'd recommend expanding tanh() in terms of exponentials and rewrite the prediction in a way that won't over

Re: [R] nls problem: singular gradient

2012-07-11 Thread Jonas Stein
> Take a look at the predicted values at your starting fit: there's a > discontinuity at 0.4, which sure makes it look as though overflow is > occurring. I'd recommend expanding tanh() in terms of exponentials and > rewrite the prediction in a way that won't overflow. > > Duncan Murdoch Hi Du

Re: [R] nls problem: singular gradient

2012-07-11 Thread Duncan Murdoch
On 11/07/2012 11:04 AM, Jonas Stein wrote: Why fails nls with "singular gradient" here? I post a minimal example on the bottom and would be very happy if someone could help me. Take a look at the predicted values at your starting fit: there's a discontinuity at 0.4, which sure makes it look a

[R] nls problem: singular gradient

2012-07-11 Thread Jonas Stein
Why fails nls with "singular gradient" here? I post a minimal example on the bottom and would be very happy if someone could help me. Kind regards, ### # define some constants smallc <- 0.0001 t <- seq(0,1,0.001) t0 <- 0.5 tau1 <- 0.02 # generate yy(t) yy <- 1/2 * ( 1- tanh((t - t0)/sm