Namespace Distances

namespace khivadistances

Functions

double khiva::distancesdtw(std::vector<double> a, std::vector<double> b)

Calculates the Dynamic Time Warping Distance.

Return
array The resulting distance between a and b.
Parameters
  • a: The input time series of reference.
  • b: The input query.

af::array khiva::distancesdtw(af::array tss)

Calculates the Dynamic Time Warping Distance.

Return
af::array An upper triangular matrix where each position corresponds to the distance between two time series. Diagonal elements will be zero. For example: Position row 0 column 1 records the distance between time series 0 and time series 1.
Parameters
  • tss: Expects an input array whose dimension zero is the length of the time series (all the same) and dimension one indicates the number of time series.

af::array khiva::distanceseuclidean(af::array tss)

Calculates euclidean distances between time series.

Return
af::array An upper triangular matrix where each position corresponds to the distance between two time series. Diagonal elements will be zero. For example: Position row 0 column 1 records the distance between time series 0 and time series 1.
Parameters
  • tss: Expects an input array whose dimension zero is the length of the time series (all the same) and dimension one indicates the number of time series.

af::array khiva::distanceshamming(af::array tss)

Calculates hamming distances between time series.

Return
af::array An upper triangular matrix where each position corresponds to the distance between two time series. Diagonal elements will be zero. For example: Position row 0 column 1 records the distance between time series 0 and time series 1.
Parameters
  • tss: Expects an input array whose dimension zero is the length of the time series (all the same) and dimension one indicates the number of time series.

af::array khiva::distancesmanhattan(af::array tss)

Calculates manhattan distances between time series.

Return
af::array An upper triangular matrix where each position corresponds to the distance between two time series. Diagonal elements will be zero. For example: Position row 0 column 1 records the distance between time series 0 and time series 1.
Parameters
  • tss: Expects an input array whose dimension zero is the length of the time series (all the same) and dimension one indicates the number of time series.

af::array khiva::distancessquaredEuclidean(af::array tss)

Calculates non squared version of the euclidean distance.

Return
array An upper triangular matrix where each position corresponds to the distance between two time series. Diagonal elements will be zero. For example: Position row 0 column 1 records the distance between time series 0 and time series 1.
Parameters
  • tss: Expects an input array whose dimension zero is the length of the time series (all the same) and dimension one indicates the number of time series.