turnogram {pastecs} | R Documentation |
Calculate and plot a turnogram for a regular time series
Description
The turnogram is the variation of a monotony index with the observation scale (the number of data per time unit). A monotony index indicates if the series has more or less erratic variations than a pure random succession of independent observations. Since a time series almost always has autocorrelation, it is expected to be more monotonous than a purely random series. The monotony index is a way to quantify the density of information beared by a time series. The turnogram determines at which observation scale this density of information is maximum. It is also the scale that optimize the sampling effort (best compromise between less samples versus more information).
Usage
turnogram(series, intervals=c(1, length(series)/5), step=1, complete=FALSE,
two.tailed=TRUE, FUN=mean, plotit=TRUE, level=0.05, lhorz=TRUE,
lvert=FALSE, xlog=TRUE)
## S3 method for class 'turnogram'
print(x, ...)
## S3 method for class 'turnogram'
summary(object, ...)
## S3 method for class 'summary.turnogram'
print(x, ...)
## S3 method for class 'turnogram'
plot(x, level=0.05, lhorz=TRUE, lvert=TRUE, lcol=2,
llty=2, xlog=TRUE, xlab=paste("interval (", x$units.text, ")", sep=""),
ylab="I (bits)", main=paste(x$type, "turnogram for:", x$data),
sub=paste(x$fun, "/", x$proba), ...)
## S3 method for class 'turnogram'
identify(x, lvert=TRUE, col=2, lty=2, ...)
## S3 method for class 'turnogram'
extract(e, n, level=e$level, FUN=e$fun, drop=0, ...)
Arguments
series |
a single regular time series ('rts' object in Splus or 'ts' object in R) |
intervals |
the range (mini, maxi) of the intervals to calculate, i.e., to take one obervation every 'interval' one. By default, |
x |
a 'turnogram' object |
object |
a 'turnogram' object |
e |
a 'turnogram' object |
step |
the increment used for the intervals. By defaults |
complete |
if |
two.tailed |
if |
FUN |
a function to apply to aggregate data in the intervals. It is a function of the type |
plotit |
if |
level |
the significant level to draw on the graph. By default |
lhorz |
if |
lvert |
if |
lcol |
the color to use to draw supplemental lines: the horizontal line indicating where the test is significant (if |
llty |
the style for the supplemental lines. By default, style 2 is used (dashed lines) |
xlog |
if |
xlab |
the label of the x-axis |
ylab |
the label of the y-axis |
main |
the main title of the graph |
sub |
the subtitle of the graph |
col |
color to use for identified items |
lty |
line type to use for identified items |
... |
additional optional graphic arguments |
n |
the number of observations to take into account in the initial series. Use |
drop |
the number of observations to drop at the beginning of the series before proceeding with the aggregation of the data for the extracted series. By default, |
Details
The turnogram is a generalisation of the information theory (see turnpoints()
). If a series has a lot of erratic peaks and pits that alternate with a high frequency, it is more difficult to interpret than a more monotonous series. These erratic fluctuations can be eliminated by changing the scale of observation (keeping one observation every two, three, four,... from the original series). The turnogram resample the original series this way, and calculate a monotony index for each resampled subseries. This monotony index quantifies the number of peaks and pits presents in the series, compared to the total number of observations. The Gleissberg distribution (see pgleissberg()
) indicates the probability to have such a number of extrema in a series given it is purely random. It is possible to test monotony indices: is it a random series or not (two-sided test), or is more monotonous than a random series (left-sided test) thanks to a Chi-2 test proposed by Wallis & Moore (1941).
There are various turnograms depending on the way the observations are aggregated inside each time interval. For instance, if one consider one observation every three from the original series, each group of three observations can be aggregated in several different ways. One can take the mean of the three observation, or the median value, or the sum,... One can also decide not to aggregate observations, but to drop some of them. Hence, one can take only the first or the last observation of the group. All these options can be choosen by defining the argument FUN=...
. A simple turnogram correspond to the change of the monotony index with the scale of observation, stating always from the first observation. One could also decide to start from the second, or the third observation for an aggregation of the observations three by three... and result could be somewhat different. A complete turnogram investigates all possibles combinations (observation scale versus starting point for the aggregation) and trace the maximal, minimal and mean curves for the change of the monotony index. It is thus more informative than the simple turnogram. However, it takes much more time to compute.
The most obvious use of the turnogram is for the pretreatment of continuously sampled data. It helps in deciding which is the optimal sampling interval for the series to bear as most information as possible while keeping the dataset as small as possible. It is also interesting to compare the turnogram with other functions like the variogram (see vario()
) or the spectrogram (see spectrum()
).
Value
An object of type 'turnogram' is returned. It has methods print()
, summary()
, plot()
, identify()
and extract()
.
Author(s)
Frédéric Ibanez (ibanez@obs-vlfr.fr), Philippe Grosjean (phgrosjean@sciviews.org)
References
Dallot, S. & M. Etienne, 1990. Une méthode non paramétrique d'analyse des series en océanographie biologique: les tournogrammes. Biométrie et océanographie - Société de biométrie, 6, Lille, 26-28 mai 1986. IFREMER, Actes de colloques, 10:13-31.
Johnson, N.L. & Kotz, S., 1969. Discrete distributions. J. Wiley & sons, New York, 328 pp.
Kendall, M.G., 1976. Time-series, 2nd ed. Charles Griffin & co, London.
Wallis, W.A. & G.H. Moore, 1941. A significance test for time series. National Bureau of Economic Research, tech. paper n°1.
See Also
pgleissberg
, turnpoints
, first
, last
, vario
, spectrum
Examples
data(bnr)
# Let's transform series 4 into a time series (supposing it is regular)
bnr4 <- as.ts(bnr[, 4])
plot(bnr4, type="l", main="bnr4: raw data", xlab="Time")
# A simple turnogram is calculated
bnr4.turno <- turnogram(bnr4)
summary(bnr4.turno)
# A complete turnogram confirms that "level=3" is a good value:
turnogram(bnr4, complete=TRUE)
# Data with maximum info. are extracted (thus taking 1 every 3 observations)
bnr4.interv3 <- extract(bnr4.turno)
plot(bnr4, type="l", lty=2, xlab="Time")
lines(bnr4.interv3, col=2)
title("Original bnr4 (dotted) versus max. info. curve (plain)")
# Choose another level (for instance, 6) and extract the corresponding series
bnr4.turno$level <- 6
bnr4.interv6 <- extract(bnr4.turno)
# plot both extracted series on top of the original one
plot(bnr4, type="l", lty=2, xlab="Time")
lines(bnr4.interv3, col=2)
lines(bnr4.interv6, col=3)
legend(70, 580, c("original", "interval=3", "interval=6"), col=1:3, lty=c(2, 1, 1))
# It is hard to tell on the graph which series contains more information
# The turnogram shows us that it is the "interval=3" one!