public class UtilsPT extends Object
| Constructor and Description |
|---|
UtilsPT() |
| Modifier and Type | Method and Description |
|---|---|
static boolean |
compareDoubleArrays(double[] arr1,
double[] arr2)
Compares two double arrays.
|
static boolean |
compareFloatArrays(float[] arr1,
float[] arr2)
Compares two float arrays.
|
static double |
corr(double[] arr1,
double[] arr2)
Calculate correlation of two samples (arrays)
|
static double |
cov(double[] arr1,
double[] arr2)
Calculate covariance of two samples of equal length (arr1, arr2)
|
static String |
getClassAndOptions(Object obj)
Helper function for getting options
Return string for object and its options.
|
static double |
median(double[] array) |
static double |
parseDoubleOption(String[] options,
String optionFlag,
double defValue)
Parses the double option from options.
|
static int |
parseIntegerOption(String[] options,
String optionFlag,
int defValue)
Parses the integer option from options.
|
static Object |
parseObjectOptions(String[] options,
String optionFlag,
Object defValue,
Class<?> classtype)
Parses Object from options.
|
static double |
quantile(double[] array,
double q)
Calculates q-order quantile from the sample
|
static double[] |
softMax(double[] array)
Calculates soft-max of the array
|
static double[] |
softMin(double[] array)
Calculates soft-min of the array
|
static double |
stdDev(double[] array)
Calculates standard deviation of the sample (array)
|
static double |
truncatedMean(double[] array)
Calculated the truncated mean for the given array
|
static double |
var(double[] array)
Calculate variance of the sample (array)
|
public static double median(double[] array)
array - -- array of real numberspublic static double quantile(double[] array,
double q)
array - -- sampleq - -- quantile order [0,1]public static double truncatedMean(double[] array)
array - -- array to calculate the truncated meanspublic static double var(double[] array)
array - public static double stdDev(double[] array)
array - public static double cov(double[] arr1,
double[] arr2)
throws Exception
arr1 - arr2 - Exception - when samples are incompatiblepublic static double corr(double[] arr1,
double[] arr2)
throws Exception
arr1 - arr2 - Exception - when arrays are incompatiblepublic static boolean compareDoubleArrays(double[] arr1,
double[] arr2)
arr1 - arr2 - public static boolean compareFloatArrays(float[] arr1,
float[] arr2)
arr1 - arr2 - public static String getClassAndOptions(Object obj)
obj - public static int parseIntegerOption(String[] options, String optionFlag, int defValue)
options - optionFlag - -- flag of the optiondefValue - -- default Valuepublic static double parseDoubleOption(String[] options, String optionFlag, double defValue)
options - optionFlag - -- flag of the optiondefValue - -- default Valuepublic static Object parseObjectOptions(String[] options, String optionFlag, Object defValue, Class<?> classtype) throws Exception
options - optionFlag - defValue - classtype - Exceptionpublic static double[] softMax(double[] array)
array - public static double[] softMin(double[] array)
array - Copyright © 2020. All rights reserved.