Computes an adaptive dissimilarity index between two time series that covers both dissimilarity on raw values and dissimilarity on temporal correlation behaviors.
diss.CORT(x, y, k = 2, deltamethod="Euclid")
Numeric vector containing the first of the two time series.
Numeric vector containing the second of the two time series.
Parameter controlling the weight of the dissimilarity between dynamic behaviors (See Details).
Defines the method for the raw data discrepancy. Either
The dissimilarity between time series
y is given by:
d(x,y) = Φ[CORT(x,y)] δ(x,y)
CORT(x,y) measures the proximity between the dynamic behaviors of x and y by means of the first order temporal correlation coefficient defined by:
CORT(x,y) = ∑ ( ( x_(t+1) - x_t ) ( y_(t+1) - y_t ) ) / (√( ∑ (x_(t+1) - x_t)^2) √( ∑ (y_(t+1) - y_t)^2))
Φ[u] is an adaptive tuning function taking the form:
with k ≥q 0 so that both Φ and
k modulate the weight that CORT(x,y) has on d(x,y).
δ(x,y) denotes a dissimilarity measure between the raw values of series
y, such as the Euclidean distance, the Frechet distance or the Dynamic Time Warping distance. Note that d(x,y) = δ(x,y) if
More details of the procedure can be seen in Chouakria-Douzal and Nagabhushan (2007).
deltamethod (δ) can be either Euclidean (
deltamethod = "Euclid"), Frechet (
deltamethod = "Frechet") or Dynamic Time Warping (
deltamethod ="DTW") distances. When calling from
dis.CORT, DTW uses Manhattan as local distance.
The computed distance.
Pablo Montero Manso, José Antonio Vilar.
Chouakria-Douzal, A. and Nagabhushan P. N. (2007) Adaptive dissimilarity index for measuring time series proximity. Adv. Data Anal. Classif., 1(1), 5–21.
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/.
1 2 3 4 5 6 7 8 9 10 11 12 13
## Create three sample time series x <- cumsum(rnorm(100)) y <- cumsum(rnorm(100)) z <- sin(seq(0, pi, length.out=100)) ## Compute the distance and check for coherent results diss.CORT(x, y, 2) diss.CORT(x, z, 2) diss.CORT(y, z, 2) #create a dist object for its use with clustering functions like pam or hclust ## Not run: diss( rbind(x,y,z), "CORT", k=3, deltamethod="DTW") ## End(Not run)