Skip to content
Prev 58579 / 398502 Next

Problems running a 4-parameter Weibull function with nls

Might "nls" be testing values for "lag" that exceed min(X)?  That 
might produce the error you observe. 

      I routine reparameterize problems like this to send boundaries to 
Inf, e.g.: 

      x0 <- min(df$X)     
      fit<-nls(Y ~ max.*(1 - 
exp(-(rate*(X-x0+exp(ln.lag)))^shape)),df,start=start.est, x0=x0)
      ##NOT TESTED

      (Also, I try to avoid conficts between objects / variables I use 
and, e.g., standard system functions like "max" and "df".  R can 
determine whether a function or a non-function is required in most but 
not all contexts.) 

      hope this helps. 
      spencer graves
Mike Saunders wrote: