Re: [R] nls() and numerical integration (e.g. integrate()) workingtogether?

2007-08-23 Thread Frede Aakmann Tøgersen
[mailto:[EMAIL PROTECTED] På vegne af Michael Lindner > Sendt: 23. august 2007 08:07 > Til: r-help@stat.math.ethz.ch > Emne: [R] nls() and numerical integration (e.g. integrate()) > workingtogether? > > Dear List-Members, > > since 3 weeks I have been heavily working on

[R] nls() and numerical integration (e.g. integrate()) working together?

2007-08-22 Thread Michael Lindner
Dear List-Members, since 3 weeks I have been heavily working on reproducing the results of an economic paper. The method there uses the numerical solution of an integral within nonlinear least squares. Within the integrand there is also some parameter to estimate. Is that in the end possible to im

[R] nls() lower/upper bound specification

2007-07-04 Thread Stephen Tucker
Dear all, In optim() all parameters of a function to be adjusted is stored in a single vector, with lower/upper bounds can be specified by a vector of the same length. In nls(), is it true that if I want to specify lower/upper bounds, functions must be re-written so that each parameter is contain

Re: [R] nls: "missing value or an infinity" (Error in numericDeriv) and"singular gradient matrix"Error in nlsModel

2007-02-13 Thread Ravi Varadhan
Original Message- From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] On Behalf Of Daniela Salvini Sent: Tuesday, February 13, 2007 4:09 PM To: r-help@stat.math.ethz.ch Subject: [R] nls: "missing value or an infinity" (Error in numericDeriv) and"singular gradient matrix"E

[R] nls: "missing value or an infinity" (Error in numericDeriv) and "singular gradient matrix"Error in nlsModel

2007-02-13 Thread Daniela Salvini
Hi, I am a non-expert user of R. I am essaying the fit of two different functions to my data, but I receive two different error messages. I suppose I have two different problems here... But, of which nature? In the first instance I did try with some different starting values for the parameters,

Re: [R] nls

2006-11-08 Thread Jost Burkardt
Xiaodong Jin <[EMAIL PROTECTED]> writes: >> y > [1] 1 11 42 64 108 173 214 > > > t > [1] 1 2 3 4 5 6 7 > > > nls(1/y ~ c*exp(-a*b*t)+1/b, start=list(a=0.001,b=250,c=5), trace=TRUE) > 29.93322 :0.001 250.000 5.000 > Error in numericDeriv(form[[3]], names(ind), env) : >

[R] nls

2006-11-07 Thread Xiaodong Jin
> y [1] 1 11 42 64 108 173 214 > t [1] 1 2 3 4 5 6 7 > nls(1/y ~ c*exp(-a*b*t)+1/b, start=list(a=0.001,b=250,c=5), trace=TRUE) 29.93322 :0.001 250.000 5.000 Error in numericDeriv(form[[3]], names(ind), env) : Missing value or an infinity produced when evaluating the

Re: [R] nls

2006-09-23 Thread Martin Maechler
> "SpG" == Spencer Graves <[EMAIL PROTECTED]> > on Sat, 23 Sep 2006 00:52:30 -0700 writes: SpG> I used "debug" to walk through your example line by line, I found SpG> that the error message was misleading. By making SpG> as.vector(semivariance) and as.vector(h) columns

Re: [R] nls

2006-09-23 Thread Spencer Graves
I used "debug" to walk through your example line by line, I found that the error message was misleading. By making as.vector(semivariance) and as.vector(h) columns of a data.frame, I got it to work. My revised code appears below. Thanks for providing a self-contained and relati

[R] nls

2006-09-12 Thread mzabalazo ngwenya
Hello everyone ! I am trying to write a short program to estimate semivariogram parameters. But I keep running into a problem when using the nls function. Could you please shed some light. I have put a sample of one of the codes and ran a short example so you see what I mean. -

[R] nls

2006-09-12 Thread mzabalazo ngwenya
Hello everyone ! I am trying to write a short program to estimate semivariogram parameters. But I keep running into a problem when using the nls function. Could you please shed some light. I have put a sample of one of the codes and ran a short example so you see what I mean. -

Re: [R] NLS and IV

2006-08-18 Thread Spencer Graves
RSiteSearch("grogger") produced nothing, which suggests that the paper you cite is NOT cited in a help page in any package contributed to CRAN. However, RSiteSearch("instrumental variables") just produced 31 hits for me, among which #11 was for "systemfit{systemfit}", which mentions "ins

Re: [R] nls convergence problem

2006-08-17 Thread Dieter Menne
Yours truly menne-biomed.de> writes: ... > Recently, a colleague fitted gastric emptying > curves using GraphPad, with 100% success, and > nls failed for one third of these. When we > checked GraphPads output more closely, some of > the coefficients looked like 2.1 with a confidence > interval i

