ABLE 2.0.0 07/02/2003 10:25:01

com.ibm.able.beans
Class AbleDataAnalytics

java.lang.Object
  |
  +--com.ibm.able.beans.AbleDataAnalytics
All Implemented Interfaces:
java.io.Serializable

public class AbleDataAnalytics
extends java.lang.Object
implements java.io.Serializable

This class provides statistical and time series analysis of data contained in AbleDataTable column's AbleDataSeries. The methods in Statistics are briefly described below (comparators for strComparator are the strings "NE" (!=), "GT" (>), "GE" (>=), "EQ" (==), "LE" (<=), "LT" (<)

See Also:
AbleDataSeries, AbleDataTable, Serialized Form

Field Summary
static int EQ
          Equal to 2, this defines the value to signify EQ (Equal)
static int GE
          Equal to 3, this defines the value to signify GE (Greater than or Equal)
static int GT
          Equal to 4, this defines the value to signify GT (Greater Than)
static int INTERCEPT_INDEX
          Equal to 1, this defines the index of the intercept in the array returned by linear regression calculations.
static int INVALID
          Equal to -1, this defines the value to signify an invalid comparator.
static int INVALID_INDEX
          Equal to -1, this is used to signal an invalid index for operations expecting to return an index to information (typically uesd when none is available or when an error has occurred).
static int LE
          Equal to 1, this defines the value to signify LE (Less than or Equal)
static int LT
          Equal to 0, this defines the value to signify LT (Less than)
static int NE
          Equal to 5, this defines the value to signify NE (Not Equal)
static int SLOPE_INDEX
          Equal to 0, this defines the index of the slope in the array returned by linear regression calculations.
static java.lang.String[] strComparisonNames
          A String[] containing the abbreviated names for the comparators.
static java.lang.String[] strComparisonSymbols
          A String[] containing the symbolic names for the comparators.
 
Constructor Summary
AbleDataAnalytics()
          Constructor for this class.
 
Method Summary
static java.lang.String arrayContentsAsString(double[] dArray)
          Static utility method to return the content of an double array (double[]) as a String of comma separated values.
static java.lang.String arrayContentsAsString(double[] dArray, double iBreakCount)
          Static utility method to return the content of an double array (double[]) as a String of comma separated values, with line terminators every N values listed.
static java.lang.String arrayContentsAsString(int[] iArray)
          Static utility method to return the content of an int array (int[]) as a String of comma separated values.
static java.lang.String arrayContentsAsString(int[] iArray, int iBreakCount)
          Static utility method to return the content of an int array (int[]) as a String of comma separated values, with line terminators every N values listed.
static java.lang.Boolean booleanAnd(java.lang.Boolean b1, java.lang.Boolean b2)
          Helper method to all the logical "AND" of two Boolean values.
static java.lang.String Copyright()
          Determine the copyright of this class.
