0

I am a newbie in statistics. I have collected data for a parameter Y at different time t. I would like to fit a function $ Y=A(1-e^{-t/B})$. I have to determine A and B. I am not able to use conventional methods.

P.S. The function is asymptotic to a line $Y=A$ or you can say that $Y$ will attain the value $A$ at time infinity.

Wings
  • 1
  • 3
  • This a FAQ with many detailed answers: see https://stats.stackexchange.com/search?q=nonlinear+regression+exp and [curve fitting](https://stats.stackexchange.com/search?q=fit*+curve+exp*). – whuber Nov 06 '19 at 13:43
  • mine is a bit different, I guess. not able to handle the term: $(1-exp(-t/B))$ – Wings Nov 06 '19 at 13:53
  • I selected the duplicates because they explicitly handle that case. – whuber Nov 06 '19 at 13:55
  • @whuber, the first one you suggested has an exactly same plot of fit, but I do not want it through R. I want to write my own code. – Wings Nov 06 '19 at 14:54
  • That's laudable--but how to write your own code is not on topic here. I'm pretty sure you can find posts about nonlinear regression that don't use any "package" at all: they implement the solution using basic numerical methods available in almost any scientific or statistical computing platform or they describe the solutions mathematically. You may find some of those useful guides to your own work. – whuber Nov 06 '19 at 19:07
  • @whuber Thank you. Still searching. :) – Wings Nov 08 '19 at 04:33
  • I have posted at least two examples of nonlinear fitting that do not use any specialized capability of `R`. Both rely on having a nonlinear multivariate optimization routine available (provided as `nlm` in base `R`). (If you're not familiar with that, study the relevant chapters in *Numerical Recipes.*) The code is at https://stats.stackexchange.com/a/70922/919 and https://stats.stackexchange.com/a/292749/919. An example of a univariate problem is posted at https://stats.stackexchange.com/a/140329/919, using the `optimize` function in `R`. – whuber Nov 12 '19 at 14:08

0 Answers0