adams.data.utils
Class SAXUtils

java.lang.Object
  extended by adams.data.utils.SAXUtils

public class SAXUtils
extends Object

A helper class for SAX

Author:
dale (dale at waikato dot ac dot nz)

Constructor Summary
SAXUtils()
           
 
Method Summary
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 void main(String[] args)
          Runs the algorithm from commandline.
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.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

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.

main

public static void main(String[] args)
Runs the algorithm from commandline.

Parameters:
args - the options


Copyright © 2012 University of Waikato, Hamilton, NZ. All Rights Reserved.