# diss.CORT: Dissimilarity Index Combining Temporal Correlation and Raw... In TSclust: Time Series Clustering Utilities

## Description

Computes an adaptive dissimilarity index between two time series that covers both dissimilarity on raw values and dissimilarity on temporal correlation behaviors.

## Usage

 `1` ```diss.CORT(x, y, k = 2, deltamethod="Euclid") ```

## Arguments

 `x` Numeric vector containing the first of the two time series. `y` Numeric vector containing the second of the two time series. `k` Parameter controlling the weight of the dissimilarity between dynamic behaviors (See Details). `deltamethod` Defines the method for the raw data discrepancy. Either `"Euclid"`, `"Frechet"` or `"DTW"`.

## Details

The dissimilarity between time series `x` and `y` is given by:

d(x,y) = Φ[CORT(x,y)] δ(x,y)

where:

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:

2/(1+exp(ku))

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 `x` and `y`, such as the Euclidean distance, the Frechet distance or the Dynamic Time Warping distance. Note that d(x,y) = δ(x,y) if `k=0`.

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.

## Value

The computed distance.

## Author(s)

Pablo Montero Manso, José Antonio Vilar.

## References

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

## See Also

`diss.COR`, `diss.DTWARP`, `diss.FRECHET`, `distFrechet`, `dtw`.

## Examples

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

### Example output

```Loading required package: wmtsa
Loading required package: pdc
Loading required package: cluster
Warning messages:
1: In rgl.init(initValue, onlyNULL) : RGL: unable to open X11 display
2: 'rgl_init' failed, running with rgl.useNULL = TRUE
3: .onUnload failed in unloadNamespace() for 'rgl', details:
call: fun(...)
error: object 'rgl_quit' not found
[1] 29.47256
[1] 21.8868
[1] 23.52153
x        y
y 111.6728
z 169.7458 201.5761
```

TSclust documentation built on Nov. 17, 2017, 7:24 a.m.