View source: R/dissim_distance.R
DissimDistance | R Documentation |
Computes the Dissim distance between a pair of numeric series.
DissimDistance(x, y, tx, ty)
x |
Numeric vector containing the first time series. |
y |
Numeric vector containing the second time series. |
tx |
If not constant, a numeric vector that specifies the sampling index of series |
ty |
If not constant, a numeric vector that specifies the sampling index of series |
The Dissim distance is obtained by calculating the integral of the Euclidean distance between the two series. The series are assumed to be linear between sampling points.
The two series must start and end in the same interval but they may have different and non-constant sampling rates. These sampling rates must be positive and strictly increasing. For more information see reference below.
d |
The computed distance between the pair of series. |
Usue Mori, Alexander Mendiburu, Jose A. Lozano.
Frentzos, E., Gratsias, K., & Theodoridis, Y. (2007). Index-based Most Similar Trajectory Search. In Proceeding of the IEEE 23rd International Conference on Data Engineering (pp. 816-825).
Esling, P., & Agon, C. (2012). Time-series data mining. ACM Computing Surveys (CSUR), 45(1), 1–34.
To calculate this distance measure using ts
, zoo
or xts
objects see TSDistances
. To calculate distance matrices of time series databases using this measure see TSDatabaseDistances
.
#The objects example.series1 and example.series2 are two #numeric series of length 100 contained in the TSdist package. data(example.series1) data(example.series2) #For information on their generation and shape see help #page of example.series. help(example.series) #Calculate the Dissim distance assuming even sampling: DissimDistance(example.series1, example.series2) #Calculate the Dissim distance assuming uneven sampling: tx<-unique(c(seq(2, 175, 2), seq(7, 175, 7))) tx <- tx[order(tx)] ty <- tx DissimDistance(example.series1, example.series2, tx, ty)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.