Re: [R] nls question

2012-07-12 Thread Felipe Carrillo
gt;Cc: "r-help@r-project.org" >Sent: Thursday, July 12, 2012 1:03 PM >Subject: Re: [R] nls question > >On Thu, Jul 12, 2012 at 3:40 PM, Felipe Carrillo > wrote: >> I get a different error now: >>>  nls(weight ~ cbind(1, exp(gamma*week)), weightData, start

Re: [R] nls question

2012-07-12 Thread Bert Gunter
To add to Gabor's remarks: This has nothing to do per se with R -- it is your insufficient understanding of the underlying mathematical issues. It is pretty trivial to do the plinear algorithm by hand. Fit linear regressions weight ~ lm(weight ~z) where z is exp(gamma*week) for a suitable sequen

Re: [R] nls question

2012-07-12 Thread Gabor Grothendieck
On Thu, Jul 12, 2012 at 3:40 PM, Felipe Carrillo wrote: > 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 fac

Re: [R] nls question

2012-07-12 Thread Felipe Carrillo
px > >From: Gabor Grothendieck >To: Felipe Carrillo >Cc: Bert Gunter ; "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 > wr

Re: [R] nls question

2012-07-12 Thread Gabor Grothendieck
On Thu, Jul 12, 2012 at 3:02 PM, Felipe Carrillo 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) > > Bu

Re: [R] nls question

2012-07-12 Thread Felipe Carrillo
e California, USA http://www.fws.gov/redbluff/rbdd_jsmp.aspx > >From: Bert Gunter >To: Felipe Carrillo >Cc: "r-help@r-project.org" >Sent: Thursday, July 12, 2012 10:56 AM >Subject: Re: [R] nls question > > >Read the Help file

Re: [R] nls question

2012-07-12 Thread Bert Gunter
Read the Help file! ?nls ## Note the "control" argument ?nls.control -- Bert On Thu, Jul 12, 2012 at 10:47 AM, Felipe Carrillo wrote: > Hi: > Using nls how can I increase the numbers of iterations to go beyond 50. > I just want to be able to predict for the last two weeks of the year. > Thi

Re: [R] nls question

2012-07-12 Thread Prof Brian Ripley
See ?nls.control (referenced from ?nls). On 12/07/2012 18:47, Felipe Carrillo wrote: Hi: Using nls how can I increase the numbers of iterations to go beyond 50. I just want to be able to predict for the last two weeks of the year. This is what I have: weight_random <- runif(50,1,24)

[R] nls question

2012-07-12 Thread Felipe Carrillo
 Hi:  Using nls how can I increase the numbers of iterations to go beyond 50.  I just want to be able to predict for the last two weeks of the year.  This is what I have:  weight_random <- runif(50,1,24)  weight <- sort(weight_random);weight weightData <- data.frame(weight,week=1:50)