Learn R Programming

TSclust (version 1.3.2)

diss.INT.PER: Integrated Periodogram Based Dissimilarity

Description

Computes the dissimilarity between two time series in terms of the distance between their integrated periodograms.

Usage

diss.INT.PER(x, y, normalize=TRUE)

Value

The computed distance.

Arguments

x

Numeric vector containing the first of the two time series.

y

Numeric vector containing the second of the two time series.

normalize

If TRUE the normalized version is computed.

Author

Pablo Montero Manso, José Antonio Vilar.

Details

The distance is computed as: $$ d(x,y) = \int_{-\pi}^{\pi} | F_x(\lambda) - F_y(\lambda) | \, d\lambda, $$ where \( F_x(\lambda_j) = C_x^{-1} \sum_{i=1}^{j} I_x(\lambda_i)\) and \(F_y(\lambda_j) = C_y^{-1} \sum_{i=1}^{j} I_y(\lambda_i)\), with \(C_x = \sum_i I_x(\lambda_i)\) and \(C_y = \sum_i I_y(\lambda_i)\) in the normalized version. \(C_x = 1\) and \(C_y = 1\) in the non-normalized version. \(I_x(\lambda_k)\) and \(I_y(\lambda_k)\) denote the periodograms of x and y, respectively.

References

Casado de Lucas, D. (2010) Classification techniques for time series and functional data.

Montero, P and Vilar, J.A. (2014) TSclust: An R Package for Time Series Clustering. Journal of Statistical Software, 62(1), 1-43. tools:::Rd_expr_doi("doi:10.18637/jss.v062.i01")

See Also

diss.PER

Examples

Run this code
## 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.INT.PER(x, y, normalize=TRUE)
diss.INT.PER(x, y, normalize=TRUE)
diss.INT.PER(x, y, normalize=TRUE)
# \donttest{
diss( rbind(x,y,z), "INT.PER", normalize=FALSE )
# }

Run the code above in your browser using DataLab