Learn R Programming

TSclust (version 1.1)

diss.SPEC.LLR: General Spectral Dissimilarity Measure Using Local-Linear Estimation of the Log-Spectra

Description

Computes a general dissimilarity measure based on the ratio of local linear spectral estimators.

Usage

diss.SPEC.LLR(x, y, alpha=0.5, method="DLS", 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.
alpha
Power for the ratio of densities in the Chernoff information measure. Between 0 and 1.
method
"DLS" for least squares estimation of the spectral density and "LK" for maximum likelihood estimation.
plot
if TRUE, plot the smoothed spectral densities of the two series.

Value

  • The computed distance.

Details

$$d_W = \int_{-\pi}^{\pi} W^{\prime}\Bigg( \frac{f_x(\lambda) } { f_y(\lambda) } \Bigg) d\lambda$$ where:
  • $f_x$and$f_y$are nonparametric approximations of spectral densities ofxandyrespectively.
  • $W^{\prime}(x) = W(x) + W(1/x)$with$W(x) = \log( \alpha x + (1- \alpha) x) - \alpha \log(x)$, so that$W(.)$is a divergence function depending on$\alpha$.
This dissimilarity measure corresponds to the limiting spectral approximation of the Chernoff information measure in the time domain (see Kakizawa et al., 1998). The spectral densities are approximated by using local linear fitting by generalized least squared if method=”DLS” or by maximum likelihood if method=”LK” (in this case, higher computational cost is required).

References

Vilar, J.A. and Pértega, S. (2004) Discriminant and cluster analysis for gaussian stationary processes: local linear fitting approach. J. Nonparametr. Stat., 16(3-4) 443--462. Kakizawa, Y., Shumway, R. H. and Taniguchi M. (1998) Discrimination and clustering for multivariate time series. J. Amer. Statist. Assoc., 93(441), 328-- 340.

See Also

diss.SPEC.GLK, diss.SPEC.ISD

Examples

Run this code
## Create three 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.LLR(x, y, plot=TRUE)
diss.SPEC.LLR(x, z)
diss.SPEC.LLR(y, z)
#create a dist object for its use with clustering functions like pam or hclust
proxy::dist( rbind(x,y,z), method=diss.SPEC.LLR, meth="LK")

Run the code above in your browser using DataLab