package stats
Statistical functions
- quantile computation
Overview
The main functions in this package are used as follows
import scala.util.Random val computeQuantilesEvery10 = computeQuantiles(Seq(10,20,30,40,50,60,70,80,90))_ // partial evaluation (currying) val q = computeQuantilesEvery10(Seq.fill(123)(Random.nextDouble))
- Alphabetic
- By Inheritance
- stats
- AnyRef
- Any
- Hide All
- Show All
- Public
- All
Type Members
- implicit class ComputeStats[T] extends AnyRef
-
case class
Quantile[T](quantile: Double, value: T, sampleSize: Int)(implicit evidence$1: Numeric[T]) extends Product with Serializable
Stores a single quantile of a Seq.
Stores a single quantile of a Seq. Data type for computeQuantile function
- quantile
define the quantile
- value
the value at that quantile
- sampleSize
the size of the data on which the quantile is calculated
-
case class
Quantiles[T](quantiles: Seq[Double], values: Seq[T], sampleSize: Int)(implicit evidence$2: Numeric[T]) extends Product with Serializable
Storing multiple quantiles of the same Seq.
Storing multiple quantiles of the same Seq. Data type for computeQuantiles function
- quantiles
defining the quantiles
- values
the values of the quantiles
- sampleSize
the size of the input Seq
Value Members
-
def
computeQuantile[T](q: Double)(data: Seq[T])(implicit arg0: Numeric[T]): Quantile[T]
Computes a specific quantile of the data
Computes a specific quantile of the data
- q
where the quantile should be computed
- data
the data
- returns
a Quantile object
-
def
computeQuantiles[T](q: Seq[Double])(data: Seq[T])(implicit arg0: Numeric[T]): Quantiles[T]
Returns a Quantiles object with the values of the quantiles
Returns a Quantiles object with the values of the quantiles
- q
the set of quantiles to use
- data
the data
- returns
a Quantiles object
-
def
stats[T](v: Iterable[T])(implicit arg0: Numeric[T]): (Int, Double, Double, Double, T, T)
Computes basic statistics of a collection of numeric type.
Computes basic statistics of a collection of numeric type. The statistics are the following: mean, variance, median, max, min.
- T
numeric type
- v
collection of numeric type
- returns
(size, mean, var, median, min, max)