The OpenD Programming Language

mir.math.stat

This module contains base statistical algorithms.

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

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 withAsSlice)

Structs

GMeanAccumulator
struct GMeanAccumulator(T)

Output range for gmean.

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.

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

center
template center(alias centralTendency = mean!(Summation.appropriate))

Centers slice, which must be a finite iterable.

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)
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.

simpleLinearRegression
template simpleLinearRegression(string summation)

A linear regression model with a single explanatory variable.

simpleLinearRegression
template simpleLinearRegression(Summation summation = Summation.kbn)

A linear regression model with a single explanatory variable.

standardDeviation
template standardDeviation(F, VarianceAlgo varianceAlgo = VarianceAlgo.online, Summation summation = Summation.appropriate)
template standardDeviation(VarianceAlgo varianceAlgo = VarianceAlgo.online, 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

statType
template statType(T, bool checkComplex = true)
stdevType
template stdevType(T)
variance
template variance(F, VarianceAlgo varianceAlgo = VarianceAlgo.online, Summation summation = Summation.appropriate)
template variance(VarianceAlgo varianceAlgo = VarianceAlgo.online, 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

Authors

Shigeki Karita (original numir code), Ilia Ki, John Michael Hall