s-news
[Top] [All Lists]

How to Sum the Lengths of Plotted Lines in a Time Series Plot ?

To: "S-News List (E-mail)" <s-news@wubios.wustl.edu>
Subject: How to Sum the Lengths of Plotted Lines in a Time Series Plot ?
From: "Andrew White" <andrew_white@hmsa.com>
Date: Tue, 19 Aug 2003 13:56:57 -1000
Thread-index: AcNmrZMYU2CRvNuqSNKXz2/OTg2KLQ==
Thread-topic: How to Sum the Lengths of Plotted Lines in a Time Series Plot ?
I want to develop an estimate of the "complexity" of any time series trend line 
in terms of its "cumulative trend-line distance".  

I need help in how to calculate the "cumulative distance" or sum of lengths of 
individual lines connecting each data point to its next data point - like 
tracing the (jagged) time series plot line with your finger and measuring the 
total length traced.

Consider a regular time series plotted using ts.plot()

The index of complexity I am toying with would use as a reference the Minimum 
Length where each data point would have the same value across all time periods 
(observation points): a straight horizontal line. The Maximal Length would then 
be where maximal data value variability occurs between every adjacent data 
point in the series (sorta like a massive earthquake). Intermediate lengths 
would represent intermediate forms of time series data variability. 

Obviously I need to "stabilize" the data ranges being referenced and eliminate 
influences of scale. That comes later ..

But I am stuck initially with just how to use S-Plus commands to sum the 
sequential series of plotted time series plot lengths between adjacent points 
from the starting point to the ending point.

Note: I believe this measure is different in principle than just measuring 
variance. For the following reason: I ran some time series test cases for 36 
time periods: (1) same value repeated = straight horizontal line, (2) a 
steadily rising value = forms a straight angled line across the time series 
plot, (3) flat for half the points then steady decline, (4)  max variation or 
seesaw between two extreme data values = maximum jaggy plot, and (5) a random 
series of values set by rnorm().  Now the variance of # 2 is greater than #5 
(random) and yet #2 is far more regular and "less complex" in my view than the 
random changes in direction and length of #5. 

Anyone have a method or can suggest some S-Plus standard functions to measure 
the cumulative line lengths - or get a better measure of the "complexity" of a 
time series plot-line?

Many thanks in advance.

Andy White
Andrew N. White, Ph.D. - Manager Research Unit
Financial Reporting & Medical Economics Dept.
Hawaii Medical Service Association
- Blue Cross Blue Shield of Hawaii
An Independent Licenseee of the Blue Cross and Blue Shield Association -
818 Keeaumoku Street, Honolulu, HI 96814
Ph. 808-948-5344 - Email: andrew_white@hmsa.com 




<Prev in Thread] Current Thread [Next in Thread>