Packages

  • package root
    Definition Classes
    root
  • package myscala
    Definition Classes
    root
  • package math
    Definition Classes
    myscala
  • package algo
    Definition Classes
    math
  • package ops
    Definition Classes
    math
  • package stats

    Statistical functions

    Statistical functions

    • quantile computation

    Overview

    The main functions in this package are used as follows

    import scala.util.Random
    
    // Computation of quantiles example
    val computeQuantilesEvery10 = computeQuantiles(Seq(10,20,30,40,50,60,70,80,90))_ // partial evaluation (currying)
    val q = computeQuantilesEvery10(Seq.fill(123)(Random.nextDouble))
    
    // Statistics example
    val data = Vector(1,2,3,4,5,6,7,8,9,10)s
    data.statistics // thanks to the implicit class
    Definition Classes
    math
  • package bootstrap
  • BoxPlot
  • ComputeQuantiles
  • ComputeStats
  • EmptyStatistics
  • Quantile
  • Quantiles
  • Statistics
  • package vector
    Definition Classes
    math

package stats

Statistical functions

  • quantile computation

Overview

The main functions in this package are used as follows

import scala.util.Random

// Computation of quantiles example
val computeQuantilesEvery10 = computeQuantiles(Seq(10,20,30,40,50,60,70,80,90))_ // partial evaluation (currying)
val q = computeQuantilesEvery10(Seq.fill(123)(Random.nextDouble))

// Statistics example
val data = Vector(1,2,3,4,5,6,7,8,9,10)s
data.statistics // thanks to the implicit class
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

Package Members

  1. package bootstrap

Type Members

  1. case class BoxPlot[T](mean: Double, median: Double, lowerQuartile: T, upperQuartile: T, lowerWhisker: Double, upperWhisker: Double, outliers: Seq[T])(implicit evidence$1: Numeric[T]) extends Product with Serializable

    Container for the results from the boxplot computation.

    Container for the results from the boxplot computation.

    The whiskers are computed as in the pfgplots package (https://ctan.org/pkg/pgfplots?lang=en).

    T

    type of data

    mean

    mean of the data

    median

    median of the data

    lowerQuartile

    upper quartile

    upperQuartile

    lower quartile

    lowerWhisker

    lower whisker

    upperWhisker

    upper whisker

    outliers

    collection of outliers

  2. implicit class ComputeQuantiles[T] extends AnyRef

    T

    must be Numeric

  3. implicit class ComputeStats[T] extends AnyRef
  4. class EmptyStatistics extends Statistics[Double]

    Container for returning no results if the data is empty.

  5. 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

  6. case class Quantiles[T](quantiles: Seq[Double], values: Seq[T], sampleSize: Int)(implicit evidence$1: 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

  7. case class Statistics[T](size: Int, mean: Double, median: Double, min: T, max: T, variance: Double)(implicit evidence$1: Numeric[T]) extends Product with Serializable

    Container for the results of computing the statistics of an sequence.

    Container for the results of computing the statistics of an sequence.

    T

    numeric type

    size

    number of values in the sample

    mean

    mean of the sample

    median

    median of the sample

    min

    minimum

    max

    maximum

    variance

    variance

Value Members

  1. def computeBoxPlotData[T](data: Seq[T])(implicit arg0: Numeric[T]): BoxPlot[T]

    Computes the data for plotting a box plot.

    Computes the data for plotting a box plot. The input is a Seq of Numeric type. The output is a BoxPlot object containing the results.

    The whiskers are defined in the pgfplots manual in the section about boxplots (https://ctan.org/pkg/pgfplots?lang=en).

    data

    Seq of numeric type to compute the boxplot data for.

    returns

    BoxPlot object

  2. def computeQuantile[T](quantile: Double)(data: Seq[T])(implicit arg0: Numeric[T]): Quantile[T]

    Computes a specific quantile of the data

    Computes a specific quantile of the data

    quantile

    where the quantile should be computed

    data

    the data

    returns

    a Quantile object

  3. def computeQuantiles[T](listQuantiles: 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

    listQuantiles

    the set of quantiles to use

    data

    the data

    returns

    a Quantiles object

  4. def statistics[T](v: Iterable[T])(implicit arg0: Numeric[T]): Statistics[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)

Deprecated Value Members

  1. def stats[T](v: Iterable[T])(implicit arg0: Numeric[T]): (Int, Double, Double, Double, T, T)
    Annotations
    @deprecated
    Deprecated

    (Since version 1.3.0) Will be removed

Inherited from AnyRef

Inherited from Any

Ungrouped