Object

grizzled.math

stats

Related Doc: package math

Permalink

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
Visibility
  1. Public
  2. All

Value Members

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

    Permalink
    Definition Classes
    AnyRef → Any
  2. final def ##(): Int

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

    Permalink
    Definition Classes
    AnyRef → Any
  4. def arithmeticMean[T](items: T*)(implicit n: Numeric[T]): Double

    Permalink

    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

  5. final def asInstanceOf[T0]: T0

    Permalink
    Definition Classes
    Any
  6. def clone(): AnyRef

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

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

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

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

    Permalink

    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

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

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

    Permalink

    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

  13. def hashCode(): Int

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

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

    Permalink

    Synonym for arithmeticMean.

    Synonym for arithmeticMean.

    See also

    arithmeticMean

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

    Permalink

    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

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

    Permalink

    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

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

    Permalink
    Definition Classes
    AnyRef
  19. final def notify(): Unit

    Permalink
    Definition Classes
    AnyRef
  20. final def notifyAll(): Unit

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

    Permalink

    Shorter synonym for populationStandardDeviation.

    Shorter synonym for populationStandardDeviation.

    See also

    populationStandardDeviation

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

    Permalink

    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

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

    Permalink

    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

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

    Permalink

    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

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

    Permalink

    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

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

    Permalink

    Shorter synonym for sampleStandardDeviation.

    Shorter synonym for sampleStandardDeviation.

    See also

    populationStandardDeviation

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

    Permalink

    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

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

    Permalink
    Definition Classes
    AnyRef
  29. def toString(): String

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

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

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

    Permalink
    Definition Classes
    AnyRef
    Annotations
    @throws( ... )

Inherited from AnyRef

Inherited from Any

Ungrouped