static java.lang.Double countNonContiguousTHold(double[] dArray, java.lang.Double DTHold, java.lang.Double DComparator)
          Method that counts the values in the passed double array (double[]) that meet the comparison defined by strComparator to the passed threshold (e.g., # values GE 2.0)
static int countNonContiguousTHold(double[] dArray, double dTHold, int iComparator)
          Method that counts the values in the passed double array (double[]) that meet the comparison defined by strComparator to the passed threshold (e.g., # values GE 2.0)
static java.lang.Double countNonContiguousTHold(double[] dArray, java.lang.Double DTHold, java.lang.String strComparator)
          Method that counts the values in the passed double array (double[]) that meet the comparison defined by strComparator to the passed threshold (e.g., # values GE 2.0)
static int[] findContiguousInWindow(int[] inputIndices, double[] dTime, double dWindowSize)
          Method using a sliding window against the dTime array, find the sets of indices in inputIndices that are contiguous and return only these contiguous indices in an int[].
static int[] findContiguousInWindow(int[] inputIndices, double[] dTime, java.lang.Double DWindowSize)
          Method using a sliding window against the dTime array, find the sets of indices in inputIndices that are contiguous and return only these contiguous indices in an int[].
static java.lang.Double getArrayCount(double[] dArray)
          Helper method to return the length of a double array (double[])
static java.lang.Double getArrayCount(int[] iArray)
          Helper method to return the length of an int array (int[])
static int getComparisonByName(java.lang.String strComparator)
          Method to return the numeric value corresponding with the String passed in.
static int getNegativeComparator(int iComparator)
          Method to calculate the negative of a comparator
static int getOppositeComparator(int iComparator)
          Method to calculate the opposite of a comparator
static double[] linearRegression(double[] dXValues, double[] dYValues)
          Method to calculate a linear regression for the passed X and Y values.
static double[] linearRegression(double[] dXValues, double[] dYValues, java.lang.Double DXBar, java.lang.Double DYBar)
          Method to calculate a linear regression for the passed X and Y values.
static double[] linearRegression(double[] dXValues, double[] dYValues, double dXBar, double dYBar, int iStartIndex, int iEndIndex)
          Method to calculate a linear regression for the passed X and Y values within the range >= iStartIndex and
static java.util.Vector linearRegressionToList(double[] dXValues, double[] dYValues)
          Method to calculate a linear regression for the passed X and Y values.
static java.util.Vector linearRegressionToList(java.util.Vector vectXValues, java.util.Vector vectYValues)
          Method to calculate a linear regression for the passed X and Y values.
static double mean(double[] dArray)
          Method to calculate the mean for the passed array.
static java.lang.Boolean meanBoundedWindow(double[] dArray, double[] dTime, java.lang.Double DWindowSize, java.lang.Double DTHoldUpper, java.lang.Double DComparatorUpper, java.lang.Double DTHoldLower, java.lang.Double DComparatorLower)
          Method to determine if there is at least one window of the sized passed in time, where all the average of the values of passed value array compare favorably against the thresholds using their respective comparators.
static java.lang.Boolean meanBoundedWindow(double[] dArray, double[] dTime, java.lang.Double DWindowSize, java.lang.Double DTHoldUpper, java.lang.String strComparatorUpper, java.lang.Double DTHoldLower, java.lang.String strComparatorLower)
          Method to determine if there is at least one window of the sized passed in time, where all the average of the values of passed value array compare favorably against the thresholds using their respective comparators.
static java.lang.Boolean meanTHoldWindow(double[] dArray, double[] dTime, java.lang.Double DWindowSize, java.lang.Double DTHold, java.lang.Double DComparator)
          Method to determine if there is a window of the sized passed in time, where the average of all the values of passed value array compare favorably against a threshold using a comparator.
static java.lang.Boolean meanTHoldWindow(double[] dArray, double[] dTime, java.lang.Double DWindowSize, java.lang.Double DTHold, java.lang.String strComparator)
          Method to determine if there is a window of the sized passed in time, where the average of all the values of passed value array compare favorably against a threshold using a comparator.
static int[] meanTHoldWindowIndices(double[] dArray, double[] dTime, java.lang.Double DWindowSize, java.lang.Double DTHold, java.lang.Double DComparator)
          Method to evaluate a sliding window of predefined size against an array of time values and for the corresponding elements of the value array, see if their mean value compares favorably against the threshold value using the comparator, and return an array of the indices to the rows where this occurs.
static int[] meanTHoldWindowIndices(double[] dArray, double[] dTime, double dWindowSize, double dTHold, int iComparator)
          Method to evaluate a sliding window of predefined size against an array of time values and for the corresponding elements of the value array, see if their mean value compares favorably against the threshold value using the comparator, and return an array of the indices to the rows where this occurs.
static int[] meanTHoldWindowIndices(double[] dArray, double[] dTime, java.lang.Double DWindowSize, java.lang.Double DTHold, java.lang.String strComparator)
          Method to evaluate a sliding window of predefined size against an array of time values and for the corresponding elements of the value array, see if their mean value compares favorably against the threshold value using the comparator, and return an array of the indices to the rows where this occurs.
static java.lang.Double recordIndices(int[] iArray, java.lang.Double DStart, java.lang.Double DEnd, java.lang.Double DLast)
          Method that, given an existing array of sorted indices (iArray), and a range of other indices, and the last index we'd written to in the iArray, add the missing indices in the range [iStart,iEnd] to the iArray and return the new last index position in iArray we'd written to.
static int recordIndices(int[] iArray, int iStart, int iEnd, int iLast)
          Method that, given an existing array of sorted indices (iArray), and a range of other indices, and the last index we'd written to in the iArray, add the missing indices in the range [iStart,iEnd] to the iArray and return the new last index position in iArray we'd written to.
 java.lang.Boolean setValue(java.lang.String strValue, java.lang.Boolean BDefault)
          Method to convert the passed String into a Boolean or, if this isn't possible, to return the passed default value.
 java.lang.Double setValue(java.lang.String strValue, java.lang.Double DDefault)
          Method to convert the passed String into a Double or, if this isn't possible, to return the passed default value.
static int[] slopeTHoldWindowIndices(double[] dArray, double[] dTime, double dWindowSize, double dTHold, int iComparator, boolean bUseAbsoluteValue)
          Method to find, within the sliding window of predefined size as compared against the time array, the indices of the value array that yield a linear regression slope that compares favorably with the threshold using the comparator.
static int[] slopeTHoldWindowIndices(double[] dArray, double[] dTime, java.lang.Double DWindowSize, java.lang.Double DTHold, java.lang.String strComparator, java.lang.Boolean BUseAbsoluteValue)
          Method to find, within the sliding window of predefined size as compared against the time array, the indices of the value array that yield a linear regression slope that compares favorably with the threshold using the comparator.
static int[] sortedArrayIntersection(int[][] arrays)
          Method that takes an array of int[] objects containing the indices of rows in a source of data (e.g., AbleDataTable) and assuming these indices are sorted in ascending order, finds the resulting int[] that contains the intersection of all of these indices.
static int[] sortedArrayIntersection(java.util.Vector vectArrays)
          Method that takes a vector of int[] objects containing the indices of rows in a source of data (e.g., AbleDataTable) and assuming these indices are sorted in ascending order, finds the resulting int[] that contains the intersection of all of these indices.
static int[] sortedArrayUnion(int[][] arrays)
          Method that takes an array of int[] objects containing the indices of rows in a source of data (e.g., AbleDataTable) and assuming these indices are sorted in ascending order, finds the resulting int[] that contains the union of all of these indices.
static int[] sortedArrayUnion(java.util.Vector vectArrays)
          Method that takes a vector of int[] objects containing the indices of rows in a source of data (e.g., AbleDataTable) and assuming these indices are sorted in ascending order, finds the resulting int[] that contains the union of all of these indices.
static java.lang.Boolean testMonotonic(double[] dArray, java.lang.Double DStartIndex, java.lang.Double DEndIndex, java.lang.Double DComparator)
          Method that is the same as valueMonotonicWindowIndices, but it returns a Boolean examining the range of indices.
static java.lang.Boolean testMonotonic(double[] dArray, java.lang.Double DStartIndex, java.lang.Double DEndIndex, java.lang.Double DComparator, java.lang.Boolean BAllowReset)
          Method that is the same as valueMonotonicWindowIndices, but it returns a Boolean examining the range of indices.
static java.lang.Boolean testMonotonic(double[] dArray, java.lang.Double DStartIndex, java.lang.Double DEndIndex, java.lang.String strComparator)
          Method that is the same as valueMonotonicWindowIndices, but it returns a Boolean examining the range of indices.
static java.lang.Boolean testMonotonic(double[] dArray, java.lang.Double DStartIndex, java.lang.Double DEndIndex, java.lang.String strComparator, java.lang.Boolean BAllowReset)
          Method that is the same as valueMonotonicWindowIndices, but it returns a Boolean examining the range of indices.
static boolean testMonotonic(double[] dArray, int iStartIndex, int iEndIndex, int iComparator, boolean bAllowReset)
          Method that is the same as valueMonotonicWindowIndices, but it returns a Boolean examining the range of indices.
static java.lang.Boolean testMonotonic(int[] iArray, java.lang.Double DStartIndex, java.lang.Double DEndIndex, java.lang.Double DComparator)
          Method that is the same as valueMonotonicWindowIndices, but it returns a Boolean examining the range of indices.
static java.lang.Boolean testMonotonic(int[] iArray, java.lang.Double DStartIndex, java.lang.Double DEndIndex, java.lang.Double DComparator, java.lang.Boolean BAllowReset)
          Method that is the same as valueMonotonicWindowIndices, but it returns a Boolean examining the range of indices.
static java.lang.Boolean testMonotonic(int[] iArray, java.lang.Double DStartIndex, java.lang.Double DEndIndex, java.lang.String strComparator)
          Method that is the same as valueMonotonicWindowIndices, but it returns a Boolean examining the range of indices.
static java.lang.Boolean testMonotonic(int[] iArray, java.lang.Double DStartIndex, java.lang.Double DEndIndex, java.lang.String strComparator, java.lang.Boolean BAllowReset)
          Method that is the same as valueMonotonicWindowIndices, but it returns a Boolean examining the range of indices.
static boolean testMonotonic(int[] iArray, int iStartIndex, int iEndIndex, int iComparator, boolean bAllowReset)
          Method that is the same as valueMonotonicWindowIndices, but it returns a Boolean examining the range of indices.
static boolean testTHold(java.lang.Double DTHold, java.lang.Double DValue, java.lang.Double DComparator)
          Method to return whether or not the value compares favorably with the threshold value.
static boolean testTHold(double dTHold, double dValue, int iComparator)
          Method to return whether or not the value compares favorably with the threshold value.
static boolean testTHold(java.lang.Double DTHold, java.lang.Double DValue, java.lang.String strComparator)
          Method to return whether or not the value compares favorably with the threshold value.
static int[] transitionTHoldWindowIndices(double[] dArray, double[] dTime, java.lang.Double DWindowSize, java.lang.Double DTHold)
           
static int[] valueMonotonicWindowIndices(double[] dArray, double[] dTime, java.lang.Double DWindowSize, java.lang.Boolean BAllowReset, java.lang.Double DComparator)
          A method to find the indices of rows in the value array where the values within the sliding window as compared against the time array are conforming to the monotonic direction specified by direction, taking reset conditions into account iff the flag passed is true.
static int[] valueMonotonicWindowIndices(double[] dArray, double[] dTime, double dWindowSize, boolean bAllowReset, int iComparator)
          A method to find the indices of rows in the value array where the values within the sliding window as compared against the time array are conforming to the monotonic direction specified by direction, taking reset conditions into account iff the flag passed is true.
static int[] valueMonotonicWindowIndices(double[] dArray, double[] dTime, java.lang.Double DWindowSize, java.lang.Boolean BAllowReset, java.lang.String strComparator)
          A method to find the indices of rows in the value array where the values within the sliding window as compared against the time array are conforming to the monotonic direction specified by direction, taking reset conditions into account iff the flag passed is true.
static int[] valueTHoldWindowIndices(double[] dArray, double[] dTime, double dWindowSize, double dTHold, int iComparator)
          Method to find, within the sliding window of predefined size as compared against the time array, the indices of the value array that compare favorably with the threshold using the comparator.
static int[] valueTHoldWindowIndices(double[] dArray, double[] dTime, java.lang.Double DWindowSize, java.lang.Double DTHold, java.lang.String strComparator)
          Method to find, within the sliding window of predefined sized as compared against the time array, the indices of the value array that compare favorably with the threshold using the comparator.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

INVALID_INDEX

public static final int INVALID_INDEX
Equal to -1, this is used to signal an invalid index for operations expecting to return an index to information (typically uesd when none is available or when an error has occurred).

INTERCEPT_INDEX

public static final int INTERCEPT_INDEX
Equal to 1, this defines the index of the intercept in the array returned by linear regression calculations.

SLOPE_INDEX

public static final int SLOPE_INDEX
Equal to 0, this defines the index of the slope in the array returned by linear regression calculations.

EQ

public static final int EQ
Equal to 2, this defines the value to signify EQ (Equal)

GE

public static final int GE
Equal to 3, this defines the value to signify GE (Greater than or Equal)

GT

public static final int GT
Equal to 4, this defines the value to signify GT (Greater Than)

LE

public static final int LE
Equal to 1, this defines the value to signify LE (Less than or Equal)

LT

public static final int LT
Equal to 0, this defines the value to signify LT (Less than)

NE

public static final int NE
Equal to 5, this defines the value to signify NE (Not Equal)

INVALID

public static final int INVALID
Equal to -1, this defines the value to signify an invalid comparator.
See Also:
LT, LE, EQ, GE, GT, NE

strComparisonSymbols

public static final java.lang.String[] strComparisonSymbols
A String[] containing the symbolic names for the comparators.
See Also:
LT, LE, EQ, GE, GT, NE

strComparisonNames

public static final java.lang.String[] strComparisonNames
A String[] containing the abbreviated names for the comparators.
See Also:
LT, LE, EQ, GE, GT, NE
Constructor Detail

AbleDataAnalytics

public AbleDataAnalytics()
Constructor for this class. Not really needed since the methods are all static.
Method Detail

getComparisonByName

public static int getComparisonByName(java.lang.String strComparator)
Method to return the numeric value corresponding with the String passed in.
Parameters:
strComparator - A string containing one of the following: "LT", "LE", "EQ", "GE", "GT", "NE"
Returns:
int corresponding to the string passed in.
See Also:
LT, LE, EQ, GE, GT, NE

booleanAnd

public static java.lang.Boolean booleanAnd(java.lang.Boolean b1,
                                           java.lang.Boolean b2)
Helper method to all the logical "AND" of two Boolean values.
Parameters:
b1 - First Boolean value to be combined with the other (b2).
b2 - Second Boolean value to be combined with the other (b1).
Returns:
Boolean containing the result of the logical "AND" of the passed parameters b1, and b2.

getArrayCount

public static java.lang.Double getArrayCount(int[] iArray)
Helper method to return the length of an int array (int[])
Parameters:
iArray - the array whose length is to be returned.
Returns:
A Double containing the length of the passed int[].

getArrayCount

public static java.lang.Double getArrayCount(double[] dArray)
Helper method to return the length of a double array (double[])
Parameters:
dArray - the array whose length is to be returned.
Returns:
A Double containing the length of the passed double[].

arrayContentsAsString

public static java.lang.String arrayContentsAsString(int[] iArray)
Static utility method to return the content of an int array (int[]) as a String of comma separated values.
Parameters:
iArray - An int[] whose contents are to be listed in the returned string.
Returns:
A String with the contents of the passed array as a list of of comma separated values.

arrayContentsAsString

public static java.lang.String arrayContentsAsString(int[] iArray,
                                                     int iBreakCount)
Static utility method to return the content of an int array (int[]) as a String of comma separated values, with line terminators every N values listed.
Parameters:
iArray - An int[] whose contents are to be listed in the returned string.
iBreakCount - inserts a newline after this number of entries has been added to the output String.
Returns:
A String with the contents of the passed array as a list of of comma separated values.

arrayContentsAsString

public static java.lang.String arrayContentsAsString(double[] dArray)
Static utility method to return the content of an double array (double[]) as a String of comma separated values.
Parameters:
dArray - An double[] whose contents are to be listed in the returned string.
Returns:
A String with the contents of the passed array as a list of of comma separated values.

arrayContentsAsString

public static java.lang.String arrayContentsAsString(double[] dArray,
                                                     double iBreakCount)
Static utility method to return the content of an double array (double[]) as a String of comma separated values, with line terminators every N values listed.
Parameters:
dArray - An double[] whose contents are to be listed in the returned string.
iBreakCount - inserts a newline after this number of entries has been added to the output String.
Returns:
A String with the contents of the passed array as a list of of comma separated values.

countNonContiguousTHold

public static java.lang.Double countNonContiguousTHold(double[] dArray,
                                                       java.lang.Double DTHold,
                                                       java.lang.String strComparator)
Method that counts the values in the passed double array (double[]) that meet the comparison defined by strComparator to the passed threshold (e.g., # values GE 2.0)
Parameters:
dArray - A double[] whose contents are compared against the supplied threshold using the supplied comparator.
DTHold - A Double containing the threshold value to be compared with the contents of the supplied double[].
strComparator - A String containing the label for the comparison to be performed.
Returns:
A Double containing the number of entries in the passed value array that passed the comparison test with the threshold.
See Also:
LT, LE, EQ, GE, GT, NE

countNonContiguousTHold

public static java.lang.Double countNonContiguousTHold(double[] dArray,
                                                       java.lang.Double DTHold,
                                                       java.lang.Double DComparator)
Method that counts the values in the passed double array (double[]) that meet the comparison defined by strComparator to the passed threshold (e.g., # values GE 2.0)
Parameters:
dArray - A double[] whose contents are compared against the supplied threshold using the supplied comparator.
DTHold - A Double containing the threshold value to be compared with the contents of the supplied double[].
DComparator - A Double containing the value for the comparison to be performed.
Returns:
A Double containing the number of entries in the passed value array that passed the comparison test with the threshold.
See Also:
LT, LE, EQ, GE, GT, NE

countNonContiguousTHold

public static int countNonContiguousTHold(double[] dArray,
                                          double dTHold,
                                          int iComparator)
Method that counts the values in the passed double array (double[]) that meet the comparison defined by strComparator to the passed threshold (e.g., # values GE 2.0)
Parameters:
dArray - A double[] whose contents are compared against the supplied threshold using the supplied comparator.
dTHold - A double containing the threshold value to be compared with the contents of the supplied double[].
iComparator - An int containing the value for the comparison to be performed.
Returns:
An int containing the number of entries in the passed value array that passed the comparison test with the threshold.
See Also:
LT, LE, EQ, GE, GT, NE

findContiguousInWindow

public static int[] findContiguousInWindow(int[] inputIndices,
                                           double[] dTime,
                                           java.lang.Double DWindowSize)
Method using a sliding window against the dTime array, find the sets of indices in inputIndices that are contiguous and return only these contiguous indices in an int[]. Used after taking an intersection of various indices to columns to find sections (rows) that didn't skip any entries within the sliding window.
Parameters:
inputIndices - An int[] of record indices that have been previously selected from what were once monotonically increasing values (like record numbers where inputIndices[i] + 1 = inputIndices[i+1]). This method reviews the values in this array to find groups of values that do increase by one within the specified sliding window of time.
dTime - A double[] of values representing some increase of time. These values aren't interpreted to glean calendar dates and times, but are expected to represent seconds with optional fractions of time. These values are compared using the window size.
DWindowSize - A Double measuring the amount of time (as measured by the values in the dTime array) as a sliding window used to review the values in dArray.
Returns:
An int[] that contains copies of the values from the inputIndices that were contiguous throughout the entire sliding window of time defined by DWindowSize. If an invalid parameter is received or no contiguous values are found, an empty int array is returned (e.g., return new int[0]).

findContiguousInWindow

public static int[] findContiguousInWindow(int[] inputIndices,
                                           double[] dTime,
                                           double dWindowSize)
Method using a sliding window against the dTime array, find the sets of indices in inputIndices that are contiguous and return only these contiguous indices in an int[]. Used after taking an intersection of various indices to columns to find sections (rows) that didn't skip any entries within the sliding window.
Parameters:
inputIndices - An int[] of record indices that have been previously selected from what were once monotonically increasing values (like record numbers where inputIndices[i] + 1 = inputIndices[i+1]). This method reviews the values in this array to find groups of values that do increase by one within the specified sliding window of time.
dTime - A double[] of values representing some increase of time. These values aren't interpreted to glean calendar dates and times, but are expected to represent seconds with optional fractions of time. These values are compared using the window size.
dWindowSize - A double measuring the amount of time (as measured by the values in the dTime array) as a sliding window used to review the values in dArray.
Returns:
An int[] that contains copies of the values from the inputIndices that were contiguous throughout the entire sliding window of time defined by dWindowSize. If an invalid parameter is received or no contiguous values are found, an empty int array is returned (e.g., return new int[0]).

valueMonotonicWindowIndices

public static int[] valueMonotonicWindowIndices(double[] dArray,
                                                double[] dTime,
                                                java.lang.Double DWindowSize,
                                                java.lang.Boolean BAllowReset,
                                                java.lang.String strComparator)
A method to find the indices of rows in the value array where the values within the sliding window as compared against the time array are conforming to the monotonic direction specified by direction, taking reset conditions into account iff the flag passed is true. For example, find out if the value array values are increasing (GE) during a 5 second window allowing for resets (e.g., where the values can be set backward - like a counter). It will distinguish between a flat signal and one that increases and resets (like a counter value that wraps).
Parameters:
dArray - A double[] of values to be reviewed by this method.
dTime - A double[] of values representing some increase of time. These values aren't interpreted to glean calendar dates and times, but are expected to represent seconds with optional fractions of time. These values are compared using the window size.
DWindowSize - A Double measuring the amount of time (as measured by the values in the dTime array) as a sliding window used to review the values in dArray to see if these values conform with the specified test, allowing for resets as specified by the flag BAllowReset.
BAllowReset - A Boolean to determine if a reset condition is to be permitted (true) or not (false) when evaluating the direction of the values in dValue.
strComparator - A String describing the direction that this method will look for in the dArray values. For example, "GE" will test to see that during the sliding window, at least one value is greater than the rest within the sliding window of time.
Returns:
An int[] that contains copies of the values from the dArray that were moving in the specified direction throughout the entire sliding window of time defined by dWindowSize. If an invalid parameter is received or no contiguous values are found, an empty int array is returned (e.g., return new int[0]).
See Also:
LT, LE, EQ, GE, GT, NE

valueMonotonicWindowIndices

public static int[] valueMonotonicWindowIndices(double[] dArray,
                                                double[] dTime,
                                                java.lang.Double DWindowSize,
                                                java.lang.Boolean BAllowReset,
                                                java.lang.Double DComparator)
A method to find the indices of rows in the value array where the values within the sliding window as compared against the time array are conforming to the monotonic direction specified by direction, taking reset conditions into account iff the flag passed is true. For example, find out if the value array values are increasing (GE) during a 5 second window allowing for resets (e.g., where the values can be set backward - like a counter). It will distinguish between a flat signal and one that increases and resets (like a counter value that wraps).
Parameters:
dArray - A double[] of values to be reviewed by this method.
dTime - A double[] of values representing some increase of time. These values aren't interpreted to glean calendar dates and times, but are expected to represent seconds with optional fractions of time. These values are compared using the window size.
DWindowSize - A Double measuring the amount of time (as measured by the values in the dTime array) as a sliding window used to review the values in dArray to see if these values conform with the specified test, allowing for resets as specified by the flag BAllowReset.
BAllowReset - A Boolean to determine if a reset condition is to be permitted (true) or not (false) when evaluating the direction of the values in dValue.
DComparator - A Double describing the direction that this method will look for in the dArray values. For example, GE will test to see that during the sliding window, at least one value is greater than the rest within the sliding window of time.
Returns:
An int[] that contains copies of the values from the dArray that were moving in the specified direction throughout the entire sliding window of time defined by DWindowSize. If an invalid parameter is received or no contiguous values are found, an empty int array is returned (e.g., return new int[0]).
See Also:
LT, LE, EQ, GE, GT, NE

valueMonotonicWindowIndices

public static int[] valueMonotonicWindowIndices(double[] dArray,
                                                double[] dTime,
                                                double dWindowSize,
                                                boolean bAllowReset,
                                                int iComparator)
A method to find the indices of rows in the value array where the values within the sliding window as compared against the time array are conforming to the monotonic direction specified by direction, taking reset conditions into account iff the flag passed is true. For example, find out if the value array values are increasing (GE) during a 5 second window allowing for resets (e.g., where the values can be set backward - like a counter). It will distinguish between a flat signal and one that increases and resets (like a counter value that wraps).
Parameters:
dArray - A double[] of values to be reviewed by this method.
dTime - A double[] of values representing some increase of time. These values aren't interpreted to glean calendar dates and times, but are expected to represent seconds with optional fractions of time. These values are compared using the window size.
dWindowSize - A double measuring the amount of time (as measured by the values in the dTime array) as a sliding window used to review the values in dArray to see if these values conform with the specified test, allowing for resets as specified by the flag bAllowReset.
bAllowReset - A boolean to determine if a reset condition is to be permitted (true) or not (false) when evaluating the direction of the values in dValue.
iComparator - An int describing the direction that this method will look for in the dArray values. For example, GE will test to see that during the sliding window, at least one value is greater than the rest within the sliding window of time.
Returns:
An int[] that contains copies of the values from the dArray that were moving in the specified direction throughout the entire sliding window of time defined by dWindowSize. If an invalid parameter is received or no contiguous values are found, an empty int array is returned (e.g., return new int[0]).
See Also:
LT, LE, EQ, GE, GT, NE

transitionTHoldWindowIndices

public static int[] transitionTHoldWindowIndices(double[] dArray,
                                                 double[] dTime,
                                                 java.lang.Double DWindowSize,
                                                 java.lang.Double DTHold)

testMonotonic

public static java.lang.Boolean testMonotonic(int[] iArray,
                                              java.lang.Double DStartIndex,
                                              java.lang.Double DEndIndex,
                                              java.lang.String strComparator)
Method that is the same as valueMonotonicWindowIndices, but it returns a Boolean examining the range of indices.
Parameters:
iArray - An int[] containing the values to be evaluated.
DStartIndex - A Double containing the starting index within the value array (iArray) to be evaluated.
DEndIndex - A Double containing the ending index within the value array (iArray) to be evaluated.
strComparator - A String containing the comparator to be used to evaluate the values in the value array.
Returns:
A Boolean determining if the values in the value array within the range [Start,End] are consistent with respect to the comparator.
See Also:
valueMonotonicWindowIndices(double[], double[], java.lang.Double, java.lang.Boolean, java.lang.String), LT, LE, EQ, GE, GT, NE

testMonotonic

public static java.lang.Boolean testMonotonic(int[] iArray,
                                              java.lang.Double DStartIndex,
                                              java.lang.Double DEndIndex,
                                              java.lang.Double DComparator)
Method that is the same as valueMonotonicWindowIndices, but it returns a Boolean examining the range of indices.
Parameters:
iArray - An int[] containing the values to be evaluated.
DStartIndex - A Double containing the starting index within the value array (iArray) to be evaluated.
DEndIndex - A Double containing the ending index within the value array (iArray) to be evaluated.
DComparator - A Double containing the comparator to be used to evaluate the values in the value array.
Returns:
A Boolean determining if the values in the value array within the range [Start,End] are consistent with respect to the comparator.
See Also:
valueMonotonicWindowIndices(double[], double[], java.lang.Double, java.lang.Boolean, java.lang.String), LT, LE, EQ, GE, GT, NE

testMonotonic

public static java.lang.Boolean testMonotonic(int[] iArray,
                                              java.lang.Double DStartIndex,
                                              java.lang.Double DEndIndex,
                                              java.lang.String strComparator,
                                              java.lang.Boolean BAllowReset)
Method that is the same as valueMonotonicWindowIndices, but it returns a Boolean examining the range of indices.
Parameters:
iArray - An int[] containing the values to be evaluated.
DStartIndex - A Double containing the starting index within the value array (iArray) to be evaluated.
DEndIndex - A Double containing the ending index within the value array (iArray) to be evaluated.
strComparator - A String containing the comparator to be used to evaluate the values in the value array.
BAllowReset - A Boolean to determine if a reset condition is to be permitted (true) or not (false) when evaluating the direction of the values in iArray.
Returns:
A Boolean determining if the values in the value array within the range [Start,End] are consistent with respect to the comparator.
See Also:
valueMonotonicWindowIndices(double[], double[], java.lang.Double, java.lang.Boolean, java.lang.String), LT, LE, EQ, GE, GT, NE

testMonotonic

public static java.lang.Boolean testMonotonic(int[] iArray,
                                              java.lang.Double DStartIndex,
                                              java.lang.Double DEndIndex,
                                              java.lang.Double DComparator,
                                              java.lang.Boolean BAllowReset)
Method that is the same as valueMonotonicWindowIndices, but it returns a Boolean examining the range of indices.
Parameters:
iArray - An int[] containing the values to be evaluated.
DStartIndex - A Double containing the starting index within the value array (iArray) to be evaluated.
DEndIndex - A Double containing the ending index within the value array (iArray) to be evaluated.
DComparator - A Double containing the comparator to be used to evaluate the values in the value array.
BAllowReset - A Boolean to determine if a reset condition is to be permitted (true) or not (false) when evaluating the direction of the values in iArray.
Returns:
A Boolean determining if the values in the value array within the range [Start,End] are consistent with respect to the comparator.
See Also:
valueMonotonicWindowIndices(double[], double[], java.lang.Double, java.lang.Boolean, java.lang.String), LT, LE, EQ, GE, GT, NE

testMonotonic

public static boolean testMonotonic(int[] iArray,
                                    int iStartIndex,
                                    int iEndIndex,
                                    int iComparator,
                                    boolean bAllowReset)
Method that is the same as valueMonotonicWindowIndices, but it returns a Boolean examining the range of indices.
Parameters:
iArray - An int[] containing the values to be evaluated.
iStartIndex - An int containing the starting index within the value array (iArray) to be evaluated.
iEndIndex - An int containing the ending index within the value array (iArray) to be evaluated.
iComparator - An int containing the comparator to be used to evaluate the values in the value array.
bAllowReset - A boolean to determine if a reset condition is to be permitted (true) or not (false) when evaluating the direction of the values in iArray.
Returns:
A Boolean determining if the values in the value array within the range [Start,End] are consistent with respect to the comparator.
See Also:
valueMonotonicWindowIndices(double[], double[], java.lang.Double, java.lang.Boolean, java.lang.String), LT, LE, EQ, GE, GT, NE

testMonotonic

public static java.lang.Boolean testMonotonic(double[] dArray,
                                              java.lang.Double DStartIndex,
                                              java.lang.Double DEndIndex,
                                              java.lang.String strComparator)
Method that is the same as valueMonotonicWindowIndices, but it returns a Boolean examining the range of indices.
Parameters:
dArray - A double[] containing the values to be evaluated.
DStartIndex - A Double containing the starting index within the value array (iArray) to be evaluated.
DEndIndex - A Double containing the ending index within the value array (iArray) to be evaluated.
strComparator - A String containing the comparator to be used to evaluate the values in the value array.
Returns:
A Boolean determining if the values in the value array within the range [Start,End] are consistent with respect to the comparator.
See Also:
valueMonotonicWindowIndices(double[], double[], java.lang.Double, java.lang.Boolean, java.lang.String), LT, LE, EQ, GE, GT, NE

testMonotonic

public static java.lang.Boolean testMonotonic(double[] dArray,
                                              java.lang.Double DStartIndex,
                                              java.lang.Double DEndIndex,
                                              java.lang.Double DComparator)
Method that is the same as valueMonotonicWindowIndices, but it returns a Boolean examining the range of indices.
Parameters:
dArray - A double[] containing the values to be evaluated.
DStartIndex - A Double containing the starting index within the value array (iArray) to be evaluated.
DEndIndex - A Double containing the ending index within the value array (iArray) to be evaluated.
DComparator - A Double containing the comparator to be used to evaluate the values in the value array.
Returns:
A Boolean determining if the values in the value array within the range [Start,End] are consistent with respect to the comparator.
See Also:
valueMonotonicWindowIndices(double[], double[], java.lang.Double, java.lang.Boolean, java.lang.String), LT, LE, EQ, GE, GT, NE

testMonotonic

public static java.lang.Boolean testMonotonic(double[] dArray,
                                              java.lang.Double DStartIndex,
                                              java.lang.Double DEndIndex,
                                              java.lang.String strComparator,
                                              java.lang.Boolean BAllowReset)
Method that is the same as valueMonotonicWindowIndices, but it returns a Boolean examining the range of indices.
Parameters:
dArray - A double[] containing the values to be evaluated.
DStartIndex - A Double containing the starting index within the value array (iArray) to be evaluated.
DEndIndex - A Double containing the ending index within the value array (iArray) to be evaluated.
strComparator - A String containing the comparator to be used to evaluate the values in the value array.
BAllowReset - A Boolean to determine if a reset condition is to be permitted (true) or not (false) when evaluating the direction of the values in iArray.
Returns:
A Boolean determining if the values in the value array within the range [Start,End] are consistent with respect to the comparator.
See Also:
valueMonotonicWindowIndices(double[], double[], java.lang.Double, java.lang.Boolean, java.lang.String), LT, LE, EQ, GE, GT, NE

testMonotonic

public static java.lang.Boolean testMonotonic(double[] dArray,
                                              java.lang.Double DStartIndex,
                                              java.lang.Double DEndIndex,
                                              java.lang.Double DComparator,
                                              java.lang.Boolean BAllowReset)
Method that is the same as valueMonotonicWindowIndices, but it returns a Boolean examining the range of indices.
Parameters:
dArray - A double[] containing the values to be evaluated.
DStartIndex - A Double containing the starting index within the value array (iArray) to be evaluated.
DEndIndex - A Double containing the ending index within the value array (iArray) to be evaluated.
DComparator - A Double containing the comparator to be used to evaluate the values in the value array.
BAllowReset - A Boolean to determine if a reset condition is to be permitted (true) or not (false) when evaluating the direction of the values in iArray.
Returns:
A Boolean determining if the values in the value array within the range [Start,End] are consistent with respect to the comparator.
See Also:
valueMonotonicWindowIndices(double[], double[], java.lang.Double, java.lang.Boolean, java.lang.String), LT, LE, EQ, GE, GT, NE

testMonotonic

public static boolean testMonotonic(double[] dArray,
                                    int iStartIndex,
                                    int iEndIndex,
                                    int iComparator,
                                    boolean bAllowReset)
Method that is the same as valueMonotonicWindowIndices, but it returns a Boolean examining the range of indices.
Parameters:
dArray - A double[] containing the values to be evaluated.
iStartIndex - An int containing the starting index within the value array (iArray) to be evaluated.
iEndIndex - An int containing the ending index within the value array (iArray) to be evaluated.
iComparator - An int containing the comparator to be used to evaluate the values in the value array.
bAllowReset - A boolean to determine if a reset condition is to be permitted (true) or not (false) when evaluating the direction of the values in iArray.
Returns:
A Boolean determining if the values in the value array within the range [Start,End] are consistent with respect to the comparator.
See Also:
valueMonotonicWindowIndices(double[], double[], java.lang.Double, java.lang.Boolean, java.lang.String), LT, LE, EQ, GE, GT, NE

sortedArrayIntersection

public static int[] sortedArrayIntersection(java.util.Vector vectArrays)
Method that takes a vector of int[] objects containing the indices of rows in a source of data (e.g., AbleDataTable) and assuming these indices are sorted in ascending order, finds the resulting int[] that contains the intersection of all of these indices. So, if one array contained {1,3,4,5,9,10} and the other contained {2,4,5,6,8,10}, we'd return {4,5,10}. This works with N index arrays in the Vector.
Parameters:
vectArrays - A Vector containing N int[]'s whose contents are assumed to be sorted in ascending order.
Returns:
An int[] containing the intersection of all the other int[]'s contained in the Vector. If no intersection is found then an empty int[] is returned (e.g., return new int[0])).

sortedArrayIntersection

public static int[] sortedArrayIntersection(int[][] arrays)
Method that takes an array of int[] objects containing the indices of rows in a source of data (e.g., AbleDataTable) and assuming these indices are sorted in ascending order, finds the resulting int[] that contains the intersection of all of these indices. So, if one array contained {1,3,4,5,9,10} and the other contained {2,4,5,6,8,10}, we'd return {4,5,10}. This works with N index arrays in the original array of int[]'s.
Parameters:
arrays - An array of int[]'s containing N int[]'s whose contents are assumed to be sorted in ascending order.
Returns:
An int[] containing the intersection of all the other int[]'s contained in the Vector. If no intersection is found then an empty int[] is returned (e.g., return new int[0])).

sortedArrayUnion

public static int[] sortedArrayUnion(java.util.Vector vectArrays)
Method that takes a vector of int[] objects containing the indices of rows in a source of data (e.g., AbleDataTable) and assuming these indices are sorted in ascending order, finds the resulting int[] that contains the union of all of these indices. So, if one array contained {4,5,10} and the other contained {2,5,6,8}, we'd return {2,4,5,6,8,10}. This works with N index arrays in the Vector.
Parameters:
vectArrays - A Vector containing N int[]'s whose contents are assumed to be sorted in ascending order.
Returns:
An int[] containing the union of all the other int[]'s contained in the Vector. If no union is found then an empty int[] is returned (e.g., return new int[0])).

sortedArrayUnion

public static int[] sortedArrayUnion(int[][] arrays)
Method that takes an array of int[] objects containing the indices of rows in a source of data (e.g., AbleDataTable) and assuming these indices are sorted in ascending order, finds the resulting int[] that contains the union of all of these indices. So, if one array contained {4,5,10} and the other contained {2,5,6,8}, we'd return {2,4,5,6,8,10}. This works with N index arrays in the array of int[]'s.
Parameters:
arrays - An array of int[]'s containing N int[]'s whose contents are assumed to be sorted in ascending order.
Returns:
An int[] containing the union of all the other int[]'s contained in the Vector. If no union is found then an empty int[] is returned (e.g., return new int[0])).

recordIndices

public static java.lang.Double recordIndices(int[] iArray,
                                             java.lang.Double DStart,
                                             java.lang.Double DEnd,
                                             java.lang.Double DLast)
Method that, given an existing array of sorted indices (iArray), and a range of other indices, and the last index we'd written to in the iArray, add the missing indices in the range [iStart,iEnd] to the iArray and return the new last index position in iArray we'd written to. Used for capturing indices from a sliding window into a collection array of indices without duplicating the indices.
Parameters:
iArray - An int[] containing the sorted values to be appended with non-overlapping values in the range [Start,End].
DStart - A Double containing the start index of a range.
DEnd - A Double containing the end index of a range.
DLast - A Double containing the last index in iArray that had recorded values.
Returns:
A Double containing the last index written to in the index array (iArray).

recordIndices

public static int recordIndices(int[] iArray,
                                int iStart,
                                int iEnd,
                                int iLast)
Method that, given an existing array of sorted indices (iArray), and a range of other indices, and the last index we'd written to in the iArray, add the missing indices in the range [iStart,iEnd] to the iArray and return the new last index position in iArray we'd written to. Used for capturing indices from a sliding window into a collection array of indices without duplicating the indices.
Parameters:
iArray - An int[] containing the sorted values to be appended with non-overlapping values in the range [Start,End].
iStart - An int containing the start index of a range.
iEnd - An int containing the end index of a range.
iLast - An int containing the last index in iArray that had recorded values.
Returns:
A Double containing the last index written to in the index array (iArray).

meanTHoldWindowIndices

public static int[] meanTHoldWindowIndices(double[] dArray,
                                           double[] dTime,
                                           java.lang.Double DWindowSize,
                                           java.lang.Double DTHold,
                                           java.lang.String strComparator)
Method to evaluate a sliding window of predefined size against an array of time values and for the corresponding elements of the value array, see if their mean value compares favorably against the threshold value using the comparator, and return an array of the indices to the rows where this occurs. For example, find the rows whose average of the value array in a sliding window of 5 seconds that is GE 5.0.
Parameters:
dArray - A double[] of vlaues to be evaluated.
dTime - A double[] of values representing some increase of time. These values aren't interpreted to glean calendar dates and times, but are expected to represent seconds with optional fractions of time. These values are compared using the window size.
DWindowSize - A Double measuring the amount of time (as measured by the values in the dTime array) as a sliding window used to review the values in dArray.
DTHold - A Double containing a threshold value to be compared against the values in the value array.
strComparator - A String containing the label for the comparison to be performed.
Returns:
An int[] containing the indices in the value array where the average across the sliding window meets the comparison against the threshold.
See Also:
LT, LE, EQ, GE, GT, NE

meanTHoldWindowIndices

public static int[] meanTHoldWindowIndices(double[] dArray,
                                           double[] dTime,
                                           java.lang.Double DWindowSize,
                                           java.lang.Double DTHold,
                                           java.lang.Double DComparator)
Method to evaluate a sliding window of predefined size against an array of time values and for the corresponding elements of the value array, see if their mean value compares favorably against the threshold value using the comparator, and return an array of the indices to the rows where this occurs. For example, find the rows whose average of the value array in a sliding window of 5 seconds that is GE 5.0.
Parameters:
dArray - A double[] of vlaues to be evaluated.
dTime - A double[] of values representing some increase of time. These values aren't interpreted to glean calendar dates and times, but are expected to represent seconds with optional fractions of time. These values are compared using the window size.
DWindowSize - A Double measuring the amount of time (as measured by the values in the dTime array) as a sliding window used to review the values in dArray.
DTHold - A Double containing a threshold value to be compared against the values in the value array.
DComparator - A Double containing the label for the comparison to be performed.
Returns:
An int[] containing the indices in the value array where the average across the sliding window meets the comparison against the threshold.
See Also:
LT, LE, EQ, GE, GT, NE

meanTHoldWindowIndices

public static int[] meanTHoldWindowIndices(double[] dArray,
                                           double[] dTime,
                                           double dWindowSize,
                                           double dTHold,
                                           int iComparator)
Method to evaluate a sliding window of predefined size against an array of time values and for the corresponding elements of the value array, see if their mean value compares favorably against the threshold value using the comparator, and return an array of the indices to the rows where this occurs. For example, find the rows whose average of the value array in a sliding window of 5 seconds that is GE 5.0.
Parameters:
dArray - A double[] of vlaues to be evaluated.
dTime - A double[] of values representing some increase of time. These values aren't interpreted to glean calendar dates and times, but are expected to represent seconds with optional fractions of time. These values are compared using the window size.
dWindowSize - A double measuring the amount of time (as measured by the values in the dTime array) as a sliding window used to review the values in dArray.
dTHold - A double containing a threshold value to be compared against the values in the value array.
iComparator - An int containing the label for the comparison to be performed.
Returns:
An int[] containing the indices in the value array where the average across the sliding window meets the comparison against the threshold.
See Also:
LT, LE, EQ, GE, GT, NE

valueTHoldWindowIndices

public static int[] valueTHoldWindowIndices(double[] dArray,
                                            double[] dTime,
                                            java.lang.Double DWindowSize,
                                            java.lang.Double DTHold,
                                            java.lang.String strComparator)
Method to find, within the sliding window of predefined sized as compared against the time array, the indices of the value array that compare favorably with the threshold using the comparator. For example, find the indices of the value array within a 5 second sliding window that are NE 2.0.
Parameters:
dArray - A double[] of vlaues to be evaluated.
dTime - A double[] of values representing some increase of time. These values aren't interpreted to glean calendar dates and times, but are expected to represent seconds with optional fractions of time. These values are compared using the window size.
DWindowSize - A Double measuring the amount of time (as measured by the values in the dTime array) as a sliding window used to review the values in dArray.
DTHold - A Double containing a threshold value to be compared against the values in the value array.
strComparator - A String containing the label for the comparison to be performed.
Returns:
An int[] containing the indices in the value array where the average across the sliding window meets the comparison against the threshold.
See Also:
LT, LE, EQ, GE, GT, NE

testTHold

public static boolean testTHold(java.lang.Double DTHold,
                                java.lang.Double DValue,
                                java.lang.String strComparator)
Method to return whether or not the value compares favorably with the threshold value. For example, is value LE theshold.
Parameters:
DValue - A Double containing a value to be compared against the passed threshold value.
DTHold - A Double containing a threshold value to be compared against the passed value.
strComparator - A String containing the label for the comparison to be performed.
Returns:
A boolean describing whether (true) or not (false) the comparison of the value to the threshold was true or not.
See Also:
LT, LE, EQ, GE, GT, NE

testTHold

public static boolean testTHold(java.lang.Double DTHold,
                                java.lang.Double DValue,
                                java.lang.Double DComparator)
Method to return whether or not the value compares favorably with the threshold value. For example, is value LE theshold.
Parameters:
DValue - A Double containing a value to be compared against the passed threshold value.
DTHold - A Double containing a threshold value to be compared against the passed value.
DComparator - A Double containing the label for the comparison to be performed.
Returns:
A boolean describing whether (true) or not (false) the comparison of the value to the threshold was true or not.
See Also:
LT, LE, EQ, GE, GT, NE

testTHold

public static boolean testTHold(double dTHold,
                                double dValue,
                                int iComparator)
Method to return whether or not the value compares favorably with the threshold value. For example, is value LE theshold.
Parameters:
dValue - A double containing a value to be compared against the passed threshold value.
dTHold - A double containing a threshold value to be compared against the passed value.
iComparator - An int containing the label for the comparison to be performed.
Returns:
A boolean describing whether (true) or not (false) the comparison of the value to the threshold was true or not.
See Also:
LT, LE, EQ, GE, GT, NE

valueTHoldWindowIndices

public static int[] valueTHoldWindowIndices(double[] dArray,
                                            double[] dTime,
                                            double dWindowSize,
                                            double dTHold,
                                            int iComparator)
Method to find, within the sliding window of predefined size as compared against the time array, the indices of the value array that compare favorably with the threshold using the comparator. For example, find the indices of the value array in a 5 second sliding window that are NE 2.0.
Parameters:
dArray - A double[] of vlaues to be evaluated.
dTime - A double[] of values representing some increase of time. These values aren't interpreted to glean calendar dates and times, but are expected to represent seconds with optional fractions of time. These values are compared using the window size.
dWindowSize - A double measuring the amount of time (as measured by the values in the dTime array) as a sliding window used to review the values in dArray.
dTHold - A double containing a threshold value to be compared against the values in the value array.
iComparator - An int containing the label for the comparison to be performed.
Returns:
An int[] containing the indices in the value array where the comparison with the threshold is favorable.
See Also:
LT, LE, EQ, GE, GT, NE

meanTHoldWindow

public static java.lang.Boolean meanTHoldWindow(double[] dArray,
                                                double[] dTime,
                                                java.lang.Double DWindowSize,
                                                java.lang.Double DTHold,
                                                java.lang.String strComparator)
Method to determine if there is a window of the sized passed in time, where the average of all the values of passed value array compare favorably against a threshold using a comparator. For example, this method could answer "Is it true there are 5 seconds worth of entries in dArray whose average is GT 5.0?" The method returns as soon as one sliding window has satisfied the criteria.
Parameters:
dArray - A double[] of vlaues to be evaluated.
dTime - A double[] of values representing some increase of time. These values aren't interpreted to glean calendar dates and times, but are expected to represent seconds with optional fractions of time. These values are compared using the window size.
DWindowSize - A Double measuring the amount of time (as measured by the values in the dTime array) as a sliding window used to review the values in dArray.
DTHold - A Double containing a threshold value to be compared against the values in the value array.
strComparator - A String containing the label for the comparison to be performed.
Returns:
A boolean whether (true) or not (false) there is a sliding window of time where the mean compares favorably with the passed threshold.
See Also:
LT, LE, EQ, GE, GT, NE

slopeTHoldWindowIndices

public static int[] slopeTHoldWindowIndices(double[] dArray,
                                            double[] dTime,
                                            java.lang.Double DWindowSize,
                                            java.lang.Double DTHold,
                                            java.lang.String strComparator,
                                            java.lang.Boolean BUseAbsoluteValue)
Method to find, within the sliding window of predefined size as compared against the time array, the indices of the value array that yield a linear regression slope that compares favorably with the threshold using the comparator. The linear regression is using time on the X axis, and the data values on the Y axis. For example, find the indices of the value array in a 0.5 second sliding window that yield a linear regression slope that is GE 2.0. In this example, a slope of 2.0 implies the linear regression line through the data points found within a half second window will be rising at least twice as quickly from one "value" in time to the next. Because linear regression is used, the actual values will not necessarily align perfectly with the line, and care should be taken with selection of the size of the sliding window to match the period (if any) of the value's variance. Note: if there are insufficient data points to generate a linear regression line, or if the slope would result in division by zero, the slope will be reported as 0.0 for comparison purposes.
Parameters:
dArray - A double[] of vlaues to be evaluated.
dTime - A double[] of values representing some increase of time. These values aren't interpreted to glean calendar dates and times, but are expected to represent seconds with optional fractions of time. These values are compared using the window size.
DWindowSize - A double measuring the amount of time (as measured by the values in the dTime array) as a sliding window used to review the values in inputIndices.
DTHold - A Double containing a threshold value to be compared against the linear regression slope based on values in the value array.
strComparator - A String containing the label for the comparison to be performed.
BUseAbsoluteValue - A Boolean stating whether (true) or not (false) the absolute value of the linear regression slope should be compared against the threshold value passed. For example, if one only seeks to determine where the changes in values are quickly changing without regards to the direction of change (e.g., increasing or decreasing), then one would set BUseAbsoluteValue to true. Conversely, if one only wants to find the condition where values are increasing at a particular minimum rate, they would use BUseAbsoluteValue as false and compare using GE the threshold value.
Returns:
An int[] containing the indices in the value array where the comparison with the threshold is favorable.
See Also:
LT, LE, EQ, GE, GT, NE

slopeTHoldWindowIndices

public static int[] slopeTHoldWindowIndices(double[] dArray,
                                            double[] dTime,
                                            double dWindowSize,
                                            double dTHold,
                                            int iComparator,
                                            boolean bUseAbsoluteValue)
Method to find, within the sliding window of predefined size as compared against the time array, the indices of the value array that yield a linear regression slope that compares favorably with the threshold using the comparator. The linear regression is using time on the X axis, and the data values on the Y axis. For example, find the indices of the value array in a 0.5 second sliding window that yield a linear regression slope that is GE 2.0. In this example, a slope of 2.0 implies the linear regression line through the data points found within a half second window will be rising at least twice as quickly from one "value" in time to the next. Because linear regression is used, the actual values will not necessarily align perfectly with the line, and care should be taken with selection of the size of the sliding window to match the period (if any) of the value's variance. Note: if there are insufficient data points to generate a linear regression line, or if the slope would result in division by zero, the slope will be reported as 0.0 for comparison purposes.
Parameters:
dArray - A double[] of vlaues to be evaluated.
dTime - A double[] of values representing some increase of time. These values aren't interpreted to glean calendar dates and times, but are expected to represent seconds with optional fractions of time. These values are compared using the window size.
dWindowSize - A double measuring the amount of time (as measured by the values in the dTime array) as a sliding window used to review the values in inputIndices.
dTHold - A double containing a threshold value to be compared against the linear regression slope based on values in the value array.
iComparator - An int containing the label for the comparison to be performed.
BUseAbsoluteValue - A Boolean stating whether (true) or not (false) the absolute value of the linear regression slope should be compared against the threshold value passed. For example, if one only seeks to determine where the changes in values are quickly changing without regards to the direction of change (e.g., increasing or decreasing), then one would set BUseAbsoluteValue to true. Conversely, if one only wants to find the condition where values are increasing at a particular minimum rate, they would use BUseAbsoluteValue as false and compare using GE the threshold value.
Returns:
An int[] containing the indices in the value array where the comparison with the threshold is favorable.
See Also:
LT, LE, EQ, GE, GT, NE

meanTHoldWindow

public static java.lang.Boolean meanTHoldWindow(double[] dArray,
                                                double[] dTime,
                                                java.lang.Double DWindowSize,
                                                java.lang.Double DTHold,
                                                java.lang.Double DComparator)
Method to determine if there is a window of the sized passed in time, where the average of all the values of passed value array compare favorably against a threshold using a comparator. For example, this method could answer "Is it true there are 5 seconds worth of entries in dArray whose average is GT 5.0?" The method returns as soon as one sliding window has satisfied the criteria.
Parameters:
dArray - A double[] of vlaues to be evaluated.
dTime - A double[] of values representing some increase of time. These values aren't interpreted to glean calendar dates and times, but are expected to represent seconds with optional fractions of time. These values are compared using the window size.
DWindowSize - A Double measuring the amount of time (as measured by the values in the dTime array) as a sliding window used to review the values in dArray.
DTHold - A Double containing a threshold value to be compared against the values in the value array.
DComparator - A Double containing the label for the comparison to be performed.
Returns:
A boolean whether (true) or not (false) there is a sliding window of time where the mean compares favorably with the passed threshold.
See Also:
LT, LE, EQ, GE, GT, NE

meanBoundedWindow

public static java.lang.Boolean meanBoundedWindow(double[] dArray,
                                                  double[] dTime,
                                                  java.lang.Double DWindowSize,
                                                  java.lang.Double DTHoldUpper,
                                                  java.lang.String strComparatorUpper,
                                                  java.lang.Double DTHoldLower,
                                                  java.lang.String strComparatorLower)
Method to determine if there is at least one window of the sized passed in time, where all the average of the values of passed value array compare favorably against the thresholds using their respective comparators. For example, this method could answer "Is it true there are 5 seconds worth of entries in dArray whose average is GT 5.0 or LE 2.0?" Or, "Is it true there are 5 seconds worth of entries in dArray whose average is LE 5.0 and GE 2.0?". The routine determines if OR or AND is needed based on the upper comparator being used. For example, if the upper comparator is GT, or GE, then OR is used. If upper comparator is EQ, then the lower test is ignored. Otherwise, for an upper comparator of LE, LT, or NE, AND is used. The method returns as soon as one window has satisfied the criteria.
Parameters:
dArray - A double[] of vlaues to be evaluated.
dTime - A double[] of values representing some increase of time. These values aren't interpreted to glean calendar dates and times, but are expected to represent seconds with optional fractions of time. These values are compared using the window size.
DWindowSize - A Double measuring the amount of time (as measured by the values in the dTime array) as a sliding window used to review the values in dArray.
DTHoldUpper - A Double containing an upper threshold value to be compared against the values in the value array.
strComparatorUpper - A String containing the comparison label to be performed against the DTHoldUpper threshold.
DTHoldLower - A Double containing a lower threshold value to be compared against the values in the value array.
strComparatorLower - A String containing the comparison label to be performed against the DTHoldLower threshold.
Returns:
A boolean whether (true) or not (false) there is a sliding window of time where the mean compares favorably with the passed threshold.
See Also:
LT, LE, EQ, GE, GT, NE

meanBoundedWindow

public static java.lang.Boolean meanBoundedWindow(double[] dArray,
                                                  double[] dTime,
                                                  java.lang.Double DWindowSize,
                                                  java.lang.Double DTHoldUpper,
                                                  java.lang.Double DComparatorUpper,
                                                  java.lang.Double DTHoldLower,
                                                  java.lang.Double DComparatorLower)
Method to determine if there is at least one window of the sized passed in time, where all the average of the values of passed value array compare favorably against the thresholds using their respective comparators. For example, this method could answer "Is it true there are 5 seconds worth of entries in dArray whose average is GT 5.0 or LE 2.0?" Or, "Is it true there are 5 seconds worth of entries in dArray whose average is LE 5.0 and GE 2.0?". The routine determines if OR or AND is needed based on the upper comparator being used. For example, if the upper comparator is GT, or GE, then OR is used. If upper comparator is EQ, then the lower test is ignored. Otherwise, for an upper comparator of LE, LT, or NE, AND is used. The method returns as soon as one window has satisfied the criteria.
Parameters:
dArray - A double[] of vlaues to be evaluated.
dTime - A double[] of values representing some increase of time. These values aren't interpreted to glean calendar dates and times, but are expected to represent seconds with optional fractions of time. These values are compared using the window size.
DWindowSize - A Double measuring the amount of time (as measured by the values in the dTime array) as a sliding window used to review the values in dArray.
DTHoldUpper - A Double containing an upper threshold value to be compared against the values in the value array.
DComparatorUpper - A Double containing the comparison to be performed against the DTHoldUpper threshold.
DTHoldLower - A Double containing a lower threshold value to be compared against the values in the value array.
DComparatorLower - A Double containing the comparison to be performed against the DTHoldLower threshold.
Returns:
A boolean whether (true) or not (false) there is a sliding window of time where the mean compares favorably with the passed threshold.
See Also:
LT, LE, EQ, GE, GT, NE

getOppositeComparator

public static int getOppositeComparator(int iComparator)
Method to calculate the opposite of a comparator
Parameters:
iComparator - An int containing comparator for whom the opposite would be found.
Returns:
An int containing the opposite of the passed comparator. Note: the opposite is not the negative. Opposites are as follows: LE GE, GE LE, LT GT, GT LT, EQ NE, NE EQ. These are used for boundary tests. Negatives are as follows: LE GT, GT LE, LT GE, GE LT, EQ NE, NE EQ.

getNegativeComparator

public static int getNegativeComparator(int iComparator)
Method to calculate the negative of a comparator
Parameters:
iComparator - An int containing comparator for whom the negative would be found.
Returns:
An int containing the negative of the passed comparator. Note: the negative is not the oppostie. Opposites are as follows: LE GE, GE LE, LT GT, GT LT, EQ NE, NE EQ. These are used for boundary tests. Negatives are as follows: LE GT, GT LE, LT GE, GE LT, EQ NE, NE EQ.

mean

public static double mean(double[] dArray)
Method to calculate the mean for the passed array.
Parameters:
dArray - A double[] containing values for which the mean will be calculated.
Returns:
A double containing the mean of the values passed.

linearRegressionToList

public static java.util.Vector linearRegressionToList(java.util.Vector vectXValues,
                                                      java.util.Vector vectYValues)
Method to calculate a linear regression for the passed X and Y values.
Parameters:
vectXValues - A Vector containing X values for which the linear regression will be calculated.
vectYValues - A Vector containing Y values for which the linear regression will be calculated.
Returns:
A Vector containing the slope and intercept resulting from performing linear regression for the passed values. The indexes SLOPE_INDEX and INTERCEPT_INDEX can be used to retrieve their respective values from the returned Vector.
See Also:
INTERCEPT_INDEX, SLOPE_INDEX

linearRegressionToList

public static java.util.Vector linearRegressionToList(double[] dXValues,
                                                      double[] dYValues)
Method to calculate a linear regression for the passed X and Y values.
Parameters:
dXValues - A double[] containing X values for which the linear regression will be calculated.
dYValues - A double[] containing Y values for which the linear regression will be calculated.
Returns:
A Vector containing the slope and intercept resulting from performing linear regression for the passed values. The indexes SLOPE_INDEX and INTERCEPT_INDEX can be used to retrieve their respective values from the returned Vector.
See Also:
INTERCEPT_INDEX, SLOPE_INDEX

linearRegression

public static double[] linearRegression(double[] dXValues,
                                        double[] dYValues)
Method to calculate a linear regression for the passed X and Y values.
Parameters:
dXValues - A double[] containing X values for which the linear regression will be calculated.
dYValues - A double[] containing Y values for which the linear regression will be calculated.
Returns:
A double[] containing the slope and intercept resulting from performing linear regression for the passed values. The indexes SLOPE_INDEX and INTERCEPT_INDEX can be used to retrieve their respective values from the returned array.
See Also:
INTERCEPT_INDEX, SLOPE_INDEX

linearRegression

public static double[] linearRegression(double[] dXValues,
                                        double[] dYValues,
                                        java.lang.Double DXBar,
                                        java.lang.Double DYBar)
Method to calculate a linear regression for the passed X and Y values.
Parameters:
dXValues - A double[] containing X values for which the linear regression will be calculated.
dYValues - A double[] containing Y values for which the linear regression will be calculated.
DXBar - A Double with the mean of the X values.
DYBar - A Double with the mean of the Y values.
Returns:
A Vector containing the slope and intercept resulting from performing linear regression for the passed values. The indexes SLOPE_INDEX and INTERCEPT_INDEX can be used to retrieve their respective values from the returned Vector.
See Also:
INTERCEPT_INDEX, SLOPE_INDEX

linearRegression

public static double[] linearRegression(double[] dXValues,
                                        double[] dYValues,
                                        double dXBar,
                                        double dYBar,
                                        int iStartIndex,
                                        int iEndIndex)
Method to calculate a linear regression for the passed X and Y values within the range >= iStartIndex and
Parameters:
dXValues - A double[] containing X values for which the linear regression will be calculated.
dYValues - A double[] containing Y values for which the linear regression will be calculated.
dXBar - A double with the mean of the X values.
dYBar - A double with the mean of the Y values.
iStartIndex - An int with the
Returns:
A Vector containing the slope and intercept resulting from performing linear regression for the passed values. The indexes SLOPE_INDEX and INTERCEPT_INDEX can be used to retrieve their respective values from the returned Vector.
See Also:
INTERCEPT_INDEX, SLOPE_INDEX

setValue

public java.lang.Double setValue(java.lang.String strValue,
                                 java.lang.Double DDefault)
Method to convert the passed String into a Double or, if this isn't possible, to return the passed default value. This method is useful to convert property Strings to Numeric values.
Parameters:
strValue - A String containing the value to be converted into a Double.
DDefault - A Double containing the default value to be returned if the passed String doesn't convert to a Double.
Returns:
A Double with the converted content of the passed String or the default value.

setValue

public java.lang.Boolean setValue(java.lang.String strValue,
                                  java.lang.Boolean BDefault)
Method to convert the passed String into a Boolean or, if this isn't possible, to return the passed default value. This method is useful to convert property Strings to Boolean values.
Parameters:
strValue - A String containing the value to be converted into a Boolean.
DDefault - A Boolean containing the default value to be returned if the passed String doesn't convert to a Boolean.
Returns:
A Boolean with the converted content of the passed String or the default value.

Copyright

public static java.lang.String Copyright()
Determine the copyright of this class.
Returns:
A String containing this class's copyright statement.

ABLE 2.0.0 07/02/2003 10:25:01

(C) Copyright IBM Corporation 1999, 2003