Help using Base SAS procedures

how to find an asymptote from a scatter plot

Accepted Solution Solved
Reply
Contributor
Posts: 30
Accepted Solution

how to find an asymptote from a scatter plot

Hi,

I'm trying to determine the speed that a runner reaches at the end of a 3min all out effort.  I have collected time and speed (at that given time) and when plotted on a scatter plot, it looks like it goes to an asymptote.  Is there a procedure in SAS that can determine that asymptote speed?  I wanted to use PROC NLIN but I don't know the function so I looked into PROC TRANSREG and the spline sometimes gives me the asymptote but sometimes it curves up at the end... Theoretically, it should be a smooth exponential decay or inverse curse from time zero to time (>3min).

here are my data...

time(s)speed (m/s)
7.86.41
11.466.83
15.116.85
31.46.37
34.97.14
396.10
43.785.23
48.145.73
52.775.40
57.84.97
62.35.56
67.15.21
72.24.90
76.65.68
81.45.21
87.753.94
92.894.86
98.054.84
103.84.35
109.14.72
114.34.81
119.94.46
124.85.10
130.24.63
136.63.91
1424.63
147.714.38
153.24.55
158.74.55
164.34.46
169.94.46
175.14.81
180.44.72

any help will be great!

thanks!

ming


Accepted Solutions
Solution
‎08-01-2013 10:05 PM
Respected Advisor
Posts: 4,651

Re: how to find an asymptote from a scatter plot

Try

proc nlin data=test;
parms Vo=2.5 a=-0.017 Vf=4.5;
model speed = Vo*exp(a*seconds) + Vf;
output out=outTest predicted=predSpeed;
run;

proc sgplot data=outTest noautolegend;
series x=seconds y=predSpeed;
scatter x=seconds y=speed;
yaxis min=0;
run;

Initial speed is Vo + Vf. Asymptotic speed is Vf.

                                          Approx       Approximate 95% Confidence
            Parameter      Estimate    Std Error                 Limits

            Vo               3.1430       0.3154      2.4989      3.7870
            a               -0.0176      0.00493     -0.0277    -0.00751
            Vf               4.2795       0.2463      3.7765      4.7826

SGPlot2.png

Seems to fit well...

PG

PG

View solution in original post


All Replies
Solution
‎08-01-2013 10:05 PM
Respected Advisor
Posts: 4,651

Re: how to find an asymptote from a scatter plot

Try

proc nlin data=test;
parms Vo=2.5 a=-0.017 Vf=4.5;
model speed = Vo*exp(a*seconds) + Vf;
output out=outTest predicted=predSpeed;
run;

proc sgplot data=outTest noautolegend;
series x=seconds y=predSpeed;
scatter x=seconds y=speed;
yaxis min=0;
run;

Initial speed is Vo + Vf. Asymptotic speed is Vf.

                                          Approx       Approximate 95% Confidence
            Parameter      Estimate    Std Error                 Limits

            Vo               3.1430       0.3154      2.4989      3.7870
            a               -0.0176      0.00493     -0.0277    -0.00751
            Vf               4.2795       0.2463      3.7765      4.7826

SGPlot2.png

Seems to fit well...

PG

PG
Contributor
Posts: 30

Re: how to find an asymptote from a scatter plot

thanks for your help!

I tried it on another set of data with 4 data points, it didn't fit as well, but if I play around with the starting points for Vo, a, and Vf... sometimes I can get it to converge.

ming

Respected Advisor
Posts: 4,651

Re: how to find an asymptote from a scatter plot

Fitting a 3-parameter curve on 4 points doesn't give much freedom!

Given times T1-T4 and speeds S1-S4, you can try :

Vo=S1-S4, Vf=S4, a=-1.4/(T2+T3)

  

as starting values.

   

Good luck!

 

PG

PG
☑ This topic is SOLVED.

Need further help from the community? Please ask a new question.

Discussion stats
  • 3 replies
  • 508 views
  • 0 likes
  • 2 in conversation