grizzled.math

stats

object stats

Miscellaneous statistics-related functions.

Note: You must import scala.math.Numeric (or just Numeric._) for these functions to work. For example:

import Numeric._
import grizzled.math.stats._

val l = List[Double]( ... )
println(median(l))
Linear Supertypes
AnyRef, Any
Ordering
  1. Alphabetic
  2. By inheritance
Inherited
  1. stats
  2. AnyRef
  3. Any
  1. Hide All
  2. Show all
Learn more about member selection
Visibility
  1. Public
  2. All

Value Members

  1. final def !=(arg0: AnyRef): Boolean

    Definition Classes
    AnyRef
  2. final def !=(arg0: Any): Boolean

    Definition Classes
    Any
  3. final def ##(): Int

    Definition Classes
    AnyRef → Any
  4. final def ==(arg0: AnyRef): Boolean

    Definition Classes
    AnyRef
  5. final def ==(arg0: Any): Boolean

    Definition Classes
    Any
  6. def arithmeticMean[T](items: T*)(implicit n: Numeric[T]): Double

    Calculates the arithmetic mean of the values of the passed-in numbers.

    Calculates the arithmetic mean of the values of the passed-in numbers.

    items

    the numbers on which to operate

    returns

    the arithmetic mean

  7. final def asInstanceOf[T0]: T0

    Definition Classes
    Any
  8. def clone(): AnyRef

    Attributes
    protected[java.lang]
    Definition Classes
    AnyRef
    Annotations
    @throws( ... )
  9. final def eq(arg0: AnyRef): Boolean

    Definition Classes
    AnyRef
  10. def equals(arg0: Any): Boolean

    Definition Classes
    AnyRef → Any
  11. def finalize(): Unit

    Attributes
    protected[java.lang]
    Definition Classes
    AnyRef
    Annotations
    @throws( classOf[java.lang.Throwable] )
  12. def geometricMean[T](items: T*)(implicit n: Numeric[T]): Double

    Calculates the geometric mean of the values of the passed-in numbers, namely, the n-th root of (x1 * x2 * .

    Calculates the geometric mean of the values of the passed-in numbers, namely, the n-th root of (x1 * x2 * ... * xn). Note that all numbers used in the calculation of a geometric mean must be positive.

    For a discussion of when a geometric mean is more suitable than an arithmetic mean, see http://www.math.toronto.edu/mathnet/questionCorner/geomean.html.

    items

    the numbers on which to operate

    returns

    the geometric mean

  13. final def getClass(): Class[_]

    Definition Classes
    AnyRef → Any
  14. def harmonicMean[T](items: T*)(implicit n: Numeric[T]): Double

    Calculates the harmonic mean of the values of the passed-in numbers, namely: n / (1/x1 + 1/x2 + ... + 1/xn).

    Calculates the harmonic mean of the values of the passed-in numbers, namely: n / (1/x1 + 1/x2 + ... + 1/xn).

    items

    the numbers on which to operate

    returns

    the harmonic mean

  15. def hashCode(): Int

    Definition Classes
    AnyRef → Any
  16. final def isInstanceOf[T0]: Boolean

    Definition Classes
    Any
  17. def mean[T](items: T*)(implicit n: Numeric[T]): Double

    Synonym for arithmeticMean.

    Synonym for arithmeticMean.

    See also

    arithmeticMean

  18. def median[T](items: T*)(implicit n: Numeric[T]): Double

    Calculates the median of the values of the passed-in numbers.

    Calculates the median of the values of the passed-in numbers.

    items

    the numbers on which to operate

    returns

    the median

  19. def mode[T](items: T*)(implicit n: Numeric[T]): List[T]

    Calculates the mode (most common value(s)) of the values of the passed-in numbers.

    Calculates the mode (most common value(s)) of the values of the passed-in numbers. If there are multiple common values, they're all returned.

    items

    the numbers on which to operate

    returns

    list of modal values

  20. final def ne(arg0: AnyRef): Boolean

    Definition Classes
    AnyRef
  21. final def notify(): Unit

    Definition Classes
    AnyRef
  22. final def notifyAll(): Unit

    Definition Classes
    AnyRef
  23. def popStdDev[T](items: T*)(implicit n: Numeric[T]): Double

    Shorter synonym for populationStandardDeviation.

    Shorter synonym for populationStandardDeviation.

    See also

    populationStandardDeviation

  24. def populationStandardDeviation[T](items: T*)(implicit n: Numeric[T]): Double

    Calculate the population standard deviation of the specified values.

    Calculate the population standard deviation of the specified values. The population standard deviation is merely the square root of the population variance. Thus, this function is just shorthand for:

    java.lang.Math.sqrt(populationVariance(items))
    items

    the numbers on which to operate

    returns

    the standard deviation

  25. def populationVariance[T](items: T*)(implicit n: Numeric[T]): Double

    Calculate the population variance of the finite population defined by the items arguments.

    Calculate the population variance of the finite population defined by the items arguments. The population variance is defined as:

    1
    - *  SUM(i=1, N) { (x[i] - mean)^2^ }
    N

    See:

    - http://en.wikipedia.org/wiki/Variance#Population_variance_and_sample_variance - http://www.quickmba.com/stats/standard-deviation/

    items

    the numbers on which to operate

    returns

    the variance

  26. def range[T](items: T*)(implicit n: Numeric[T]): T

    Calculate the range of a data set.

    Calculate the range of a data set. This function does a single linear pass over the data set.

    items

    the numbers on which to operate

    returns

    the range

  27. def sampleStandardDeviation[T](items: T*)(implicit n: Numeric[T]): Double

    Calculate the sample standard deviation of the specified values.

    Calculate the sample standard deviation of the specified values. The sample standard deviation is merely the square root of the sample variance. Thus, this function is just shorthand for:

    java.lang.Math.sqrt(sampleVariance(items))
    items

    the numbers on which to operate

    returns

    the standard deviation

  28. def sampleStdDev[T](items: T*)(implicit n: Numeric[T]): Double

    Shorter synonym for sampleStandardDeviation.

    Shorter synonym for sampleStandardDeviation.

    See also

    populationStandardDeviation

  29. def sampleVariance[T](items: T*)(implicit n: Numeric[T]): Double

    Calculate the unbiased sample variance of the finite sample defined by the items arguments.

    Calculate the unbiased sample variance of the finite sample defined by the items arguments. The sample variance is defined as:

    1
    ----- *   SUM(i=1, N) { (x[i] - sampleMean)^2^  }
    N - 1

    See:

    - http://en.wikipedia.org/wiki/Variance#Population_variance_and_sample_variance - http://www.quickmba.com/stats/standard-deviation/

    items

    the numbers on which to operate

    returns

    the variance

  30. final def synchronized[T0](arg0: ⇒ T0): T0

    Definition Classes
    AnyRef
  31. def toString(): String

    Definition Classes
    AnyRef → Any
  32. final def wait(): Unit

    Definition Classes
    AnyRef
    Annotations
    @throws( ... )
  33. final def wait(arg0: Long, arg1: Int): Unit

    Definition Classes
    AnyRef
    Annotations
    @throws( ... )
  34. final def wait(arg0: Long): Unit

    Definition Classes
    AnyRef
    Annotations
    @throws( ... )

Inherited from AnyRef

Inherited from Any

Ungrouped