diss.SPEC.LLR: General Spectral Dissimilarity Measure Using Local-Linear...

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

View source: R/diss.R

Description

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

Usage

1
diss.SPEC.LLR(x, y, alpha=0.5, method="DLS", plot=FALSE, n=length(x))

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.

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_W = INT( W^\prime( f_x(λ) / f_y(λ) ) )dλ | λ=-π to π

where:

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

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. If the dissimilarity will be calculated for more than two series, calling SPEC.LLR from the diss wrapper function is preferred, since it saves some computations.

Value

The computed distance.

Author(s)

Pablo Montero Manso, José Antonio Vilar.

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.

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.ISD, integrate

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
## 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, n=0) #try integrate instead of interpolation
diss.SPEC.LLR(y, z, method="LK", n=0) #maximum likelihood with integration
#create a dist object for its use with clustering functions like pam or hclust
diss(rbind(x,y,z), METHOD="SPEC.LLR", method="DLS", alpha=0.5, n=50)

TSclust documentation built on July 23, 2020, 1:07 a.m.