Packages

sealed class Moments extends Product with Serializable

A class to calculate the first five central moments over a sequence of Doubles. Given the first five central moments, we can then calculate metrics like skewness and kurtosis.

m{i} denotes the ith central moment.

This code manually inlines code to make it look like a case class. This is done because we changed the count from a Long to a Double to enable the scale method, which allows exponential decays of moments, but we didn't want to break backwards binary compatibility.

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

Instance Constructors

  1. new Moments(m0: Long, m1: Double, m2: Double, m3: Double, m4: Double)
  2. new Moments(m0D: Double, m1: Double, m2: Double, m3: Double, m4: Double)

Value Members

  1. final def !=(arg0: Any): Boolean
    Definition Classes
    AnyRef → Any
  2. final def ##: Int
    Definition Classes
    AnyRef → Any
  3. def +(b: Double): Moments

    Returns a new Moments instance generated by merging in the new observation b.

    Returns a new Moments instance generated by merging in the new observation b.

    b

    a new observation

    returns

    a Moments instance representing the combined moments of this instance and b.

  4. def +(b: Moments): Moments

    Combines this instance with another Moments instance.

    Combines this instance with another Moments instance.

    b

    the other instance

    returns

    a Moments instances representing the combined moments of this instance and b

  5. final def ==(arg0: Any): Boolean
    Definition Classes
    AnyRef → Any
  6. final def asInstanceOf[T0]: T0
    Definition Classes
    Any
  7. def canEqual(that: Any): Boolean
    Definition Classes
    Moments → Equals
  8. def clone(): AnyRef
    Attributes
    protected[lang]
    Definition Classes
    AnyRef
    Annotations
    @throws(classOf[java.lang.CloneNotSupportedException]) @native()
  9. def copy(c0: Long = count, v1: Double = m1, v2: Double = m2, v3: Double = m3, v4: Double = m4): Moments
  10. def count: Long
  11. final def eq(arg0: AnyRef): Boolean
    Definition Classes
    AnyRef
  12. def equals(that: Any): Boolean
    Definition Classes
    Moments → Equals → AnyRef → Any
  13. def finalize(): Unit
    Attributes
    protected[lang]
    Definition Classes
    AnyRef
    Annotations
    @throws(classOf[java.lang.Throwable])
  14. def fold: Fold[Double, Moments]

    Returns a Fold instance that uses + to accumulate deltas into this Moments instance.

  15. final def getClass(): Class[_ <: AnyRef]
    Definition Classes
    AnyRef → Any
    Annotations
    @native()
  16. def hashCode(): Int
    Definition Classes
    Moments → AnyRef → Any
  17. final def isInstanceOf[T0]: Boolean
    Definition Classes
    Any
  18. def kurtosis: Double
  19. def m0: Long
  20. val m0D: Double
  21. val m1: Double
  22. val m2: Double
  23. val m3: Double
  24. val m4: Double
  25. def mean: Double
  26. final def ne(arg0: AnyRef): Boolean
    Definition Classes
    AnyRef
  27. final def notify(): Unit
    Definition Classes
    AnyRef
    Annotations
    @native()
  28. final def notifyAll(): Unit
    Definition Classes
    AnyRef
    Annotations
    @native()
  29. def productArity: Int
    Definition Classes
    Moments → Product
  30. def productElement(idx: Int): Any
    Definition Classes
    Moments → Product
  31. def productElementName(n: Int): String
    Definition Classes
    Product
  32. def productElementNames: Iterator[String]
    Definition Classes
    Product
  33. def productIterator: Iterator[Any]
    Definition Classes
    Product
  34. def productPrefix: String
    Definition Classes
    Product
  35. def scale(z: Double): Moments

    Scale all the moments by a constant.

    Scale all the moments by a constant. This allows you to use Moments with exponential decay

  36. def skewness: Double
  37. def stddev: Double
  38. final def synchronized[T0](arg0: => T0): T0
    Definition Classes
    AnyRef
  39. def toString(): String
    Definition Classes
    Moments → AnyRef → Any
  40. def totalWeight: Double
  41. def variance: Double
  42. final def wait(): Unit
    Definition Classes
    AnyRef
    Annotations
    @throws(classOf[java.lang.InterruptedException])
  43. final def wait(arg0: Long, arg1: Int): Unit
    Definition Classes
    AnyRef
    Annotations
    @throws(classOf[java.lang.InterruptedException])
  44. final def wait(arg0: Long): Unit
    Definition Classes
    AnyRef
    Annotations
    @throws(classOf[java.lang.InterruptedException]) @native()

Inherited from Serializable

Inherited from Product

Inherited from Equals

Inherited from AnyRef

Inherited from Any

Ungrouped