All Downloads are FREE. Search and download functionalities are using the official Maven repository.

axle.stats.Independence.scala Maven / Gradle / Ivy

The newest version!
package axle.stats

import spire.algebra.Eq
import spire.algebra.Field

/**
 *
 * Read: "X is independent of Y given Z"
 */

case class Independence[T: Eq, N: Field](
  X: Set[Distribution[T, N]],
  Z: Set[Distribution[T, N]],
  Y: Set[Distribution[T, N]]) {

  def variablesToString(s: Set[Distribution[T, N]]): String = "{" + (s map { _.name }).mkString(", ") + "}"

  override def toString: String =
    "I(" + variablesToString(X) + ", " + variablesToString(Z) + ", " + variablesToString(Y) + ")"

}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy