Packages

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

Value Members

  1. final def !=(arg0: Any): Boolean
    Definition Classes
    AnyRef → Any
  2. final def ##: Int
    Definition Classes
    AnyRef → Any
  3. final def ==(arg0: Any): Boolean
    Definition Classes
    AnyRef → Any
  4. final def asInstanceOf[T0]: T0
    Definition Classes
    Any
  5. val c2: Double
  6. def clone(): AnyRef
    Attributes
    protected[lang]
    Definition Classes
    AnyRef
    Annotations
    @throws(classOf[java.lang.CloneNotSupportedException]) @native()
  7. def correlation: Double

    returns

    Pearson's correlation coefficient

  8. def covariance: Double
  9. def distanceMetric: Double
  10. final def eq(arg0: AnyRef): Boolean
    Definition Classes
    AnyRef
  11. def finalize(): Unit
    Attributes
    protected[lang]
    Definition Classes
    AnyRef
    Annotations
    @throws(classOf[java.lang.Throwable])
  12. final def getClass(): Class[_ <: AnyRef]
    Definition Classes
    AnyRef → Any
    Annotations
    @native()
  13. final def isInstanceOf[T0]: Boolean
    Definition Classes
    Any
  14. def linearLeastSquares: (Double, Double)

    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
  16. val m1x: Double
  17. val m1y: Double
  18. val m2x: Double
  19. val m2y: Double
  20. def meanX: Double
  21. def meanY: Double
  22. final def ne(arg0: AnyRef): Boolean
    Definition Classes
    AnyRef
  23. final def notify(): Unit
    Definition Classes
    AnyRef
    Annotations
    @native()
  24. final def notifyAll(): Unit
    Definition Classes
    AnyRef
    Annotations
    @native()
  25. def productElementNames: Iterator[String]
    Definition Classes
    Product
  26. def scale(z: Double): Correlation
  27. def stddevX: Double
  28. def stddevY: Double
  29. def swap: Correlation
  30. final def synchronized[T0](arg0: => T0): T0
    Definition Classes
    AnyRef
  31. def totalWeight: Double
  32. def varianceX: Double
  33. def varianceY: Double
  34. final def wait(): Unit
    Definition Classes
    AnyRef
    Annotations
    @throws(classOf[java.lang.InterruptedException])
  35. final def wait(arg0: Long, arg1: Int): Unit
    Definition Classes
    AnyRef
    Annotations
    @throws(classOf[java.lang.InterruptedException])
  36. 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