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).
- Alphabetic
- By Inheritance
- Correlation
- Serializable
- Product
- Equals
- AnyRef
- Any
- Hide All
- Show All
- Public
- Protected
Instance Constructors
- new Correlation(c2: Double, m2x: Double, m2y: Double, m1x: Double, m1y: Double, m0: Double)
Value Members
- final def !=(arg0: Any): Boolean
- Definition Classes
- AnyRef → Any
- final def ##: Int
- Definition Classes
- AnyRef → Any
- final def ==(arg0: Any): Boolean
- Definition Classes
- AnyRef → Any
- final def asInstanceOf[T0]: T0
- Definition Classes
- Any
- val c2: Double
- def clone(): AnyRef
- Attributes
- protected[lang]
- Definition Classes
- AnyRef
- Annotations
- @throws(classOf[java.lang.CloneNotSupportedException]) @native()
- def correlation: Double
- returns
Pearson's correlation coefficient
- def covariance: Double
- def distanceMetric: Double
- final def eq(arg0: AnyRef): Boolean
- Definition Classes
- AnyRef
- def finalize(): Unit
- Attributes
- protected[lang]
- Definition Classes
- AnyRef
- Annotations
- @throws(classOf[java.lang.Throwable])
- final def getClass(): Class[_ <: AnyRef]
- Definition Classes
- AnyRef → Any
- Annotations
- @native()
- final def isInstanceOf[T0]: Boolean
- Definition Classes
- Any
- 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.
- val m0: Double
- val m1x: Double
- val m1y: Double
- val m2x: Double
- val m2y: Double
- def meanX: Double
- def meanY: Double
- final def ne(arg0: AnyRef): Boolean
- Definition Classes
- AnyRef
- final def notify(): Unit
- Definition Classes
- AnyRef
- Annotations
- @native()
- final def notifyAll(): Unit
- Definition Classes
- AnyRef
- Annotations
- @native()
- def productElementNames: Iterator[String]
- Definition Classes
- Product
- def scale(z: Double): Correlation
- def stddevX: Double
- def stddevY: Double
- def swap: Correlation
- final def synchronized[T0](arg0: => T0): T0
- Definition Classes
- AnyRef
- def totalWeight: Double
- def varianceX: Double
- def varianceY: Double
- final def wait(): Unit
- Definition Classes
- AnyRef
- Annotations
- @throws(classOf[java.lang.InterruptedException])
- final def wait(arg0: Long, arg1: Int): Unit
- Definition Classes
- AnyRef
- Annotations
- @throws(classOf[java.lang.InterruptedException])
- final def wait(arg0: Long): Unit
- Definition Classes
- AnyRef
- Annotations
- @throws(classOf[java.lang.InterruptedException]) @native()