Learn R Programming

TSclust (version 1.1)

diss.SPEC.ISD: Dissimilarity Based on the Integrated Squared Difference between the Log-Spectra

Description

Computes the dissimilarity between two time series in terms of the integrated squared difference between non-parametric estimators of their log-spectra.

Usage

diss.SPEC.ISD(x, y, plot=FALSE)

Arguments

x
Numeric vector containing the first of the two time series.
y
Numeric vector containing the second of the two time series.
plot
If TRUE, plot the smoothed spectral densities of the two series.

Value

  • The computed distance.

Details

$$d(x,y) = \int ( \hat{m}_x(\lambda) - \hat{m}_y(\lambda))^2 \, d\lambda,$$ where $\hat{m}_x(\lambda)$ and $\hat{m}_y(\lambda)$ are local linear smoothers of the log-periodograms, obtained using the maximum local likelihood criterion.

References

Pértega, S. and Vilar, J.A. (2010) Comparing several parametric and nonparametric approaches to time series clustering: A simulation study. J. Classification, 27(3), 333--362.

See Also

diss.SPEC.GLK, diss.SPEC.LLR

Examples

Run this code
## Create two sample time series
x <- cumsum(rnorm(50))
y <- cumsum(rnorm(50))
z <- sin(seq(0, pi, length.out=100))
## Compute the distance and check for coherent results
diss.SPEC.ISD(x, y, plot=TRUE)
#create a dist object for its use with clustering functions like pam or hclust
proxy::dist( rbind(x,y,z), diss.SPEC.ISD )

Run the code above in your browser using DataLab