Class SAXUtils


  • public class SAXUtils
    extends Object
    A helper class for SAX.
    Version:
    $Revision$
    Author:
    dale (dale at waikato dot ac dot nz)
    • Constructor Summary

      Constructors 
      Constructor Description
      SAXUtils()  
    • Method Summary

      All Methods Static Methods Concrete Methods 
      Modifier and Type Method Description
      static double[] calcBreakPoints​(int bins)
      Calculate the break points for equal-frequency bins for a gaussian.
      static double[][] calcDistMatrix​(double[] bps)
      Calculate the distance matrix for use in the MINDIST function.
      static double minDist​(double[] q, double[] c, double[][] distMatrix, int orig_n)
      Calculate the distance between 2 SAX vectors.
      static double[] PAA​(double[] inarray, int numwindows)
      Piecewise Aggregate Approximation.
      static double[] toSAX​(double[] inarray, int numwindows, double[] bps)
      Convert a row in original space into SAX labels.
    • Constructor Detail

      • SAXUtils

        public SAXUtils()
    • Method Detail

      • PAA

        public static double[] PAA​(double[] inarray,
                                   int numwindows)
        Piecewise Aggregate Approximation.
        Parameters:
        inarray - input array
        numwindows - number of pieces
        Returns:
        PAA
      • toSAX

        public static double[] toSAX​(double[] inarray,
                                     int numwindows,
                                     double[] bps)
        Convert a row in original space into SAX labels. Assumes original space has been x normalised (rownorm?).
        Parameters:
        inarray -
        numwindows -
        bps -
        Returns:
      • calcDistMatrix

        public static double[][] calcDistMatrix​(double[] bps)
        Calculate the distance matrix for use in the MINDIST function.
        Parameters:
        bps - breakpoints
        Returns:
        distance matrix
      • minDist

        public static double minDist​(double[] q,
                                     double[] c,
                                     double[][] distMatrix,
                                     int orig_n)
        Calculate the distance between 2 SAX vectors.
        Parameters:
        q - vector 1
        c - vector 2
        distMatrix - distance matrix
        orig_n - original vector length
        Returns:
        distance measure
      • calcBreakPoints

        public static double[] calcBreakPoints​(int bins)
        Calculate the break points for equal-frequency bins for a gaussian.
        Parameters:
        bins - number of bins
        Returns:
        break points. Z numbers.