diss.SPEC.ISD: Dissimilarity Based on the Integrated Squared Difference...

Description Usage Arguments Details Value Author(s) References See Also Examples

Description

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

Usage

1

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.

n

The number of points to use for the linear interpolation. A value of n=0 uses numerical integration instead of linear interpolation. See details.

Details

d(x,y) = INT( (m_x(λ) - m_y(λ))^2 )dλ

where m_x(λ) and m_y(λ) are local linear smoothers of the log-periodograms, obtained using the maximum local likelihood criterion.

By default, for performance reasons, the spectral densities are estimated using linear interpolation using n points. If n is 0, no linear interpolation is performed, and integrate is used to calculate the integral, using as many points as integrate sees fit.

Value

The computed distance.

Author(s)

Pablo Montero Manso, José Antonio Vilar.

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.

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/.

See Also

diss.SPEC.GLK, diss.SPEC.LLR

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
## Create two sample time series
x <- cumsum(rnorm(50))
y <- cumsum(rnorm(50))
z <- sin(seq(0, pi, length.out=50))
## 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
## Not run: 
diss.SPEC.ISD(x, y, plot=TRUE, n=0)#try integrate instead of interpolation
diss( rbind(x,y,z), "SPEC.ISD" )

## End(Not run)


Search within the TSclust package
Search all R packages, documentation and source code

Questions? Problems? Suggestions? or email at ian@mutexlabs.com.

Please suggest features or report bugs with the GitHub issue tracker.

All documentation is copyright its authors; we didn't write any of that.