$darkmode
DENOPTIM
denoptim.utils.StatUtils Class Reference

Utilities for calculating basic statistics. More...

Static Public Member Functions

static double sum (double[] numbers)
 Returns the sum number in the numbers list. More...
 
static double mean (double[] numbers)
 Returns the mean number in the numbers list. More...
 
static double min (double[] numbers)
 Returns the minimum value among the numbers . More...
 
static double max (double[] numbers)
 Returns the maximum value among the numbers . More...
 
static double stddev (double[] numbers, boolean biasCorrected)
 Returns the standard deviation of the numbers. More...
 
static double var (double[] numbers, boolean biasCorrected)
 Computes the variance of the available values. More...
 
static double median (double[] m)
 Calculates median value of a sorted list. More...
 
static double kurtosis (double[] m, boolean biasCorrected)
 Computes the Kurtosis of the available values. More...
 
static double skewness (double[] m, boolean biasCorrected)
 Computes the skewness of the available values. More...
 

Detailed Description

Utilities for calculating basic statistics.

Author
Vishwesh Venkatraman

Definition at line 25 of file StatUtils.java.

Member Function Documentation

◆ kurtosis()

static double denoptim.utils.StatUtils.kurtosis ( double[]  m,
boolean  biasCorrected 
)
static

Computes the Kurtosis of the available values.

We use the following (unbiased) formula to define kurtosis:

kurtosis = { [n(n+1) / (n -1)(n - 2)(n-3)] sum[(x_i - mean)^4] / std^4 } - [3(n-1)^2 / (n-2)(n-3)]

where n is the number of values, mean is the Mean and std is the StandardDeviation

Note that this statistic is undefined for n < 4. Double.Nan is returned when there is not sufficient data to compute the statistic.

Definition at line 205 of file StatUtils.java.

References denoptim.utils.StatUtils.mean(), and denoptim.utils.StatUtils.var().

Here is the call graph for this function:

◆ max()

static double denoptim.utils.StatUtils.max ( double[]  numbers)
static

Returns the maximum value among the numbers .

Parameters
numberslist/array of numbers to calculate the max of.
Returns
the max number in the numbers list.

Definition at line 85 of file StatUtils.java.

References denoptim.utils.StatUtils.max().

Referenced by denoptim.ga.EAUtils.getSummaryStatistics(), and denoptim.utils.StatUtils.max().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ mean()

static double denoptim.utils.StatUtils.mean ( double[]  numbers)
static

Returns the mean number in the numbers list.

Parameters
numberslist/array of numbers to calculate the mean of.
Returns
the mean of the numbers.

Definition at line 53 of file StatUtils.java.

References denoptim.utils.StatUtils.sum().

Referenced by denoptim.ga.EAUtils.getSummaryStatistics(), denoptim.utils.StatUtils.kurtosis(), denoptim.utils.StatUtils.skewness(), and denoptim.utils.StatUtils.var().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ median()

static double denoptim.utils.StatUtils.median ( double[]  m)
static

Calculates median value of a sorted list.

Parameters
m
Returns
median value of m

Definition at line 172 of file StatUtils.java.

Referenced by denoptim.ga.EAUtils.getSummaryStatistics().

Here is the caller graph for this function:

◆ min()

static double denoptim.utils.StatUtils.min ( double[]  numbers)
static

Returns the minimum value among the numbers .

Parameters
numberslist/array of numbers to calculate the mean of.
Returns
the min number in the numbers list.

Definition at line 67 of file StatUtils.java.

References denoptim.utils.StatUtils.min().

Referenced by denoptim.ga.EAUtils.getSummaryStatistics(), and denoptim.utils.StatUtils.min().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ skewness()

static double denoptim.utils.StatUtils.skewness ( double[]  m,
boolean  biasCorrected 
)
static

Computes the skewness of the available values.

Parameters
msample
biasCorrectedbiasCorrected true if variance is calculated by dividing by n - 1. False if by n. stddev is a sqrt of the variance.
Returns
skewness of sample or NaN if sample size is strictly less than 4.

Definition at line 246 of file StatUtils.java.

References denoptim.utils.StatUtils.mean(), and denoptim.utils.StatUtils.stddev().

Referenced by denoptim.ga.EAUtils.getSummaryStatistics().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ stddev()

static double denoptim.utils.StatUtils.stddev ( double[]  numbers,
boolean  biasCorrected 
)
static

Returns the standard deviation of the numbers.

Double.NaN is returned if the numbers list is empty.

Parameters
numbersthe numbers to calculate the standard deviation.
biasCorrectedtrue if variance is calculated by dividing by n - 1. False if by n. stddev is a sqrt of the variance.
Returns
the standard deviation

Definition at line 107 of file StatUtils.java.

References denoptim.utils.StatUtils.stddev(), and denoptim.utils.StatUtils.var().

Referenced by denoptim.ga.EAUtils.getPopulationSD(), denoptim.ga.EAUtils.getSummaryStatistics(), denoptim.utils.StatUtils.skewness(), and denoptim.utils.StatUtils.stddev().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ sum()

static double denoptim.utils.StatUtils.sum ( double[]  numbers)
static

Returns the sum number in the numbers list.

Parameters
numberslist/array of numbers to calculate the sum of.
Returns
the sum of the numbers.

Definition at line 36 of file StatUtils.java.

References denoptim.utils.StatUtils.sum().

Referenced by denoptim.utils.StatUtils.mean(), denoptim.utils.StatUtils.sum(), and denoptim.utils.StatUtils.var().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ var()

static double denoptim.utils.StatUtils.var ( double[]  numbers,
boolean  biasCorrected 
)
static

Computes the variance of the available values.

By default, the unbiased "sample variance" definitional formula is used: variance = sum((x_i - mean)^2) / (n - 1)

The "population variance" ( sum((x_i - mean)^2) / n ) can also be computed using this statistic. The biasCorrected property determines whether the "population" or "sample" value is returned by the evaluate and getResult methods. To compute population variances, set this property to false.

Parameters
numbersthe numbers to calculate the variance.
biasCorrectedtrue if variance is calculated by dividing by n - 1. False if by n.
Returns
the variance of the numbers.

Definition at line 145 of file StatUtils.java.

References denoptim.utils.StatUtils.mean(), and denoptim.utils.StatUtils.sum().

Referenced by denoptim.utils.StatUtils.kurtosis(), and denoptim.utils.StatUtils.stddev().

Here is the call graph for this function:
Here is the caller graph for this function:

The documentation for this class was generated from the following file: