Learn R Programming

dtwclust (version 1.3.0)

shape_extraction: Shape average of several time series

Description

Time-series shape extraction based on optimal alignments as proposed by Papparizos and Gravano, 2015, for the k-Shape clustering algorithm.

Usage

shape_extraction(X, cz = NULL, znorm = FALSE)

Arguments

X
Numeric matrix where each row is a time series.
cz
Center to use as basis. It should already be normalized. Calculation uses all X if cz = NULL.
znorm
Boolean flag. Should z-scores be calculated for X before processing?

Value

  • Centroid time series.

Details

This works only if the signals are z-normalized, since the output will also have this normalization.

This centroid computation is casted as an optimization problem called maximization of Rayleigh Quotient. See the cited article for more details.

References

Paparrizos J and Gravano L (2015). ``k-Shape: Efficient and Accurate Clustering of Time Series.'' In Proceedings of the 2015 ACM SIGMOD International Conference on Management of Data, series SIGMOD '15, pp. 1855-1870. ISBN 978-1-4503-2758-9, http://doi.org/10.1145/2723372.2737793.

See Also

SBD, zscore

Examples

Run this code
# Sample data
data(uciCT)

# Subset of interest, normalized
X <- t(sapply(CharTraj[1:5], zscore))

# Obtain centroid series
C <- shape_extraction(X, znorm = FALSE)

# Result
matplot(t(X), type = "l", col = 1:5)
points(C)

Run the code above in your browser using DataLab