Class: statsLib

statsLib()

Class aggregating statistical methods.

Constructor

new statsLib()

Source:

Methods

(static) absolutePercentile(percentile, inArr) → (non-null) {number}

Finds an array element representing the given percentile.
Parameters:
Name Type Description
percentile number Percentile to find in the given array (0 <= percentile <= 100)
inArr Array.<number> Array to find the percentile element in
Source:
Returns:
A numerical value that is a part of the input array representing the given percentile
Type
number

(static) correlation(inArr1, inArr2) → {number}

Evaluates statistical correlation of two arrays.
Parameters:
Name Type Description
inArr1 Array.<number> The first array to find correlation for
inArr2 Array.<number> The second array to find correlation for
Source:
Returns:
Numerical value representing the correlation of the 2 arrays
Type
number

(static) geometricMean(inArr) → {number}

Evaluates statistical geometric mean of an array.
Parameters:
Name Type Description
inArr Array.<number> The array to find geometric mean for.
Source:
Returns:
Numerical value representing the geometric mean of all array elements
Type
number

(static) geometricSum(inArr) → {number}

Evaluates geometric sum of an array.
Parameters:
Name Type Description
inArr Array.<number> The array to sum
Source:
Returns:
Numerical value representing the geometric sum of all array elements
Type
number

(static) mean(inArr) → {number}

Evaluates statistical mean of an array.
Parameters:
Name Type Description
inArr Array.<number> The array to find mean for.
Source:
Returns:
Numerical value representing the mean of all array elements
Type
number

(static) median(inArr) → {number}

Evaluates statistical median of an array.
Parameters:
Name Type Description
inArr Array.<number> The array to find median for.
Source:
Returns:
Numerical value representing the median of all array elements
Type
number

(static) mode(inArr) → {number}

Evaluates statistical mode of an array.
Parameters:
Name Type Description
inArr Array.<number> The array to find mode for.
Source:
Returns:
Numerical value representing the mode of all array elements
Type
number

(static) percentile(val, inArr, opt) → {number}

Evaluates the percentile of a given value and a sample or population dataset array.
Parameters:
Name Type Description
val number Value to find percentile for
inArr Array.<number> The array representing the population or sample
opt Object Option denoting if a population or a sample is provided
Source:
Returns:
Numerical value representing the percentile the given value in the context of the dataset
Type
number

(static) percentileFromMeanAndStdev(val, mean, stdev) → {number}

Evaluates the percentile of a given value and a sample or population dataset array.
Parameters:
Name Type Description
val number Value to find percentile for
mean number The value representing mean of the dataset
stdev number The value representing standard deviation of the dataset
Source:
Returns:
Numerical value representing the percentile the given value in the context of the dataset
Type
number

(static) stdev(inArr, opt) → {number}

Evaluates statistical standard deviation of an array.
Parameters:
Name Type Description
inArr Array.<number> The array to find standard deviation for
opt Object Option denoting if a population or a sample is provided
Source:
Returns:
Numerical value representing the standard deviation of all array elements
Type
number

(static) sum(inArr) → {number}

Evaluates sum of an array.
Parameters:
Name Type Description
inArr Array.<number> The array to sum
Source:
Returns:
Numerical value representing the sum of all array elements
Type
number

(static) zScore(val, inArr, opt) → {number}

Evaluates the Z score of a given value and a sample or population dataset array.
Parameters:
Name Type Description
val number Value to find Z score for
inArr Array.<number> The array representing the population or sample
opt Object Option denoting if a population or a sample is provided
Source:
Returns:
Numerical value representing the Z score the given value in the context of the dataset
Type
number

(static) zScorePercentile(score) → {number}

Evaluates the percentile of a given Z score, maximum is [-3.99, 3.99]. If the value is too large or too small, it goes to the nearest valid Z score.
Parameters:
Name Type Description
score number Z score to find percentile for
Source:
Returns:
Numerical value representing the percentile the given Z score
Type
number