Skip to content
Prev 278838 / 398502 Next

Negative exponential fit

rch4 <rch4 <at> geneseo.edu> writes:
I disagree with the other solutions posted here: think you're looking
not for a distribution, but for the change over time.

  You could start with 

 fit1 <- lm(log(time)~I(date-date[1]))

where the intercept will be the *log* of the intercept (value on
the first date) and the slope will be the exponential coefficient.
If you need to be more careful about your statistical assumptions
(e.g. if the variance appears to be homogeneous on the original
scale but not on the log scale) then something like

  fit2 <- nls(exp(logint)*exp(-r*(date-date[1])),
       start=...)

should work.  You need to set the starting values appropriately -- the values
from the linear fit above should be pretty good.