Re: [R] Biexponential Fit

2009-04-09 Thread Peter Dalgaard
Jonas Weickert wrote: Hi, I want to do a biexponential Fit, i.e. y ~ A1*exp(k1*x) + A2*exp(k2*x) Is this possible? I tried nls() but it stopped with several (different) errors. I'm using y and x as simple vectors and the formula for nls() exactly as mentioned above. Yes, it is possible,

[R] Biexponential Fit

2009-04-09 Thread Jonas Weickert
Hi, I want to do a biexponential Fit, i.e. y ~ A1*exp(k1*x) + A2*exp(k2*x) Is this possible? I tried nls() but it stopped with several (different) errors. I'm using y and x as simple vectors and the formula for nls() exactly as mentioned above. Thanks a lot! Jonas

Re: [R] Biexponential Fit

2009-04-09 Thread Jonas Weickert
Thank you! Now it's working. Peter Dalgaard schrieb: Jonas Weickert wrote: Hi, I want to do a biexponential Fit, i.e. y ~ A1*exp(k1*x) + A2*exp(k2*x) Is this possible? I tried nls() but it stopped with several (different) errors. I'm using y and x as simple vectors and the formula for

Re: [R] Biexponential Fit

2009-04-09 Thread Katharine Mullen
Using algorithm=plinear as shown by example below makes sum-of-exponentials fitting problems better conditioned. A1 - 1 A2 - 2 k1 - -.5 k2 - -2 x - seq(1,10,length=200) y - A1*exp(k1*x) + A2*exp(k2*x) + .001*rnorm(200) aa - nls(y~cbind(exp(k1*x), exp(k2*x)), algorithm=plinear,