paa: Computes a Piecewise Aggregate Approximation (PAA) for a time...

Description Usage Arguments References Examples

View source: R/RcppExports.R

Description

Computes a Piecewise Aggregate Approximation (PAA) for a time series.

Usage

1
paa(ts, paa_num)

Arguments

ts

a timeseries to compute the PAA for.

paa_num

the desired PAA size.

References

Keogh, E., Chakrabarti, K., Pazzani, M., Mehrotra, S., Dimensionality reduction for fast similarity search in large time series databases. Knowledge and information Systems, 3(3), 263-286. (2001)

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
x = c(-1, -2, -1, 0, 2, 1, 1, 0)
x_paa3 = paa(x, 3)
#
plot(x, type = "l", main = c("8-points time series and its PAA transform into three points",
                          "PAA shown schematically in blue"))
points(x, pch = 16, lwd = 5)
#
paa_bounds = c(1, 1+7/3, 1+7/3*2, 8)
abline(v = paa_bounds, lty = 3, lwd = 2, col = "cornflowerblue")
segments(paa_bounds[1:3], x_paa3, paa_bounds[2:4], x_paa3, col = "cornflowerblue", lwd = 2)
points(x = c(1, 1+7/3, 1+7/3*2) + (7/3)/2, y = x_paa3, pch = 15, lwd = 5, col = "cornflowerblue")

Example output

Loading required package: Rcpp

jmotif documentation built on March 26, 2020, 7:23 p.m.