The OpenD Programming Language

coefficientOfVariation

Calculates the coefficient of variation of the input.

The coefficient of variation is calculated by dividing either the population or sample (default) standard deviation by the mean of the input. According to wikipedia, "the coefficient of variation should be computed computed for data measured on a ratio scale, that is, scales that have a meaningful zero and hence allow for relative comparison of two measurements." In addition, for "small- and moderately-sized datasets", the coefficient of variation is biased, even when using the sample standard deviation.

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

  1. stdevType!Range coefficientOfVariation(Range r, bool isPopulation)
    template coefficientOfVariation(VarianceAlgo varianceAlgo = VarianceAlgo.hybrid, Summation summation = Summation.appropriate)
    stdevType!Range
    coefficientOfVariation
    (
    Range
    )
    (
    Range r
    ,
    bool isPopulation = false
    )
    if ()
  2. stdevType!T coefficientOfVariation(T[] ar)
  3. template coefficientOfVariation(F, VarianceAlgo varianceAlgo = VarianceAlgo.hybrid, Summation summation = Summation.appropriate)
  4. template coefficientOfVariation(F, string varianceAlgo, string summation = "appropriate")
  5. template coefficientOfVariation(string varianceAlgo, string summation = "appropriate")

Members

Functions

coefficientOfVariation
stdevType!Range coefficientOfVariation(Range r, bool isPopulation)
coefficientOfVariation
stdevType!T coefficientOfVariation(T[] ar)

Parameters

varianceAlgo

algorithm for calculating variance (default: VarianceAlgo.hybrid)

summation

algorithm for calculating sums (default: Summation.appropriate)

Return Value

The coefficient of varition of the input, must be floating point type

See Also

Meta