The OpenD Programming Language

mir.stat.descriptive.univariate

This module contains algorithms for univariate descriptive statistics.

Note that used specialized summing algorithms execute more primitive operations than vanilla summation. Therefore, if in certain cases maximum speed is required at expense of precision, one can use $(TT Summation.fast) .

Members

Enums

KurtosisAlgo
enum KurtosisAlgo

Kurtosis algorithms.

MomentAlgo
enum MomentAlgo
QuantileAlgo
enum QuantileAlgo

Algorithms used to calculate the quantile of an input x at probability p.

SkewnessAlgo
enum SkewnessAlgo

Skewness algorithms.

StandardizedMomentAlgo
enum StandardizedMomentAlgo
Summation (from mir.math.sum)
enum Summation via public import mir.math.sum : Summation;
VarianceAlgo
enum VarianceAlgo

Variance algorithms.

Functions

gmean
gmeanType!F gmean(Range r)
gmeanType!Range gmean(Range r)

Computes the geometric average of the input.

gmean
gmeanType!F gmean(F[] ar)
median
meanType!(T[]) median(T[] ar)
median
auto median(T sliceLike)
medianAbsoluteDeviation
meanType!(Slice!(Iterator, N, kind)) medianAbsoluteDeviation(Slice!(Iterator, N, kind) slice)
meanType!(T[]) medianAbsoluteDeviation(T[] ar)
auto medianAbsoluteDeviation(SliceLike x)

Calculates the median absolute deviation about the median of the input.

Structs

EntropyAccumulator
struct EntropyAccumulator(T, Summation summation)
GMeanAccumulator
struct GMeanAccumulator(T)

Output range for gmean.

KurtosisAccumulator
struct KurtosisAccumulator(T, KurtosisAlgo kurtosisAlgo, Summation summation)
KurtosisAccumulator
struct KurtosisAccumulator(T, KurtosisAlgo kurtosisAlgo, Summation summation)
KurtosisAccumulator
struct KurtosisAccumulator(T, KurtosisAlgo kurtosisAlgo, Summation summation)
KurtosisAccumulator
struct KurtosisAccumulator(T, KurtosisAlgo kurtosisAlgo, Summation summation)
KurtosisAccumulator
struct KurtosisAccumulator(T, KurtosisAlgo kurtosisAlgo, Summation summation)
KurtosisAccumulator
struct KurtosisAccumulator(T, KurtosisAlgo kurtosisAlgo, Summation summation)
MapSummator
struct MapSummator(alias fun, T, Summation summation)

Output range that applies function fun to each input before summing

MeanAccumulator
struct MeanAccumulator(T, Summation summation)

Output range for mean.

MomentAccumulator
struct MomentAccumulator(T, size_t N, Summation summation)
SkewnessAccumulator
struct SkewnessAccumulator(T, SkewnessAlgo skewnessAlgo, Summation summation)
SkewnessAccumulator
struct SkewnessAccumulator(T, SkewnessAlgo skewnessAlgo, Summation summation)
SkewnessAccumulator
struct SkewnessAccumulator(T, SkewnessAlgo skewnessAlgo, Summation summation)
SkewnessAccumulator
struct SkewnessAccumulator(T, SkewnessAlgo skewnessAlgo, Summation summation)
SkewnessAccumulator
struct SkewnessAccumulator(T, SkewnessAlgo skewnessAlgo, Summation summation)
SkewnessAccumulator
struct SkewnessAccumulator(T, SkewnessAlgo skewnessAlgo, Summation summation)
VarianceAccumulator
struct VarianceAccumulator(T, VarianceAlgo varianceAlgo, Summation summation)
VarianceAccumulator
struct VarianceAccumulator(T, VarianceAlgo varianceAlgo, Summation summation)
VarianceAccumulator
struct VarianceAccumulator(T, VarianceAlgo varianceAlgo, Summation summation)
VarianceAccumulator
struct VarianceAccumulator(T, VarianceAlgo varianceAlgo, Summation summation)
VarianceAccumulator
struct VarianceAccumulator(T, VarianceAlgo varianceAlgo, Summation summation)

Templates

centralMoment
template centralMoment(F, size_t N, Summation summation = Summation.appropriate)
template centralMoment(size_t N, Summation summation = Summation.appropriate)
template centralMoment(F, size_t N, string summation)
template centralMoment(size_t N, string summation)

Calculates the n-th central moment of the input.

coefficientOfVariation
template coefficientOfVariation(F, VarianceAlgo varianceAlgo = VarianceAlgo.hybrid, Summation summation = Summation.appropriate)
template coefficientOfVariation(VarianceAlgo varianceAlgo = VarianceAlgo.hybrid, Summation summation = Summation.appropriate)

Calculates the coefficient of variation of the input.

coefficientOfVariation
template coefficientOfVariation(F, string varianceAlgo, string summation = "appropriate")
template coefficientOfVariation(string varianceAlgo, string summation = "appropriate")
dispersion
template dispersion(alias centralTendency = mean, alias transform = "a * a", alias summarize = mean)

Calculates the dispersion of the input.

entropy
template entropy(F, Summation summation = Summation.appropriate)

Computes the entropy of the input. By default, if F is not a floating point type, then the result will have a double type if F is implicitly convertible to a floating point type.

entropy
template entropy(Summation summation = Summation.appropriate)
template entropy(F, string summation)
template entropy(string summation)
entropyType
template entropyType(T)

If T is a floating point type, this is an alias to the unqualified type. If T is not a floating point type, this will alias a double type if T is summable and implicitly convertible to a floating point type.

