Re: [R] nls not solving

2011-03-01 Thread Schatzi
Here is a reply by Bart: Yes you're right (I should have taken off my glasses and looked closer). However, the argument is essentially the same: Suppose you have a solution with a,b,k,l. Then for any positive c, [a+b-bc] + [bc] + (bc) *exp(kl')exp(-kx) is also a solution, where l' = l - log(c)/k

Re: [R] nls not solving

2011-03-01 Thread Peter Ehlers
On 2011-03-01 06:38, Schatzi wrote: Here is a reply by Bart: Yes you're right (I should have taken off my glasses and looked closer). However, the argument is essentially the same: Suppose you have a solution with a,b,k,l. Then for any positive c, [a+b-bc] + [bc] + (bc) *exp(kl')exp(-kx) is

[R] nls not solving

2011-02-28 Thread Schatzi
I am running the following nls equation. I tried it with data that excel was fitting and got the error: singular gradient matrix at initial parameter estimates I thought it was due to a low number of points (6), but when I create a dataset, I get the same problem. If I remove the parameter a,

Re: [R] nls not solving

2011-02-28 Thread Schatzi
By the way, sorry about the reposts. I subscribed but wasn't sure what was happening. Hopefully this worked. -- View this message in context: http://r.789695.n4.nabble.com/nls-not-solving-tp3328647p3328659.html Sent from the R help mailing list archive at Nabble.com.

Re: [R] nls not solving

2011-02-28 Thread Bert Gunter
Well, since no one else has replied, let me state the obvious: The model is nonidentifiable. It is of the form: y = a + b(1 - exp(kl)) - b exp(-kx) Suppose you have a solution. Suppose with your solution, a + b(1 -exp(kl)) = C, say. Then a = C - b(1-exp(kl)). Hence you have generated an

Re: [R] nls not solving

2011-02-28 Thread Schatzi
I am not sure how you simplified the model to: y = a + b(1 - exp(kl)) - b exp(-kx) I tried simplifying it but only got to: y = a + b - b * exp(kl) * exp(-kx) I agree that the model must not be identifiable. That makes sense, especially given that removing either a or l makes the model work. Can

Re: [R] nls not solving

2011-02-28 Thread Peter Ehlers
On 2011-02-28 14:14, Schatzi wrote: I am not sure how you simplified the model to: y = a + b(1 - exp(kl)) - b exp(-kx) I tried simplifying it but only got to: y = a + b - b * exp(kl) * exp(-kx) I agree that the model must not be identifiable. That makes sense, especially given that removing