[R] lowess + turnpoints = doubling integers?

Philippe Grosjean phgrosjean at sciviews.org
Tue Dec 31 10:57:02 CET 2002


Bob,
Happy New Year. Could you, please, cook an example so as we could spot the
problem?
Best,

Philippe Grosjean

...........]<(({°<...............<°}))><...............................
 ) ) ) ) )
( ( ( ( (       Dr. Philippe Grosjean
 ) ) ) ) )
( ( ( ( (       LOV, UMR 7093
 ) ) ) ) )      Station Zoologique
( ( ( ( (       Observatoire Océanologique
 ) ) ) ) )      BP 28
( ( ( ( (       06234 Villefranche sur mer cedex
 ) ) ) ) )      France
( ( ( ( (
 ) ) ) ) )      tel: +33.4.93.76.38.16, fax: +33.4.93.76.38.34
( ( ( ( (
 ) ) ) ) )      e-mail: phgrosjean at sciviews.org
( ( ( ( (       SciViews project coordinator (http://www.sciviews.org)
 ) ) ) ) )
.......................................................................



-----Original Message-----
From: r-help-admin at stat.math.ethz.ch
[mailto:r-help-admin at stat.math.ethz.ch]On Behalf Of Bob Porter
Sent: dimanche 29 décembre 2002 8:52
To: r-help at stat.math.ethz.ch
Subject: [R] lowess + turnpoints = doubling integers?


Happy New Year, r-helpers!

I am using lowess to smooth a scatter plot,
xx<-lowess(xinput,f=.04)  #defaults for other args
 followed by
turnpoints(xx$y) #defaults for other args

I plot the smoothed result as well as turnpoints (using yy$tppos) on top of
raw
data plot.
Result is exactly as expected, graphically.

For another purpose, I calcuate the difference between turnpoints
(representing
time intervals between turnspoints in my applicaiton), e.g.

aduration[j]<-yy$tppos[i+1]-yytppos[i]

This also appears to work as expected, HOWEVER, a typical list of such
differences looks like:
22,33,22,11,33,44,33,33,11,33,44,66,33,22,.........
there are, in some instances, three digit measure such as 110 or 106, etc.
but
the double-digit measures, although of the proper magnitude, seem to always
be
double integers 11 to 99.

The double-integer results are found with f=.04 and total length of vector
of
1200.  With vector of length 1100 (same input data), the results are NOT
double-integer but are ALWAYS (?) of the form x0, e.g.
70,50,50,70,100,40............  The magnitude of these latter results (22 vs
70,
for example) is evidently due to the change in the smoothing span from
.04*1200
to .04*1100, but I am mystified why the results have double-integers in the
first case, and terminal zeros in the second.

My project involves applying these functions in a batch run for dozens of
data
sets so I want to understand more about what is going on that yeilds these
strange double-integers or zero-terminating values.

Thanks,

Bob Porter, Tampa

______________________________________________
R-help at stat.math.ethz.ch mailing list
http://www.stat.math.ethz.ch/mailman/listinfo/r-help




More information about the R-help mailing list