[R] nls question

Gabor Grothendieck ggrothendieck at gmail.com
Thu Jul 12 21:14:06 CEST 2012


On Thu, Jul 12, 2012 at 3:02 PM, Felipe Carrillo
<mazatlanmexico at yahoo.com> wrote:
> Thanks Bert, I increased the  number of iterations:
>
> M_model <- nls(weight ~ alpha + beta*exp(gamma*week),control=nls.control(maxiter=200), weightData,
>              start = c(alpha = 0.0, beta = 1, gamma = 0.2), trace = TRUE)
>
> But now the 'start' argument seems to be the problem.
> Looking at the model coefficients:
>   alpha          beta         gamma
> -49.108008320  52.394172340   0.005269907
> If I change the alpha and beta values inside start..I still get the error...

Try using the plinear algorithm:

nls(weight ~ cbind(1, exp(gamma*week)), weightData, start = list(gamma
= 0.2), alg = "plinear")


-- 
Statistics & Software Consulting
GKX Group, GKX Associates Inc.
tel: 1-877-GKX-GROUP
email: ggrothendieck at gmail.com



More information about the R-help mailing list