Class MoveSplitMerge

  • All Implemented Interfaces:
    org.api4.java.common.math.IMetric<double[]>, IDistanceMetric

    public class MoveSplitMerge
    extends java.lang.Object
    implements IDistanceMetric
    Implementation of the Move-Split-Merge (MSM) measure as published in "The Move-Split-Merge Metric for Time Series" by Alexandra Stefan, Vassilis Athitsos and Gautam Das (2013). The idea behind the MSM metric is to define a set of operations that can be used to transform any time series into any other.
    • A Move operation changes the value of a single point of the time series.
    • A Split operation splits a single point of the time series into two consecutive points that have the same value as the original point.
    • A Merge operation merges two consecutive points that have the same value int a single point that has that value.
    Each operation has an associated cost. The cost for a Move for x to y is |x-y|. The cost for a Split and Merge is defined by a constant c. Let S = (s_1, s_2, .., s_n) be a sequence of Move/Split/Merge operations with s_i either Move, Split or a Merge. The Move-Split-Merge distance between to time series A and B is defined be the cost of the lowest-cost transformation S*, such that transform(S*, A) = B.
    • Constructor Summary

      Constructors 
      Constructor Description
      MoveSplitMerge​(double c)
      Constructor.
    • Method Summary

      All Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      double distance​(double[] a, double[] b)
      Calculates the distance between two time series.
      • Methods inherited from class java.lang.Object

        clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
    • Constructor Detail

      • MoveSplitMerge

        public MoveSplitMerge​(double c)
        Constructor.
        Parameters:
        c - The constant cost for Split and Merge operations.
    • Method Detail

      • distance

        public double distance​(double[] a,
                               double[] b)
        Description copied from interface: IDistanceMetric
        Calculates the distance between two time series.
        Specified by:
        distance in interface IDistanceMetric
        Parameters:
        a - First time series.
        b - Second time series.
        Returns:
        Distance between the first and second time series.