Re: [R] nls convergence problem

2006-08-17 Thread Dieter Menne
nls not converging for zero-noise cases epamail.epa.gov> writes: > > No doubt Doug Bates would gladly accept patches ... . > The zero-noise case is irrlevant in practice, but quite often I have uttered &/(!! (vituperation filter on) when nls did not converge with real data. The dreaded "min

Re: [R] nls convergence problem

2006-08-16 Thread Setzer . Woodrow
Joerg van den Hoff <[EMAIL PROTECTED]> wrote on 08/16/2006 08:22:03 AM: > Earl F. Glynn wrote: [deleted] > > efg > > > [deleted] > (I think this is recognized by d. bates, but simply way down his 'to do' > list :-(). > > > joerg No doubt Doug Bates would gladly accept patches ... . > >

Re: [R] nls convergence problem

2006-08-16 Thread Joerg van den Hoff
Earl F. Glynn wrote: > "Berton Gunter" <[EMAIL PROTECTED]> wrote in message > news:[EMAIL PROTECTED] >>> Or, maybe there's something I don't understand about the >>> algorithm being used. >> Indeed! So before making such comments, why don't you try to learn about >> it? >> Doug Bates is a prett

Re: [R] nls convergence problem

2006-08-15 Thread Dieter Menne
Earl F. Glynn stowers-institute.org> writes: > > It's not clear to me why this problem cannot be "fixed" somehow. You You might try optim instead of nls, which always (well, as far I used it) converges. However, resulting coefficients may be totally off, and you should use profiling to check t

Re: [R] nls convergence problem

2006-08-15 Thread Earl F. Glynn
"Berton Gunter" <[EMAIL PROTECTED]> wrote in message news:[EMAIL PROTECTED] >> Or, maybe there's something I don't understand about the >> algorithm being used. > > Indeed! So before making such comments, why don't you try to learn about > it? > Doug Bates is a pretty smart guy, and I think yo

Re: [R] nls convergence problem

2006-08-15 Thread Berton Gunter
> Or, maybe there's something I don't understand about the > algorithm being used. Indeed! So before making such comments, why don't you try to learn about it? Doug Bates is a pretty smart guy, and I think you do him a disservice when you assume that he somehow overlooked something that he exp

Re: [R] nls convergence problem

2006-08-15 Thread Earl F. Glynn
"Dieter Menne" <[EMAIL PROTECTED]> wrote in message news:[EMAIL PROTECTED] > Earl F. Glynn stowers-institute.org> writes: > This toy problem is exactly what the warning is for: > > Warning > Do not use nls on artificial "zero-residual" data. > > Add some noise and try again. Thank you! I had ad

Re: [R] nls convergence problem

2006-08-15 Thread Dieter Menne
Earl F. Glynn stowers-institute.org> writes: > > Here's my toy problem: > > ?nls.control > > ?nls > > # Method 2 > > X <- 0:15 > > Y <- 9.452 * exp(-0.109*X) + 5.111 # Toy problem > > > > nls.out <- nls(Y ~ a*exp(b*X)+c, > +start=list(a=6,b=-0.5,c=1), > +control

[R] nls convergence problem

2006-08-15 Thread Earl F. Glynn
I'm having problems getting nls to agree that convergence has occurred in a toy problem. nls.out never gets defined when there is an error in nls. Reaching the maximum number of iterations is alway an error, so nls.out never gets defined when the maximum number of iterations is reched. >From

Re: [R] nls

2006-08-15 Thread Prof Brian Ripley
On Tue, 15 Aug 2006, Peter Dalgaard wrote: > Prof Brian Ripley <[EMAIL PROTECTED]> writes: > > > You problem is x^c for x = 0. If you intended only c > 1, try a starting > > value meeting that condition (but it seems that the optimal c is about > > 0.27 is you increase x slightly). > > Surely

Re: [R] nls

2006-08-15 Thread Petr Pikal
Jin wrote: Date sent: Tue, 15 Aug 2006 05:54:51 -0700 (PDT) From: Xiaodong Jin <[EMAIL PROTECTED]> To: r-help@stat.math.ethz.ch Subject: [R] nls > Is there anyway to change any y[i] value (i=2,...6) to make > f

Re: [R] nls

2006-08-15 Thread Peter Dalgaard
Prof Brian Ripley <[EMAIL PROTECTED]> writes: > You problem is x^c for x = 0. If you intended only c > 1, try a starting > value meeting that condition (but it seems that the optimal c is about > 0.27 is you increase x slightly). Surely you mean c > 0. > nls(1/y ~ a+b*x^exp(c), start=list(a=

Re: [R] nls

2006-08-15 Thread Prof Brian Ripley
You problem is x^c for x = 0. If you intended only c > 1, try a starting value meeting that condition (but it seems that the optimal c is about 0.27 is you increase x slightly). Why have you used ~~ ? (Maybe because despite being asked not to, you sent HTML mail?) On Tue, 15 Aug 2006, Xiaodo

[R] nls

2006-08-15 Thread Xiaodong Jin
Is there anyway to change any y[i] value (i=2,...6) to make following NLS workable? x <- c(0,5,10,15,20,25,30) y <- c(1.0,0.82000,0.68000,0.64000,0.7,0.68667,0.64000) lm(1/y ~~ x) nls(1/y ~~ a+b*x^c, start=list(a=1.16122,b=0.01565,c=1), trace=TRUE) #0.0920573 : 1.1612

[R] NLS and IV

2006-08-09 Thread John Janmaat
Hello All, I'm looking to test a variable in a logit model (glm(..., binomial(link="logit"))) for exogeneity (endogeneity). At this point I am planning to try implementing Jeffery Grogger's "A Simple Test for Exogeneity in Probit, Logit, and Poisson Regression Models", Economic Letters, 1990. To

Re: [R] NLS and fitting of x-values?

2006-06-26 Thread Peter Dalgaard
"Larsen, Thomas" <[EMAIL PROTECTED]> writes: > I collected eggs laid by Springtails everyday over 28 days after swich to > isotopically enriched diet. The eggs were pooled at day 7, 14, and 28 (+ day > 0 = initial value) and analyzed for isotopes. After the diet switch the > isotopic values of

[R] NLS and fitting of x-values?

2006-06-26 Thread Larsen, Thomas
I collected eggs laid by Springtails everyday over 28 days after swich to isotopically enriched diet. The eggs were pooled at day 7, 14, and 28 (+ day 0 = initial value) and analyzed for isotopes. After the diet switch the isotopic values of the adults and eggs change towards those of the new di

Re: [R] nls model singular gradient matrix parametrization

2006-06-02 Thread Mihai Nica
Prof Brian Ripley <[EMAIL PROTECTED]> To: Mihai Nica <[EMAIL PROTECTED]> CC: r-help@stat.math.ethz.ch Subject: Re: [R] nls model singular gradient matrix parametrization Date: Fri, 2 Jun 2006 07:03:02 +0100 (BST) Your model is over-parametrized: d1*exp(-gt) gives two parameters for one

Re: [R] nls model singular gradient matrix parametrization

2006-06-01 Thread Prof Brian Ripley
Your model is over-parametrized: d1*exp(-gt) gives two parameters for one constant. As a result, the least-square surface is flat in one direction, and the gradient matrix is singular. If this is the model you intended, you can simplify it by dropping d1. It is also partially linear (d) so it

[R] nls model singular gradient matrix parametrization

2006-06-01 Thread Mihai Nica
Greetings, I am having a very hard time with a nonlinear regression. The last chance is that maybe somebody can spot something wrong… The data and the model are described below: number of observations = 3030 y = [0,…,~16] D1969 = [.16,…,~70,000] mod=nls(log(D1969)~d-log(1+d1*exp(-gt+g1*y)), s

Re: [R] nls: 'data' error? (was formula error?)

2006-05-23 Thread Prof Brian Ripley
>From ?nls data: an optional data frame in which to evaluate the variables in 'formula'. >From the printout of 'Temp' it appears 'Temp' is a matrix. Assuming 'temp' is the same as 'Temp', it is not a data frame as required, and the message is consistent with feeding eval() a nu

Re: [R] nls: formula error?

2006-05-22 Thread Gabor Grothendieck
The data= argument cannot be a matrix. See ?nls On 5/22/06, H. Paul Benton <[EMAIL PROTECTED]> wrote: > So thanks for the help, > > I have a matrix (AB) which in the first column has my bin numbers so -4 - +4 > in 0.1 bin units. Then I have in the second column the frequency from some > data. I h

[R] nls: formula error?

2006-05-22 Thread H. Paul Benton
So thanks for the help, I have a matrix (AB) which in the first column has my bin numbers so -4 - +4 in 0.1 bin units. Then I have in the second column the frequency from some data. I have plotted them and they look roughly Gaussian. So I want to fit them/ find/optimize "mu", "sigma", and "A". S

Re: [R] nls & fitting

2006-05-22 Thread Joerg van den Hoff
Lorenzo Isella wrote: > Dear All, > I may look ridiculous, but I am puzzled at the behavior of the nls with > a fitting I am currently dealing with. > My data are: > >x N > 1 346.4102 145.428256 > 2 447.2136 169.530634 > 3 570.0877 144.081627 > 4 721.1103 106.363316 > 5 8

Re: [R] nls & fitting

2006-05-21 Thread Gabor Grothendieck
You have nearly as many parameters as data points which may cause fundamental problem singularity problems but one thing to try, just in case, is to transform it to unconstrained. For example, let A1 = 0.1 + A1x^2 and then substitute A1 with the right hand side so that it becomes a function o

[R] nls & fitting

2006-05-21 Thread Lorenzo Isella
Dear All, I may look ridiculous, but I am puzzled at the behavior of the nls with a fitting I am currently dealing with. My data are: x N 1 346.4102 145.428256 2 447.2136 169.530634 3 570.0877 144.081627 4 721.1103 106.363316 5 894.4272 130.390552 6 1264.9111 36.727069 7

Re: [R] nls and factor

2006-04-26 Thread Christian Ritz
Hi Manuel, an alternative to the approach pointed out by Prof. Ripley is to use the package 'drc' which allows one or more parameters in a non-linear regression model to depend on a factor. You will need the latest version available at www.bioassay.dk (an older version is available on CRAN).

Re: [R] nls and factor

2006-04-25 Thread Manuel Gutierrez
Thanks, it was actually p.249, at least in my MASS3. but that solved my doubt. I've have another doubt, can this factor interact with one of the parameters in the model? My problem is basically a Michaelis Menten term, where this factor determines a different Km. The rest of the parameters in the

Re: [R] nls and factor

2006-04-20 Thread Prof Brian Ripley
On Thu, 20 Apr 2006, Manuel Gutierrez wrote: > Is it possible to include a factor in an nls formula? Yes. What do you intend by it? If you mean what it would mean for a lm formula, you need A[a] and starting values for A. There's an example on p.219 of MASS4. > I've searched the help pages w

Re: [R] nls and factor

2006-04-20 Thread Manuel Gutierrez
Thanks Andrew. I am now trying but without much success. I don't now how to give start values for the factor?. Could you give me an example solution with my toy example? a<-as.factor(c(rep(1,50),rep(0,50))) independ<-1:100 respo<-rep(NA,100) respo[a==1]<-(independ[a==1]^2.3)+2 respo[a==0]<-(indepe

Re: [R] nls and factor

2006-04-20 Thread Andrew Robinson
Manuel, I don't think that it works very easily. Instead, try gnls() in the nlme package. Cheers Andrew On Thu, Apr 20, 2006 at 11:18:02AM +0200, Manuel Gutierrez wrote: > Is it possible to include a factor in an nls formula? > I've searched the help pages without any luck so I > guess it is n

[R] nls and factor

2006-04-20 Thread Manuel Gutierrez
Is it possible to include a factor in an nls formula? I've searched the help pages without any luck so I guess it is not feasible. I've given it a few attempts without luck getting the message: + not meaningful for factors in: Ops.factor(independ^EE, a) This is a toy example, my realworld case is

[R] nls - nonlinear regression

2006-04-18 Thread Sachin J
Hi, I am trying to run the following nonlinear regression model. > nreg <- nls(y ~ exp(-b*x), data = mydf, start = list(b = 0), alg = "default", trace = TRUE) OUTPUT: 24619327 : 0 24593178 : 0.0001166910 24555219 : 0.0005019005 24521810 : 0.001341571 245

[R] nls: formula length greater than 502

2006-03-13 Thread Cal Stats
Hi , I am using nls(formula) where formula is y~ _expression y is 1 character ~ is 1 character now i have an _expression that is greater tha 502 characters. but R does not recognize anything greater than 502 characters. (Note the _expression itself is created using pas

[R] nls formula length : how to accomodate length greater than 502

2006-03-13 Thread Cal Stats
Hi , I am using nls(formula) where formula is y~ expression y is 1 character ~ is 1 character now i have an expression that is greater tha 502 characters. but R does not recognize anything greater than 502 characters. (Note the expression itself is created using paste

[R] nls formula length : how to accomodate length greater than 502

2006-03-13 Thread Cal Stats
Hi , I am using nls(formula) where formula is y~ expression y is 1 character ~ is 1 character now i have an expression that is greater tha 502 characters. but R does not recognize anything greater than 502 characters. (Note the expression itself is created using paste

Re: [R] nls number of explantory variables

2006-03-13 Thread Christoph Buser
Hi Harsh As indicated in the answer to your first post, it is not so easy to debug code without the code itself. 1) Have you checked the names of your variables so that you are sure that they are correct. For example undesired white space due to the automatic creation of variable names with

[R] nls number of explantory variables

2006-03-12 Thread Cal Stats
Hi.. is there a limit on the number of explanatory variables in nls ? i have a dataframe with the columns names x1,x2..,x300 when i run nls it gives the error: " x181 not found" thought it does run when i have x1,x2,...,x170 variables. Thanks Harsh

Re: [R] nls start values

2006-03-12 Thread Sundar Dorai-Raj
uessing.) > > > > > Charles Annis, P.E. > > [EMAIL PROTECTED] > phone: 561-352-9699 > eFax: 614-455-3265 > http://www.StatisticalEngineering.com > > > -Original Message- > From: [EMAIL PROTECTED] > [mailto:[EMAIL PROTECTED] On Behalf Of C

Re: [R] nls start values

2006-03-11 Thread Cal Stats
Charles Annis, P.E. [EMAIL PROTECTED] phone: 561-352-9699 eFax: 614-455-3265 http://www.StatisticalEngineering.com -Original Message- From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] On Behalf Of Cal Stats Sent: Saturday, March 11, 2006 3:43 PM To: r-help@stat.math.ethz.ch Subject: [R] nls s

Re: [R] nls start values

2006-03-11 Thread Charles Annis, P.E.
--Original Message- From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] On Behalf Of Cal Stats Sent: Saturday, March 11, 2006 3:43 PM To: r-help@stat.math.ethz.ch Subject: [R] nls start values Hi, I have a large number of parameters to estimate in nls say 100: beta1--beta100 lets say

[R] nls start values

2006-03-11 Thread Cal Stats
Hi, I have a large number of parameters to estimate in nls say 100: beta1--beta100 lets say i have 100 values in a vector is there a way where i can create the start vector for nls using a loop instead of individually filling the 100 values. Thanks Harsh

Re: [R] nls problem

2005-12-20 Thread Prof Brian Ripley
On Tue, 20 Dec 2005, Weijie Cai wrote: > Hi list, > > I tried to use nls to do some nonlinear least square fitting on my data with > 340 observations and 10 variables, but as I called nls() function, I got > this error message: > Error in qr.qty(QR, resid) : 'qr' and 'y' must have the same number

[R] nls problem

2005-12-20 Thread Weijie Cai
Hi list, I tried to use nls to do some nonlinear least square fitting on my data with 340 observations and 10 variables, but as I called nls() function, I got this error message: Error in qr.qty(QR, resid) : 'qr' and 'y' must have the same number of rows Then I traced back a little bit into nls(

[R] nls and weighting

2005-11-30 Thread Joerg van den Hoff
I posted this a week ago on r-devel but to no avail and hope this not considered cross-posting: ===cut=== hi everybody, which each release I hope that the section "weights: an optional numeric vector of (fixed) weights. When present,

Re: [R] nls() fit to Kahnemann/ Tversky function

2005-10-31 Thread Gabor Grothendieck
Note that a simple logistic with a saturation level of 1 seems to do quite well. Below we have removed the last point in order to avoid the singularity: x <- p.kum[-10] y <- felt.prob.kum[-10] plot(log(y/(1-y)) ~ x) abline(lm(log(y/(1-y)) ~ x), col = "red") On 10/31/05, Mark Hempelmann <[EMAIL P

Re: [R] nls() fit to Kahnemann/ Tversky function

2005-10-31 Thread apjaworski
math.ethz.ch Subject [R] nls() fit to Kahnemann/ Tversky 10/31/2005 04:14 function

[R] nls() fit to Kahnemann/ Tversky function

2005-10-31 Thread Mark Hempelmann
Dear WizaRds, I would like to fit a curve to ten points with nls() for one unknown parameter gamma in the Kahnemann/ Tversky function, but somehow it won't work and I am unable to locate my mistake. p.kum <- seq(0.1,1, by=0.1) felt.prob.kum <- c(0.16, 0.23, 0.36, 0.49, 0.61, 0.71, 0.85, 0.

Re: [R] nls and na/Nan/Inf error

2005-09-26 Thread Prof Brian Ripley
This works if you omit the deriv() step. Use R's options(error=dump.frames) and debugger(). This gives Browse[1]> rhs [1] 0.433 0.4272571 0.3994105 0.3594037 0.3270730 0.3104752 0.3000927 [8] 0.2928445 0.2874249 0.2831787 attr(,"gradient") VrVm alphalamd

Re: [R] nls and na/Nan/Inf error

2005-09-26 Thread Gabor Grothendieck
Use a grid search to get the starting values in which case you will likely be close enough that you won't run into problems even without derivatives: attach(fldgd) grid <- expand.grid(Vr = seq(0,.3,.1), Vm = seq(.45, 1, .05), alpha = seq(1,2,.25), lamda = seq(1,2,.25)) ss <- function(p) su

[R] nls and na/Nan/Inf error

2005-09-25 Thread Tony Meissner
I am trying to it a particular nonlinear model common in Soil Science to moisture release data from soil. I have written the function as shown below according to the logist example in Ch8 of Pinheiro & Bates. I am getting the following error (R version 2.1.1) *Error in qr(attr(rhs, "gradient"

Re: [R] nls()

2005-09-19 Thread Spencer Graves
I have passed the identities and values of fixed parameters via the "..." arguments in optim; I don't know about nls. Then internal to the function that optim is to minimize, I combine the "x" argument with the fixed parameters to obtain the full set of parameters. I've used that e

[R] nls()

2005-09-14 Thread J.M. Breiwick
Hi, I am using nls() with the form: nls(~my.fcn(...)) because I have to iteratively compute the expected y values. The function my.fcn() returns y.obs-y.pred However, I want to fix some of the parameters in my.fcn at various values and compute the parameter estimates. In Splus there is such a

Re: [R] nls

2005-07-19 Thread Gabor Grothendieck
On 7/19/05, [EMAIL PROTECTED] <[EMAIL PROTECTED]> wrote: > Dear R-helpers, > > I am trying to estimate a model that I am proposing, which consists of putting > an extra hidden layer in the Markov switching models. In the simplest case the > S(t) - Markov states - and w(t) - the extra hidden variab

[R] nls

2005-07-19 Thread ekhous
Dear R-helpers, I am trying to estimate a model that I am proposing, which consists of putting an extra hidden layer in the Markov switching models. In the simplest case the S(t) - Markov states - and w(t) - the extra hidden variables - are independent, and w(t) is constant. Formally the model loo

Re: [R] nls(): Levenberg-Marquardt, Gauss-Newton, plinear - PI curve fitting

2005-06-21 Thread Douglas Bates
On 6/21/05, Manuel Morales <[EMAIL PROTECTED]> wrote: > On Tue, 2005-06-21 at 06:57 -0400, Gabor Grothendieck wrote: > > On 6/21/05, Christfried Kunath <[EMAIL PROTECTED]> wrote: > > > Hello, > > > > > > i have a problem with the function nls(). > > > > > > This are my data in "k": > > >V1

Re: [R] nls(): Levenberg-Marquardt, Gauss-Newton, plinear - PI curve fitting

2005-06-21 Thread Manuel Morales
On Tue, 2005-06-21 at 06:57 -0400, Gabor Grothendieck wrote: > On 6/21/05, Christfried Kunath <[EMAIL PROTECTED]> wrote: > > Hello, > > > > i have a problem with the function nls(). > > > > This are my data in "k": > >V1V2 > > [1,]0 0.367 > > [2,] 85 0.296 > > [3,] 122 0.260

Re: [R] nls(): Levenberg-Marquardt, Gauss-Newton, plinear - PI curve fitting

2005-06-21 Thread Douglas Bates
On 6/21/05, Gabor Grothendieck <[EMAIL PROTECTED]> wrote: > On 6/21/05, Gabor Grothendieck <[EMAIL PROTECTED]> wrote: > > On 6/21/05, Christfried Kunath <[EMAIL PROTECTED]> wrote: > > > Hello, > > > > > > i have a problem with the function nls(). > > > > > > This are my data in "k": > > >V1

Re: [R] nls(): Levenberg-Marquardt, Gauss-Newton, plinear - PI curve fitting

2005-06-21 Thread Gabor Grothendieck
On 6/21/05, Gabor Grothendieck <[EMAIL PROTECTED]> wrote: > On 6/21/05, Christfried Kunath <[EMAIL PROTECTED]> wrote: > > Hello, > > > > i have a problem with the function nls(). > > > > This are my data in "k": > >V1V2 > > [1,]0 0.367 > > [2,] 85 0.296 > > [3,] 122 0.260 > >

Re: [R] nls(): Levenberg-Marquardt, Gauss-Newton, plinear - PI curve fitting

2005-06-21 Thread Gabor Grothendieck
On 6/21/05, Christfried Kunath <[EMAIL PROTECTED]> wrote: > Hello, > > i have a problem with the function nls(). > > This are my data in "k": >V1V2 > [1,]0 0.367 > [2,] 85 0.296 > [3,] 122 0.260 > [4,] 192 0.244 > [5,] 275 0.175 > [6,] 421 0.140 > [7,] 603 0.093 > [

Re: [R] nls(): Levenberg-Marquardt, Gauss-Newton, plinear - PI curve fitting

2005-06-21 Thread Berwin A Turlach
G'day Chris, > "CK" == Christfried Kunath <[EMAIL PROTECTED]> writes: CK> With the nls()-function i want to fit following formula CK> whereas a,b, and c are variables: y~1/(a*x^2+b*x+c) CK> [...] CK> The algorithm "plinear" give me following error: The algorithm "plinear" is

[R] nls(): Levenberg-Marquardt, Gauss-Newton, plinear - PI curve fitting

2005-06-21 Thread Christfried Kunath
Hello, i have a problem with the function nls(). This are my data in "k": V1V2 [1,]0 0.367 [2,] 85 0.296 [3,] 122 0.260 [4,] 192 0.244 [5,] 275 0.175 [6,] 421 0.140 [7,] 603 0.093 [8,] 831 0.068 [9,] 1140 0.043 With the nls()-function i want to fit following for

Re: [R] nls(() and trace

2005-06-01 Thread Douglas Bates
joerg van den hoff wrote: > hi everybody, > > is there a canonical way to get hold of the "trace=TRUE" output from > nls, i.e. to copy it to a R variable (or at least to an external log file)? > > I have only found the possibility to "fix(nlsModel)" (and than the > correct copy of that: namespace

[R] nls(() and trace

2005-06-01 Thread joerg van den hoff
hi everybody, is there a canonical way to get hold of the "trace=TRUE" output from nls, i.e. to copy it to a R variable (or at least to an external log file)? I have only found the possibility to "fix(nlsModel)" (and than the correct copy of that: namespace function ...) within the R-session

Re: [R] nls error in formula

2005-04-18 Thread Anaid Diaz
thank you, it worked. Sylvia --- Douglas Bates <[EMAIL PROTECTED]> wrote: > Anaid Diaz wrote: > > Hi, > > I'm a new R user, with a lot of questions. At the > > moment I'm stoped on an error traying to fit a > model: > > > > > >>x <- sandeel ## numeric data (2500-6) > >>y <- Noss ## numeric

Re: [R] nls error in formula

2005-04-18 Thread Douglas Bates
Anaid Diaz wrote: Hi, I'm a new R user, with a lot of questions. At the moment I'm stoped on an error traying to fit a model: x <- sandeel ## numeric data (2500-6) y <- Noss ## numeric data (0-1.2) A <- 0.8 B <- 0.6 C <- 1/4 nls( y ~ A-B*exp(-C*x)) Error in match.call(definition, call,

[R] nls error in formula

2005-04-18 Thread Anaid Diaz
Hi, I'm a new R user, with a lot of questions. At the moment I'm stoped on an error traying to fit a model: > x <- sandeel ## numeric data (2500-6) > y <- Noss ## numeric data (0-1.2) > A <- 0.8 > B <- 0.6 > C <- 1/4 > nls( y ~ A-B*exp(-C*x)) Error in match.call(definition, call, expand

RE: [R] nls segmented model with unknown joint points

2005-04-16 Thread andy
(a41 - x, 0)^2 + b44*pmax(a42 - x, 0)^2 > > You mention nlm, too. Here you would use a function rather than a > formula, but the idea is the same. > > V. > > -Original Message- > From: [EMAIL PROTECTED] > [mailto:[EMAIL PROTECTED] On Behalf Of andy > Sent: Su

RE: [R] nls segmented model with unknown joint points

2005-04-16 Thread Bill.Venables
OTECTED] [mailto:[EMAIL PROTECTED] On Behalf Of andy Sent: Sunday, 17 April 2005 1:09 PM To: r-help@stat.math.ethz.ch Subject: [R] nls segmented model with unknown joint points Hello, I am interested in fitting a segmented model with unknown joint points in nls and perhaps eventually in nlme. I can f

[R] nls segmented model with unknown joint points

2005-04-16 Thread andy
Hello, I am interested in fitting a segmented model with unknown joint points in nls and perhaps eventually in nlme. I can fit this model in sas (see below, joint points to be estimated are a41 and a41), but am unsure how to specify this in the nlm function. I would really appreciate any suggest

Re: [R] nls() and "singular grandient"

2005-03-22 Thread Spencer Graves
Many people could help you, but the question is too general. In brief, it means that the algorithm has found a place where the (estimated?) matrix of first or second partial derivatives is of reduced rank, and it refuses to do more. For such problems, I often use "optim". If you ne

[R] nls() and "singular grandient"

2005-03-22 Thread Guillaume STORCHI
Hello, I have a problem with nls() when I want to fit a model with more than two parameters to be fitted which are written as start=list(a1=,a2=,a3=,...). Everytime, it displays:'error... singular gradient' it's a real pain!!! Hope sb knows something about this Thanks GS _

Re: [R] nls - convergence problem

2005-01-07 Thread Spencer Graves
Hi, Doug: How would you diagnose something like this? For example, might the following (from ?nlsModel) help: DNase1 <- DNase[ DNase$Run == 1, ] mod <- nlsModel(density ~ SSlogis( log(conc), Asym, xmid, scal ), DNase1, start=list( Asym = 3, xmid = 0, scal = 1 )

Re: [R] nls - convergence problem

2005-01-07 Thread Douglas Bates
[EMAIL PROTECTED] wrote: Dear list, I do have a problem with nls. I use the following data: test time conc dose 0.50 5.401 0.75 11.101 1.00 8.401 1.25 13.801 1.50 15.501 1.75 18.001 2.00 17.001 2.50 13.901 3.00 11.201 3.50 9.

[R] nls - convergence problem

2005-01-06 Thread [EMAIL PROTECTED]
Dear list, I do have a problem with nls. I use the following data: >test time conc dose 0.50 5.401 0.75 11.101 1.00 8.401 1.25 13.801 1.50 15.501 1.75 18.001 2.00 17.001 2.50 13.901 3.00 11.201 3.50 9.901 4.00 4.70

RE: [R] nls question

2004-12-16 Thread christian_mora
Mike nlsList from nlme library can fit nonlinear models for dataset grouped by some specification, e.g. by specie in your case Regards Christian >-- Mensaje Original -- >From: "Mike Saunders" <[EMAIL PROTECTED]> >To: "R Help" <[EMAIL PROTECTED]> >Date:

[R] nls question

2004-12-16 Thread Mike Saunders
Just a quick question. Is there a way to easily specify factor levels in a function definition within nls? For example, I am trying to fit a 3 parameter, nonlinear Weibull function to tree height and I would like to have results by species (or down the road a bit, by plot). I am hoping there

Re: [R] nls() error: Object not found

2004-11-30 Thread Douglas Bates
Yang, Richard wrote: Dear R-helpers; Using nls() to fit a function,Rdum, defined below I stumbled on an error: "Error in eval(expr, envir, enclos): Object "s0" not found." The function Rdum is defined as Rdum <- deriv(~ h1 * (s0 + sl0*sl + sm0*sm + sp01*sp1 + sp02*sp2 + sp03*sp3+sp

[R] nls() error: Object not found

2004-11-30 Thread Yang, Richard
Dear R-helpers; Using nls() to fit a function,Rdum, defined below I stumbled on an error: "Error in eval(expr, envir, enclos): Object "s0" not found." The function Rdum is defined as Rdum <- deriv(~ h1 * (s0 + sl0*sl + sm0*sm + sp01*sp1 + sp02*sp2 + sp03*sp3+sp04*sp4) *

Re: [R] nls fitting problems (singularity)

2004-06-30 Thread Peter Dalgaard
Douglas Bates <[EMAIL PROTECTED]> writes: > Often when nls doesn't converge there is a good reason for it. > > I'm on a very slow internet connection these days and will not be able > to look at the data myself but I ask you to bear in mind that, when > dealing with nonlinear models, there are mo

Re: [R] nls fitting problems (singularity)

2004-06-30 Thread Douglas Bates
Often when nls doesn't converge there is a good reason for it. I'm on a very slow internet connection these days and will not be able to look at the data myself but I ask you to bear in mind that, when dealing with nonlinear models, there are model/data set combinations for which there are no pa

Re: [R] nls fitting problems (singularity)

2004-06-29 Thread Gabor Grothendieck
Have a look at optim (which supports a number of different algorithms via the method= arg) and segmented in package segmented which does segmented regression. For example, ss <- function(par) { b <- par[1]; c1 <- par[2]; c2 <- par[3]; d <- par[4] x <- df1$x; y <- df1$y su

[R] nls fitting problems (singularity)

2004-06-29 Thread Karl Knoblick
Hallo! I have a problem with fitting data with nls. The first example with y1 (data frame df1) shows an error, the second works fine. Is there a possibility to get a fit (e.g. JMP can fit also data I can not manage to fit with R). Sometimes I also got an error singularity with starting parameter

Re: [R] nls and R scoping rules

2004-06-10 Thread Luke Tierney
On Thu, 10 Jun 2004, Prof Brian Ripley wrote: > On Thu, 10 Jun 2004, Prof Brian Ripley wrote: > > > Around R 1.2.x the notion was introduced that variables should be looked > > for in the environment of a formula. Functions using model.frame got > > converted to do that, but nls did not. I gu

Re: [R] nls and R scoping rules

2004-06-10 Thread Prof Brian Ripley
On Thu, 10 Jun 2004, joerg van den hoff wrote: > Prof Brian Ripley wrote: > > >On Thu, 10 Jun 2004, Prof Brian Ripley wrote: > > > > > > > >>Around R 1.2.x the notion was introduced that variables should be looked > >>for in the environment of a formula. Functions using model.frame got > >>c

Re: [R] nls and R scoping rules

2004-06-10 Thread joerg van den hoff
Prof Brian Ripley wrote: On Thu, 10 Jun 2004, Prof Brian Ripley wrote: Around R 1.2.x the notion was introduced that variables should be looked for in the environment of a formula. Functions using model.frame got converted to do that, but nls did not. I guess that the best way forward is to

Re: [R] nls and R scoping rules

2004-06-10 Thread Prof Brian Ripley
On Thu, 10 Jun 2004, Prof Brian Ripley wrote: > Around R 1.2.x the notion was introduced that variables should be looked > for in the environment of a formula. Functions using model.frame got > converted to do that, but nls did not. I guess that the best way forward > is to ensure that nls (a

  1   2   >