Class/Object

com.twitter.algebird

Correlation

Related Docs: object Correlation | package algebird

Permalink

case class Correlation(c2: Double, m2x: Double, m2y: Double, m1x: Double, m1y: Double, m0: Double) extends Product with Serializable

A class to calculate covariance and the first two central moments of a sequence of pairs of Doubles, from which the pearson correlation coeifficient can be calculated.

m{i}x denotes the ith central moment of the first projection of the pair. m{i}y denotes the ith central moment of the second projection of the pair. c2 the covariance equivalent of the second central moment, i.e. c2 = Sum_(x,y) (x - m1x)*(y - m1y).

Linear Supertypes
Serializable, Serializable, Product, Equals, AnyRef, Any
Ordering
  1. Alphabetic
  2. By Inheritance
Inherited
  1. Correlation
  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 Correlation(c2: Double, m2x: Double, m2y: Double, m1x: Double, m1y: Double, m0: Double)

    Permalink

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. final def asInstanceOf[T0]: T0

    Permalink
    Definition Classes
    Any
  5. val c2: Double

    Permalink
  6. def clone(): AnyRef

    Permalink
    Attributes
    protected[java.lang]
    Definition Classes
    AnyRef
    Annotations
    @throws( ... )
  7. def correlation: Double

    Permalink

    returns

    Pearson's correlation coefficient

  8. def covariance: Double

    Permalink
  9. def distanceMetric: Double

    Permalink
  10. final def eq(arg0: AnyRef): Boolean

    Permalink
    Definition Classes
    AnyRef
  11. def finalize(): Unit

    Permalink
    Attributes
    protected[java.lang]
    Definition Classes
    AnyRef
    Annotations
    @throws( classOf[java.lang.Throwable] )
  12. final def getClass(): Class[_]

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

    Permalink
    Definition Classes
    Any
  14. def linearLeastSquares: (Double, Double)

    Permalink

    Assume this instance of Correlation came from summing together Correlation.apply((x_i, y_i)) for i in 1...n.

    Assume this instance of Correlation came from summing together Correlation.apply((x_i, y_i)) for i in 1...n.

    returns

    (m, b) where y = mx + b is the line with the least squares fit of the points (x_i, y_i). See, e.g. https://mathworld.wolfram.com/LeastSquaresFitting.html.

  15. val m0: Double

    Permalink
  16. val m1x: Double

    Permalink
  17. val m1y: Double

    Permalink
  18. val m2x: Double

    Permalink
  19. val m2y: Double

    Permalink
  20. def meanX: Double

    Permalink
  21. def meanY: Double

    Permalink
  22. final def ne(arg0: AnyRef): Boolean

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

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

    Permalink
    Definition Classes
    AnyRef
  25. def scale(z: Double): Correlation

    Permalink
  26. def stddevX: Double

    Permalink
  27. def stddevY: Double

    Permalink
  28. def swap: Correlation

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

    Permalink
    Definition Classes
    AnyRef
  30. def totalWeight: Double

    Permalink
  31. def varianceX: Double

    Permalink
  32. def varianceY: Double

    Permalink
  33. final def wait(): Unit

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

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

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

Inherited from Serializable

Inherited from Serializable

Inherited from Product

Inherited from Equals

Inherited from AnyRef

Inherited from Any

Ungrouped