public class Math extends Object
Constructor and Description |
---|
Math() |
Modifier and Type | Method and Description |
---|---|
static float |
getMean(float[] values)
Computes the arithmetic mean \(\bar{x}\) of the input values \(x_1, \ldots x_n\)
|
static double |
getStandardDeviation(float[] values)
Estimates the unbiased standard deviation \(\sigma\) of population using some samples
\(x_1, \ldots x_n\) whose estimated mean is \(\bar{x}\)
|
static float |
getVariance(float[] values)
Estimates the unbiased sample variance \(\sigma^2\) of population using some samples
\(x_1, \ldots x_n\) whose estimated mean is \(\bar{x}\)
|
static float |
pow(float base,
int exponent)
It evaluates the power of a number
|
static float |
softmax(float a,
float b)
Approximates the max of two values with the following formula:
\(softmax(a,b) = \frac{log(e^{Fa} + e^{Fb})}{F}\)
|
public static float pow(float base, int exponent)
base
- the baseexponent
- the exponentpublic static float getMean(float[] values)
\(\bar{x} = \frac{1}{n} \sum_{i=1}^{n}x_i\)
values
- the input values on which computing the arithmetic meanpublic static float getVariance(float[] values)
\(\sigma^2 = \frac{1}{n-1} \sum_{i=1}^{n}(x_i -\bar{x_i})^2\)
values
- the samples of the population whose variance must be estimatedpublic static double getStandardDeviation(float[] values)
\(\sigma = \sqrt{\frac{1}{n-1} \sum_{i=1}^{n}(x_i -\bar{x_i})^2}\)
values
- the samples of the population whose standard deviation must be estimatedpublic static float softmax(float a, float b)
where F=100
This approximation is necessary when the max function is needed in a kernel to preserve its semi-positiveness (because the max does break this property)
a
- the first valueb
- the second valuemax(a,b)
Copyright © 2018 Semantic Analytics Group @ Uniroma2. All rights reserved.