Packages

case class WeightedAverage(weightSum: Weight, value: Double) extends Product with Serializable

This is of course extremely similar to the averaged value implementation in Algebird... it just keeps track of a numerator AND denominator

Source
WeightedAverage.scala
Linear Supertypes
Serializable, Serializable, Product, Equals, AnyRef, Any
Ordering
  1. Alphabetic
  2. By Inheritance
Inherited
  1. WeightedAverage
  2. Serializable
  3. Serializable
  4. Product
  5. Equals
  6. AnyRef
  7. Any
  1. Hide All
  2. Show All
Visibility
  1. Public
  2. All

Instance Constructors

  1. new WeightedAverage(weightSum: Weight, value: Double)

Value Members

  1. def +(that: Double): WeightedAverage

    Returns a new instance that averages that into this instance.

    Returns a new instance that averages that into this instance.

    that

    value to average into this instance

    returns

    an instance representing the mean of this instance and that.

  2. def +(r: WeightedAverage): WeightedAverage

    Averages this instance with another WeightedAverage instance.

    Averages this instance with another WeightedAverage instance.

    r

    the other instance

    returns

    an instance representing the mean of this instance and r.

  3. def -(r: WeightedAverage): WeightedAverage

    Averages this instance with the *opposite* of the supplied WeightedAverage instance, effectively subtracting out that instance's contribution to the mean.

    Averages this instance with the *opposite* of the supplied WeightedAverage instance, effectively subtracting out that instance's contribution to the mean.

    r

    the instance to subtract

    returns

    an instance with r's stream subtracted out

  4. def plus(that: Double, weight: Weight): WeightedAverage
  5. def unary_-: WeightedAverage

    Returns a copy of this instance with a negative value.

    Returns a copy of this instance with a negative value. Note that

    a + -b == a - b
  6. val value: Double
  7. val weightSum: Weight