The OpenD Programming Language

KurtosisAccumulator

  1. struct KurtosisAccumulator(T, KurtosisAlgo kurtosisAlgo, Summation summation)
  2. struct KurtosisAccumulator(T, KurtosisAlgo kurtosisAlgo, Summation summation)
  3. struct KurtosisAccumulator(T, KurtosisAlgo kurtosisAlgo, Summation summation)
  4. struct KurtosisAccumulator(T, KurtosisAlgo kurtosisAlgo, Summation summation)
  5. struct KurtosisAccumulator(T, KurtosisAlgo kurtosisAlgo, Summation summation)
  6. struct KurtosisAccumulator(T, KurtosisAlgo kurtosisAlgo, Summation summation)

Constructors

this
this(Slice!(Iterator, N, kind) slice)
this
this(SliceLike x)
this
this(Range range)

Members

Aliases

S
alias S = Summator!(T, summation)

Functions

centeredSumOfCubes
F centeredSumOfCubes()
centeredSumOfQuarts
F centeredSumOfQuarts()
centeredSumOfSquares
F centeredSumOfSquares()
count
size_t count()
kurtosis
F kurtosis(bool isPopulation, bool isRaw)
mean
F mean()
scaledSumOfCubes
F scaledSumOfCubes()
scaledSumOfCubes
F scaledSumOfCubes(bool isPopulation)
scaledSumOfQuarts
F scaledSumOfQuarts(bool isPopulation)
scaledSumOfQuarts
F scaledSumOfQuarts()
skewness
F skewness(bool isPopulation)
variance
F variance(bool isPopulation)

Examples

threePass

import mir.math.common: approxEqual;
import mir.ndslice.slice: sliced;

auto x = [0.0, 1.0, 1.5, 2.0, 3.5, 4.25,
          2.0, 7.5, 5.0, 1.0, 1.5, 0.0].sliced;

auto v = KurtosisAccumulator!(double, KurtosisAlgo.threePass, Summation.naive)(x);
assert(v.kurtosis(true, true).approxEqual(38.062853 / 12));
assert(v.kurtosis(true, false).approxEqual(38.062853 / 12 - 3.0));
assert(v.kurtosis(false, true).approxEqual(38.062853 / 12 * (11.0 * 13.0) / (10.0 * 9.0) - 3.0 * (11.0 * 11.0) / (10.0 * 9.0)) + 3.0);
assert(v.kurtosis(false, false).approxEqual(38.062853 / 12 * (11.0 * 13.0) / (10.0 * 9.0) - 3.0 * (11.0 * 11.0) / (10.0 * 9.0)));

Meta