Description Usage Arguments Details Value Author(s) References See Also Examples
Computes a general dissimilarity measure based on the ratio of local linear spectral estimators.
1 | diss.SPEC.LLR(x, y, alpha=0.5, method="DLS", plot=FALSE, n=length(x))
|
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 |
|
plot |
if |
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. |
d_W = INT( W^\prime( f_x(λ) / f_y(λ) ) )dλ | λ=-π to π
where:
f_x and f_y are nonparametric approximations of spectral densities of x
and y
respectively.
W^{\prime}(x) = W(x) + W(1/x) with W(x) = \log( α x + (1- α) x) - α \log(x), so that W(.) is a divergence function depending on α.
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.
The computed distance.
Pablo Montero Manso, José Antonio Vilar.
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/.
diss.SPEC.GLK
, diss.SPEC.ISD
, integrate
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)
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.