Packages

case class Distribution[A](domain: Vector[A], notNormDistribution: Vector[BigDecimal]) extends Product with Serializable

A probability distribution over a domain of objects. If the initial distribution does not add up to 1.0, then it will be normalized.

A

The type of the domain this distribution is defined over.

domain

A vector of objects that makes up the domain of this distribution.

notNormDistribution

A (possibly not normalized) distribution.

Linear Supertypes
Type Hierarchy
Ordering
  1. Alphabetic
  2. By Inheritance
Inherited
  1. Distribution
  2. Serializable
  3. Serializable
  4. Product
  5. Equals
  6. AnyRef
  7. Any
Implicitly
  1. by any2stringadd
  2. by StringFormat
  3. by Ensuring
  4. by ArrowAssoc
  1. Hide All
  2. Show All
Visibility
  1. Public
  2. All

Instance Constructors

  1. new Distribution(domain: Vector[A], notNormDistribution: Vector[BigDecimal])

    domain

    A vector of objects that makes up the domain of this distribution.

    notNormDistribution

    A (possibly not normalized) distribution.

Value Members

  1. final def !=(arg0: Any): Boolean
    Definition Classes
    AnyRef → Any
  2. final def ##(): Int
    Definition Classes
    AnyRef → Any
  3. def +(other: String): String
    Implicit
    This member is added by an implicit conversion from Distribution[A] to any2stringadd[Distribution[A]] performed by method any2stringadd in scala.Predef.
    Definition Classes
    any2stringadd
  4. def ->[B](y: B): (Distribution[A], B)
    Implicit
    This member is added by an implicit conversion from Distribution[A] to ArrowAssoc[Distribution[A]] performed by method ArrowAssoc in scala.Predef.
    Definition Classes
    ArrowAssoc
    Annotations
    @inline()
  5. final def ==(arg0: Any): Boolean
    Definition Classes
    AnyRef → Any
  6. def addNotNorm(that: Distribution[A]): Distribution[A]

    Adds two not normalized distributions and returns the resulting distribution.

    Adds two not normalized distributions and returns the resulting distribution.

    that

    The distribution to add to this one.

  7. def apply(elem: A): Option[BigDecimal]

    Request the probability of elem.

    Request the probability of elem.

    elem

    The element in the domain for which the probability is requested.

    returns

    Probability of elem.

  8. def argMax: Option[A]

    Returns an index to the vector, pointing to the highest value in the vector.

    Returns an index to the vector, pointing to the highest value in the vector. If multiple maxima exist, it returns an index to one of those at random. If the vector distribution is empty, it returns None.

  9. final def asInstanceOf[T0]: T0
    Definition Classes
    Any
  10. def clone(): AnyRef
    Attributes
    protected[java.lang]
    Definition Classes
    AnyRef
    Annotations
    @native() @throws( ... )
  11. val distribution: Vector[BigDecimal]

    The (normalized) probability distribution.

  12. val domain: Vector[A]
  13. def ensuring(cond: (Distribution[A]) ⇒ Boolean, msg: ⇒ Any): Distribution[A]
    Implicit
    This member is added by an implicit conversion from Distribution[A] to Ensuring[Distribution[A]] performed by method Ensuring in scala.Predef.
    Definition Classes
    Ensuring
  14. def ensuring(cond: (Distribution[A]) ⇒ Boolean): Distribution[A]
    Implicit
    This member is added by an implicit conversion from Distribution[A] to Ensuring[Distribution[A]] performed by method Ensuring in scala.Predef.
    Definition Classes
    Ensuring
  15. def ensuring(cond: Boolean, msg: ⇒ Any): Distribution[A]
    Implicit
    This member is added by an implicit conversion from Distribution[A] to Ensuring[Distribution[A]] performed by method Ensuring in scala.Predef.
    Definition Classes
    Ensuring
  16. def ensuring(cond: Boolean): Distribution[A]
    Implicit
    This member is added by an implicit conversion from Distribution[A] to Ensuring[Distribution[A]] performed by method Ensuring in scala.Predef.
    Definition Classes
    Ensuring
  17. def entropy: BigDecimal

    Returns the Shannon information entropy of a distribution.

    Returns the Shannon information entropy of a distribution.

    For distributions that deviate from probability assumptions (i.e., the sum of the values equals 1.0), Shannon information entropy is ill-defined.

  18. final def eq(arg0: AnyRef): Boolean
    Definition Classes
    AnyRef
  19. def finalize(): Unit
    Attributes
    protected[java.lang]
    Definition Classes
    AnyRef
    Annotations
    @throws( classOf[java.lang.Throwable] )
  20. def formatted(fmtstr: String): String
    Implicit
    This member is added by an implicit conversion from Distribution[A] to StringFormat[Distribution[A]] performed by method StringFormat in scala.Predef.
    Definition Classes
    StringFormat
    Annotations
    @inline()
  21. final def getClass(): Class[_]
    Definition Classes
    AnyRef → Any
    Annotations
    @native()
  22. final def isInstanceOf[T0]: Boolean
    Definition Classes
    Any
  23. def length: Int

    Returns the number of elements in the distribution.

  24. final def ne(arg0: AnyRef): Boolean
    Definition Classes
    AnyRef
  25. val notNormDistribution: Vector[BigDecimal]
    Attributes
    protected
  26. final def notify(): Unit
    Definition Classes
    AnyRef
    Annotations
    @native()
  27. final def notifyAll(): Unit
    Definition Classes
    AnyRef
    Annotations
    @native()
  28. def prodNotNorm(value: BigDecimal): Distribution[A]

    Returns the distribution multiplied by a value.

    Returns the distribution multiplied by a value. Note that the normalized distribution will not change.

    value

    A number with which the distribution should be multiplied.

  29. def sample(n: Int): List[A]

    Draws

    Draws

    n

    samples from the distribution.

    n }}}

    n

    The number of samples to draw.

    returns

    A list of

    n
  30. def sample: A

    Draws a sample from the distribution, proportionate to the probabilities.

  31. def softArgMax(beta: BigDecimal): Option[A]

    Returns an index to the distribution according to soft argMax with parameter beta.

    Returns an index to the distribution according to soft argMax with parameter beta. If beta -> Inf, this function is equivalent to argMax. If the vector values is empty, it returns None.

    beta

    The beta parameter, >=0. Soft argmax is ill-defined for negative beta values.

    returns

    An index pointing to the value in the distribution

    See also

    See this Wikipedia page for a mathmatical definition of soft argmax https://en.wikipedia.org/wiki/Softmax_function.

  32. final def synchronized[T0](arg0: ⇒ T0): T0
    Definition Classes
    AnyRef
  33. def toString(): String
    Definition Classes
    Distribution → AnyRef → Any
  34. final def wait(): Unit
    Definition Classes
    AnyRef
    Annotations
    @throws( ... )
  35. final def wait(arg0: Long, arg1: Int): Unit
    Definition Classes
    AnyRef
    Annotations
    @throws( ... )
  36. final def wait(arg0: Long): Unit
    Definition Classes
    AnyRef
    Annotations
    @native() @throws( ... )
  37. def [B](y: B): (Distribution[A], B)
    Implicit
    This member is added by an implicit conversion from Distribution[A] to ArrowAssoc[Distribution[A]] performed by method ArrowAssoc in scala.Predef.
    Definition Classes
    ArrowAssoc

Inherited from Serializable

Inherited from Serializable

Inherited from Product

Inherited from Equals

Inherited from AnyRef

Inherited from Any

Inherited by implicit conversion any2stringadd from Distribution[A] to any2stringadd[Distribution[A]]

Inherited by implicit conversion StringFormat from Distribution[A] to StringFormat[Distribution[A]]

Inherited by implicit conversion Ensuring from Distribution[A] to Ensuring[Distribution[A]]

Inherited by implicit conversion ArrowAssoc from Distribution[A] to ArrowAssoc[Distribution[A]]

Ungrouped