Package elki.distance.timeseries
Class DTWDistance
- java.lang.Object
-
- elki.distance.AbstractNumberVectorDistance
-
- elki.distance.timeseries.AbstractEditDistance
-
- elki.distance.timeseries.DTWDistance
-
- All Implemented Interfaces:
Distance<NumberVector>
,NumberVectorDistance<NumberVector>
,PrimitiveDistance<NumberVector>
- Direct Known Subclasses:
DerivativeDTWDistance
,EDRDistance
,ERPDistance
@Title("Dynamic Time Warping Distance Function") @Reference(authors="D. Berndt, J. Clifford", title="Using dynamic time warping to find patterns in time series", booktitle="AAAI-94 Workshop on Knowledge Discovery in Databases, 1994", url="http://www.aaai.org/Papers/Workshops/1994/WS-94-03/WS94-03-031.pdf", bibkey="DBLP:conf/kdd/BerndtC94") public class DTWDistance extends AbstractEditDistance
Dynamic Time Warping distance (DTW) for numerical vectors.Reference:
D. Berndt and J. Clifford
Using dynamic time warping to find patterns in time series
AAAI-94 Workshop on Knowledge Discovery in Databases, 1994This implementation uses a buffer storing two rows.
TODO: allow different one-dimensional distances
- Since:
- 0.2
- Author:
- Thomas Bernecker, Erich Schubert
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static class
DTWDistance.Par
Parameterization class.
-
Field Summary
-
Fields inherited from class elki.distance.timeseries.AbstractEditDistance
bandSize
-
-
Constructor Summary
Constructors Constructor Description DTWDistance()
Constructor.DTWDistance(double bandSize)
Constructor.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description protected double
delta(double val1, double val2)
Compute the delta of two values.double
distance(NumberVector v1, NumberVector v2)
Computes the distance between two given vectors according to this distance function.protected void
firstRow(double[] buf, int band, NumberVector v1, NumberVector v2, int dim2)
Fill the first row.-
Methods inherited from class elki.distance.timeseries.AbstractEditDistance
effectiveBandSize, equals, getInputTypeRestriction, hashCode
-
Methods inherited from class elki.distance.AbstractNumberVectorDistance
dimensionality, dimensionality, dimensionality, dimensionality, dimensionality, dimensionality, dimensionality, dimensionality
-
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, toString, wait, wait, wait
-
Methods inherited from interface elki.distance.Distance
isMetric, isSquared, isSymmetric
-
Methods inherited from interface elki.distance.PrimitiveDistance
instantiate
-
-
-
-
Method Detail
-
distance
public double distance(NumberVector v1, NumberVector v2)
Description copied from interface:NumberVectorDistance
Computes the distance between two given vectors according to this distance function.- Parameters:
v1
- first vectorv2
- second vector- Returns:
- the distance between two given vectors according to this distance function
-
firstRow
protected void firstRow(double[] buf, int band, NumberVector v1, NumberVector v2, int dim2)
Fill the first row.- Parameters:
buf
- Bufferband
- Bandwidthv1
- First vectorv2
- Second vectordim2
- Dimensionality of second
-
delta
protected double delta(double val1, double val2)
Compute the delta of two values.TODO: support Euclidean, Manhattan, others?
- Parameters:
val1
- First valueval2
- Second value- Returns:
- Difference
-
-