Description Usage Arguments Details Value Author(s) References See Also Examples
Computes the distance between two time series based on their periodograms.
1 |
x |
Numeric vector containing the first of the two time series. |
y |
Numeric vector containing the second of the two time series. |
logarithm |
Boolean. If |
normalize |
Boolean. If |
Computes the Euclidean distance between the periodogram coefficients of the series x
and y
. Additional transformations can be performed on the coefficients depending on the values of logarithm
and normalize
.
The computed distance.
Pablo Montero Manso, José Antonio Vilar.
Caiado, J., Crato, N. and Peña, D. (2006) A periodogram-based metric for time series classification. Comput. Statist. Data Anal., 50(10), 2668–2684.
Montero, P and Vilar, J.A. (2014) TSclust: An R Package for Time Series Clustering. Journal of Statistical Software, 62(1), 1-43. http://www.jstatsoft.org/v62/i01/.
1 2 3 4 5 6 7 8 9 10 11 12 13 | ## Create three sample time series
x <- cumsum(rnorm(100))
y <- cumsum(rnorm(100))
z <- sin(seq(0, pi, length.out=100))
## Compute the distance and check for coherent results
diss.PER(x, y)
diss.PER(x, z)
diss.PER(y, z)
diss.PER(x, y, TRUE, TRUE)
diss.PER(x, z, TRUE, TRUE)
diss.PER(y, z, TRUE, TRUE)
#create a dist object for its use with clustering functions like pam or hclust
diss( rbind(x,y,z), "PER", logarithm=TRUE, normalize=TRUE)
|
Loading required package: wmtsa
Loading required package: pdc
Loading required package: cluster
Warning messages:
1: In rgl.init(initValue, onlyNULL) : RGL: unable to open X11 display
2: 'rgl_init' failed, running with rgl.useNULL = TRUE
3: .onUnload failed in unloadNamespace() for 'rgl', details:
call: fun(...)
error: object 'rgl_quit' not found
Ix
Iy 4.958001
Ix
Iy 1.406861
Ix
Iy 5.828323
Ix
Iy 0.2587038
Ix
Iy 1.987924
Ix
Iy 1.933243
x y
y 0.2587038
z 1.9879242 1.9332426
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.