public class MathUtil
extends java.lang.Object
| Modifier and Type | Method and Description |
|---|---|
static int |
argmax(int[] array)
Calculates the index of the maximum value in the given
array
(argmax). |
static double |
intManhattanDistance(int[] a,
int[] b)
Simple Manhattan distance (sum of the absolute differences between the
vectors' elements) implementation for arrays of Integer.
|
static double |
mean(double[] vector,
int t1,
int t2)
Function calculating the mean of the interval [t1, t2 (inclusive)] of the
given
vector. |
static double |
sigmoid(double z)
Function to calculate the sigmoid for the given value
z. |
static double |
singleSquaredEuclideanDistance(double[] vector1,
double[] vector2)
Computes the single squared Euclidean distance between two vectors.
|
static double |
slope(double[] vector,
int t1,
int t2)
Function calculating the slope of the interval [t1, t2 (inclusive)] of the
given
vector. |
static double |
stddev(double[] vector,
int t1,
int t2,
boolean useBiasCorrection)
Function calculating the standard deviation of the interval [t1, t2
(inclusive)] of the given
vector. |
static double |
sum(double[] array)
Sums the values of the given
array. |
public static double sigmoid(double z)
z.z - Parameter zz.public static double sum(double[] array)
array.array - The array to be summedpublic static double singleSquaredEuclideanDistance(double[] vector1,
double[] vector2)
vector1 - First argument vectorvector2 - Second argument vectorpublic static double intManhattanDistance(int[] a,
int[] b)
a - First argument vectorb - Second argument vectorpublic static double mean(double[] vector,
int t1,
int t2)
vector.vector - Vector which is used for the calculationt1 - Interval startt2 - Interval end (inclusive)public static double stddev(double[] vector,
int t1,
int t2,
boolean useBiasCorrection)
vector.vector - Vector which is used for the calculationt1 - Interval startt2 - Interval end (inclusive)useBiasCorrection - Indicator whether the bias (Bessel's) correction should be usedpublic static double slope(double[] vector,
int t1,
int t2)
vector.vector - Vector which is used for the calculationt1 - Interval startt2 - Interval end (inclusive)public static int argmax(int[] array)
array
(argmax).array - Array to be checked. Must not be null or empty