I get a different error now:
>  nls(weight ~ cbind(1, exp(gamma*week)), weightData, start = list(gamma= 
>0.2), alg = "plinear")
Error in nls(weight ~ cbind(1, exp(gamma * week)), weightData, start = 
list(gamma = 0.2),  : 
  step factor 0.000488281 reduced below 'minFactor' of 0.000976562
The help file says: ........When start is missing, a very cheap guess for start 
is tried (if algorithm != "plinear"). 

So I removed  'plinear' from the call and got the following:
 nls(weight ~ cbind(1, exp(gamma*week)), weightData,start = 
list(gamma=0.2),trace=TRUE)
1466475181 :  0.2 
Error in qr.qty(QR, resid) : 
  'qr' and 'y' must have the same number of rows


Felipe D. Carrillo
Supervisory Fishery Biologist
Department of the Interior
US Fish & Wildlife Service
California, USA
http://www.fws.gov/redbluff/rbdd_jsmp.aspx



>________________________________
>From: Gabor Grothendieck <ggrothendi...@gmail.com>
>To: Felipe Carrillo <mazatlanmex...@yahoo.com> 
>Cc: Bert Gunter <gunter.ber...@gene.com>; "r-help@r-project.org" 
><r-help@r-project.org> 
>Sent: Thursday, July 12, 2012 12:14 PM
>Subject: Re: [R] nls question
>
>On Thu, Jul 12, 2012 at 3:02 PM, Felipe Carrillo
><mazatlanmex...@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
>
>
>
        [[alternative HTML version deleted]]

______________________________________________
R-help@r-project.org mailing list
https://stat.ethz.ch/mailman/listinfo/r-help
PLEASE do read the posting guide http://www.R-project.org/posting-guide.html
and provide commented, minimal, self-contained, reproducible code.

Reply via email to