[R] Negative exponential fit

peter dalgaard pdalgd at gmail.com
Wed Nov 30 17:32:40 CET 2011


On Nov 29, 2011, at 23:19 , Ben Bolker wrote:

> rch4 <rch4 <at> geneseo.edu> writes:
> 
>> 
>> We need help....
>> 
>> We are doing a project for a statistical class in and we are looking at
>> world record times in different running events over time. We are trying to
>> fit the data with a negative exponential but we just cant seem to get a
>> function that works properly. 
>> we have on our x-axis the date and on the y-axis the time(in seconds). So as
>> you can imagine, the times have decreased and appear to be approaching a
>> limit. Any ideas for a nls function that would work for us would be greatly
>> appreciated. 
>> 
>> Rob
> 
>  I disagree with the other solutions posted here: think you're looking
> not for a distribution, but for the change over time.

Not that this is anywhere near my areas of expertise, but wouldn't you want to be even more careful than that? I mean, surely the record time is nondecreasing, and one would expect that the time between records to carry information about the issue (e.g., in a stable situation, it should increase as a lower limit is being approached)?


> 
>  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.
> 
> ______________________________________________
> R-help at r-project.org mailing list
> https://stat.ethz.ch/mailman/listinfo/r-help
> PLEASE do read the posting guide http://www.R-project.org/posting-guide.html
> and provide commented, minimal, self-contained, reproducible code.

-- 
Peter Dalgaard, Professor
Center for Statistics, Copenhagen Business School
Solbjerg Plads 3, 2000 Frederiksberg, Denmark
Phone: (+45)38153501
Email: pd.mes at cbs.dk  Priv: PDalgd at gmail.com



More information about the R-help mailing list