# diss.CORT

##### Dissimilarity Index Combining Temporal Correlation and Raw Values Behaviors

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

##### Usage

`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) = \Phi[CORT(x,y)] \delta(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) = \frac{ \sum_{t=1} (x_{t+1} - x_t) ( y_{t+1} - y_t) }{ \sqrt{ \sum_{t=1} (x_{t+1} - x_t)^2} \sqrt{ \sum_{t=1} (y_{t+1} - y_t)^2 } } $$
\(\Phi[u]\) is an adaptive tuning function taking the form:
$$ \frac{2}{1+e^{ku}} $$ with \(k \geq 0\) so that both \(\Phi\) and `k`

modulate the weight that CORT(x,y) has on d(x,y).

\(\delta(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) = \delta(x,y)\) if `k=0`

.

More details of the procedure can be seen in Chouakria-Douzal and Nagabhushan (2007).

`deltamethod`

(\(\delta\)) 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.

##### 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

##### Examples

```
# NOT RUN {
## 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")
# }
```

*Documentation reproduced from package TSclust, version 1.2.4, License: GPL-2*