GithubHelp home page GithubHelp logo

apex-stats's Introduction

The stats library contains a simple Stats class for statistical calculations. It works on lists of Decimal numbers so that the required precision can be obtained.

Stats

Modifier and type Method
static Decimal mean(List<Decimal> nums)
static Decimal geometricMean(List<Decimal> nums)
static Decimal harmonicMean(List<Decimal> nums)
static Decimal median(List<Decimal> nums)
static Decimal lowerQuartile(List<Decimal> nums)
static Decimal upperQuartile(List<Decimal> nums)
static Decimal midhinge(List<Decimal> nums)
static Decimal min(List<Decimal> nums)
static Decimal max(List<Decimal> nums)
static Decimal range(List<Decimal> nums)
static Decimal midrange(List<Decimal> nums)
static Decimal mode(List<Decimal> nums)
static Decimal variance(List<Decimal> nums)
static Decimal sampleVariance(List<Decimal> nums)
static Decimal standardDeviation(List<Decimal> nums)
static Decimal sampleStandardDeviation(List<Decimal> nums)
static Decimal coefficientOfVariation(List<Decimal> nums)

Measures of centrality

mean

Arithmetic mean.

geometricMean

Geometric mean. All values need to be positive, otherwise it does not exist.

harmonicMean

Harmonic mean. All values need to be positive, otherwise it does not exist.

median

Median, considered to be the middle element for odd number of elements, and an arithmetic mean of two middle elements for even number of elements. For example, the median of (1, 2, 3, 4, 5) is 3, while the median of (1, 2, 3, 4) is 2.5.

lowerQuartile

Median of those elements that are smaller than the median. For example, in list (1, 2, 3, 4, 5, 6, 7), the median is 4. (1, 2, 3) are smaller than 4, therefore the lowerQuartile is the median of that list, which is 2.

upperQuartile

Median of those elements that are larger than the median. For example, in list (1, 2, 3, 4, 5, 6, 7), the median is 4. (5, 6, 7) are smaller than 4, therefore the upperQuartile is the median of that list, which is 6.

midhinge

Mean of lowerQuartile and upperQuartile values.

min

Minimal value.

max

Maximal value.

range

Range of all values, which is the difference between max and min values.

midrange

Mean of min and max values.

mode

Value that appears most often in the list. This might not be a unique value.

Measures of dispersion

variance

Variance of values.

sampleVariance

Variance of values corrected for bias.

standardDeviation

Standard deviation of values, calculated as a square root of variance.

sampleStandardDeviation

Standard deviation corrected for bias, calculated as a square root of sampleVariance.

coefficientOfVariation

Calculated as standardDeviation divided by mean.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.