gmeanType
template gmeanType(T)
hmean
template hmean(F, Summation summation = Summation.appropriate)
template hmean(Summation summation = Summation.appropriate)
template hmean(F, string summation)
template hmean(string summation)

Computes the harmonic mean of the input.

hmeanType
template hmeanType(T)
interquartileRange
template interquartileRange(F, QuantileAlgo quantileAlgo = QuantileAlgo.type7, bool allowModifySlice = false)
template interquartileRange(QuantileAlgo quantileAlgo = QuantileAlgo.type7, bool allowModifySlice = false)
template interquartileRange(F, string quantileAlgo, bool allowModifySlice = false)
template interquartileRange(string quantileAlgo, bool allowModifySlice = false)

Computes the interquartile range of the input.

kurtosis
template kurtosis(F, KurtosisAlgo kurtosisAlgo = KurtosisAlgo.hybrid, Summation summation = Summation.appropriate)
template kurtosis(KurtosisAlgo kurtosisAlgo = KurtosisAlgo.hybrid, Summation summation = Summation.appropriate)
template kurtosis(F, string kurtosisAlgo, string summation = "appropriate")
template kurtosis(string kurtosisAlgo, string summation = "appropriate")

Calculates the kurtosis of the input

mean
template mean(F, Summation summation = Summation.appropriate)
template mean(Summation summation = Summation.appropriate)
template mean(F, string summation)
template mean(string summation)

Computes the mean of the input.

meanType
template meanType(T)
median
template median(F, bool allowModify = false)
template median(bool allowModify = false)

Computes the median of slice.

medianAbsoluteDeviation
template medianAbsoluteDeviation(F)

Calculates the median absolute deviation about the median of the input.

moment
template moment(F, size_t N, MomentAlgo momentAlgo, Summation summation = Summation.appropriate)
template moment(size_t N, MomentAlgo momentAlgo, Summation summation = Summation.appropriate)
template moment(F, size_t N, string momentAlgo, string summation = "appropriate")
template moment(size_t N, string momentAlgo, string summation = "appropriate")

Calculates the n-th moment of the input.

quantile
template quantile(F, QuantileAlgo quantileAlgo = QuantileAlgo.type7, bool allowModifySlice = false, bool allowModifyProbability = false)

Computes the quantile(s) of the input, given one or more probabilities p.

quantile
template quantile(QuantileAlgo quantileAlgo = QuantileAlgo.type7, bool allowModifySlice = false, bool allowModifyProbability = false)
template quantile(F, string quantileAlgo, bool allowModifySlice = false, bool allowModifyProbability = false)
template quantile(string quantileAlgo, bool allowModifySlice = false, bool allowModifyProbability = false)
quantileType
template quantileType(T, QuantileAlgo quantileAlgo)

For all QuantileAlgo except QuantileAlgo.type1 and QuantileAlgo.type3, this is an alias to the $(MATHREF stat, meanType) of T

rawMoment
template rawMoment(F, size_t N, Summation summation = Summation.appropriate)
template rawMoment(size_t N, Summation summation = Summation.appropriate)
template rawMoment(F, size_t N, string summation)
template rawMoment(size_t N, string summation)

Calculates the n-th raw moment of the input.

skewness
template skewness(F, SkewnessAlgo skewnessAlgo = SkewnessAlgo.hybrid, Summation summation = Summation.appropriate)
template skewness(SkewnessAlgo skewnessAlgo = SkewnessAlgo.hybrid, Summation summation = Summation.appropriate)
template skewness(F, string skewnessAlgo, string summation = "appropriate")
template skewness(string skewnessAlgo, string summation = "appropriate")

Calculates the skewness of the input

standardDeviation
template standardDeviation(F, VarianceAlgo varianceAlgo = VarianceAlgo.hybrid, Summation summation = Summation.appropriate)
template standardDeviation(VarianceAlgo varianceAlgo = VarianceAlgo.hybrid, Summation summation = Summation.appropriate)
template standardDeviation(F, string varianceAlgo, string summation = "appropriate")
template standardDeviation(string varianceAlgo, string summation = "appropriate")

Calculates the standard deviation of the input

standardizedMoment
template standardizedMoment(F, size_t N, StandardizedMomentAlgo standardizedMomentAlgo = StandardizedMomentAlgo.scaled, VarianceAlgo varianceAlgo = VarianceAlgo.twoPass, Summation summation = Summation.appropriate)
template standardizedMoment(size_t N, StandardizedMomentAlgo standardizedMomentAlgo = StandardizedMomentAlgo.scaled, VarianceAlgo varianceAlgo = VarianceAlgo.twoPass, Summation summation = Summation.appropriate)
template standardizedMoment(F, size_t N, string standardizedMomentAlgo, string varianceAlgo = "twoPass", string summation = "appropriate")
template standardizedMoment(size_t N, string standardizedMomentAlgo, string varianceAlgo = "twoPass", string summation = "appropriate")

Calculates the n-th standardized moment of the input.

statType
template statType(T, bool checkComplex = true)
stdevType
template stdevType(T)
variance
template variance(F, VarianceAlgo varianceAlgo = VarianceAlgo.hybrid, Summation summation = Summation.appropriate)
template variance(VarianceAlgo varianceAlgo = VarianceAlgo.hybrid, Summation summation = Summation.appropriate)
template variance(F, string varianceAlgo, string summation = "appropriate")
template variance(string varianceAlgo, string summation = "appropriate")

Calculates the variance of the input

Meta

License

Apache-2.0

Several functions are borrowed from mir.math.stat. An additional VarianceAlgo is provided in this code, which is the new default.

Authors

John Michael Hall, Ilya Yaroshenko