Package ai.libs.jaicore.ml.tsc.distances
Class ManhattanDistance
- java.lang.Object
-
- ai.libs.jaicore.ml.tsc.distances.ManhattanDistance
-
- All Implemented Interfaces:
ITimeSeriesDistance
public class ManhattanDistance extends java.lang.Object implements ITimeSeriesDistance
Implementation of the Manhattan distance for time series. The Manhattan distance for two time seriesAandBof lengthnis defined as\sum_{i=0}^{n} |A_i - B_i|. Therefore, it is required forAandBto be of the same length.
-
-
Constructor Summary
Constructors Constructor Description ManhattanDistance()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description doubledistance(double[] a, double[] b)Calculates the distance between two time series.
-
-
-
Method Detail
-
distance
public double distance(double[] a, double[] b)Description copied from interface:ITimeSeriesDistanceCalculates the distance between two time series.- Specified by:
distancein interfaceITimeSeriesDistance- Parameters:
a- First time series.b- Second time series.- Returns:
- Distance between the first and second time series.
-
-