final case class FiniteDistribution[T](pmf: Vector[Weighted[T]]) extends AnyVal with ProbabilityDistribution[T] with Product with Serializable
Finite distributions, often supposed to be probability distributions, but may also be tangents to this or intermediates.
- pmf
probability mass function, may have same object split.
- Alphabetic
- By Inheritance
- FiniteDistribution
- Serializable
- Product
- Equals
- ProbabilityDistribution
- AnyVal
- Any
- by any2stringadd
- by StringFormat
- by Ensuring
- by ArrowAssoc
- Hide All
- Show All
- Public
- Protected
Instance Constructors
Value Members
- final def !=(arg0: Any): Boolean
- Definition Classes
- Any
- final def ##: Int
- Definition Classes
- Any
- def *(sc: Double): FiniteDistribution[T]
- def +(elem: T, prob: Double): FiniteDistribution[T]
- def ++(that: FiniteDistribution[T]): FiniteDistribution[T]
- def --(that: FiniteDistribution[T]): FiniteDistribution[T]
- def ->[B](y: B): (FiniteDistribution[T], B)
- Implicit
- This member is added by an implicit conversion from FiniteDistribution[T] toArrowAssoc[FiniteDistribution[T]] performed by method ArrowAssoc in scala.Predef.
- Definition Classes
- ArrowAssoc
- Annotations
- @inline()
- def <++>(components: => Vector[Weighted[ProbabilityDistribution[T]]]): Mixture[T]
mix in weighted distributions; the mixed in distributions are called by name, so can depend on this distribution.
mix in weighted distributions; the mixed in distributions are called by name, so can depend on this distribution.
- Definition Classes
- ProbabilityDistribution
- def <+>(mixin: => ProbabilityDistribution[T], weight: Double): Mixin[T]
generates from the mixed in distribution with probability _weight_, otherwise defaults to this distribution; as the mixed in distribution is called by name, it may depend on the present one.
generates from the mixed in distribution with probability _weight_, otherwise defaults to this distribution; as the mixed in distribution is called by name, it may depend on the present one.
- Definition Classes
- ProbabilityDistribution
- def <+?>(mixin: => ProbabilityDistribution[Option[T]], weight: Double): MixinOpt[T]
generates from the mixed in optional valued distribution with probability
weight
, otherwise, or if the optional returns None, defaults to this distribution; the mixed in distribution is call by name, so may depend on this distribution.generates from the mixed in optional valued distribution with probability
weight
, otherwise, or if the optional returns None, defaults to this distribution; the mixed in distribution is call by name, so may depend on this distribution.- Definition Classes
- ProbabilityDistribution
- final def ==(arg0: Any): Boolean
- Definition Classes
- Any
- def KLfeedback(baseweights: (T) => Double, strictness: Double = 1.0): FiniteDistribution[T]
gradient w.r.t.
gradient w.r.t. inner product scaled by presentation weights, perpendicular to the gradient (w.r.t. same inner product) of the "total weight" function.
- def apply(label: T): Double
weight of the label.
- final def asInstanceOf[T0]: T0
- Definition Classes
- Any
- def collect[S](f: PartialFunction[T, S]): FiniteDistribution[S]
- def condMap[S](f: (T) => Option[S]): FiniteDistribution[S]
- Definition Classes
- FiniteDistribution → ProbabilityDistribution
- def conditioned(p: (T) => Boolean): FiniteDistribution[T]
- Definition Classes
- FiniteDistribution → ProbabilityDistribution
- def dot(that: FiniteDistribution[T]): Double
- def ensuring(cond: (FiniteDistribution[T]) => Boolean, msg: => Any): FiniteDistribution[T]
- Implicit
- This member is added by an implicit conversion from FiniteDistribution[T] toEnsuring[FiniteDistribution[T]] performed by method Ensuring in scala.Predef.
- Definition Classes
- Ensuring
- def ensuring(cond: (FiniteDistribution[T]) => Boolean): FiniteDistribution[T]
- Implicit
- This member is added by an implicit conversion from FiniteDistribution[T] toEnsuring[FiniteDistribution[T]] performed by method Ensuring in scala.Predef.
- Definition Classes
- Ensuring
- def ensuring(cond: Boolean, msg: => Any): FiniteDistribution[T]
- Implicit
- This member is added by an implicit conversion from FiniteDistribution[T] toEnsuring[FiniteDistribution[T]] performed by method Ensuring in scala.Predef.
- Definition Classes
- Ensuring
- def ensuring(cond: Boolean): FiniteDistribution[T]
- Implicit
- This member is added by an implicit conversion from FiniteDistribution[T] toEnsuring[FiniteDistribution[T]] performed by method Ensuring in scala.Predef.
- Definition Classes
- Ensuring
- def entropy(elem: T): Double
- def entropyVec: Vector[Weighted[T]]
- def entropyView: Vector[Weighted[String]]
- def expectation(implicit ls: VectorSpace[T, Double]): T
- def fibProduct[Q, B](quot: (T) => Q, fibers: (Q) => ProbabilityDistribution[B]): FiberProduct[T, Q, B]
- Definition Classes
- ProbabilityDistribution
- def filter(p: (T) => Boolean): FiniteDistribution[T]
- def findFut(p: (T) => Boolean, maxloops: Long): Future[Option[T]]
Find element satisfying predicate, runs concurrently, returning future
Find element satisfying predicate, runs concurrently, returning future
- Definition Classes
- ProbabilityDistribution
- def flatMap[S](f: (T) => FiniteDistribution[S]): FiniteDistribution[S]
- def flatMap[B](f: (T) => ProbabilityDistribution[B]): ProbabilityDistribution[B]
- Definition Classes
- ProbabilityDistribution
- def flatten: FiniteDistribution[T]
- def formatted(fmtstr: String): String
- Implicit
- This member is added by an implicit conversion from FiniteDistribution[T] toStringFormat[FiniteDistribution[T]] performed by method StringFormat in scala.Predef.
- Definition Classes
- StringFormat
- Annotations
- @inline()
- def getClass(): Class[_ <: AnyVal]
- Definition Classes
- AnyVal → Any
- def getsum(label: T): Double
- def inRatioBall(that: FiniteDistribution[T], ratio: Double): Boolean
- def innerProduct(that: FiniteDistribution[T]): Double
- def integral(f: (T) => Double): Double
- def invmap[S](f: (S) => T, support: Iterable[S]): FiniteDistribution[S]
- def invmapOpt[S](f: (S) => Option[T], support: Iterable[S]): FiniteDistribution[S]
- final def isInstanceOf[T0]: Boolean
- Definition Classes
- Any
- def klDivergence(that: FiniteDistribution[T]): Double
- def map[S](f: (T) => S): FiniteDistribution[S]
- Definition Classes
- FiniteDistribution → ProbabilityDistribution
- def mapOpt[S](f: (T) => Option[S]): FiniteDistribution[S]
- def memo: Map[T, Double]
- def next: T
next instance of a random variable with the given distribution
next instance of a random variable with the given distribution
- Definition Classes
- FiniteDistribution → ProbabilityDistribution
- def norm: Double
l1-norm
- def normalized(t: Double = 0.0): FiniteDistribution[T]
- def pickle: List[(String, Double)]
- val pmf: Vector[Weighted[T]]
- def pmfVec: Vector[(T, Double)]
- def posmf(t: Double = 0.0): Vector[Weighted[T]]
objects with positive probability (or bounded below by a threshhold)
- def postotal(t: Double = 0.0): Double
total of the positive weights
- def product[B](that: ProbabilityDistribution[B]): Product[T, B]
- Definition Classes
- ProbabilityDistribution
- def productElementNames: Iterator[String]
- Definition Classes
- Product
- def pruneMap[S](f: => (T) => S, epsilon: Double): FiniteDistribution[S]
- def prunedPMF(epsilon: Double): Vector[Weighted[T]]
- def purge(epsilon: Double): FiniteDistribution[T]
- def randomVariable: Iterator[T]
- Definition Classes
- ProbabilityDistribution
- def rawfeedback(baseweights: (T) => Double, damp: Double = 0.1, strictness: Double = 1.0): FiniteDistribution[T]
entropy feedback for the finite distribution to move in the direction of the base distribution, however values outside support are ignored.
entropy feedback for the finite distribution to move in the direction of the base distribution, however values outside support are ignored. warning: should come after ++ to ensure implementation choice.
- baseweights
base weights
- def restrict(s: Set[T]): FiniteDistribution[T]
- def safeNormalized: FiniteDistribution[T]
normalize if possible, otherwise empty.
- def smoothedFeedback(baseweights: (T) => Double, damp: Double = 0.1, strictness: Double = 1.0): FiniteDistribution[T]
entropy feedback for the finite distribution to move in the direction of the base distribution, however values outside support are ignored.
entropy feedback for the finite distribution to move in the direction of the base distribution, however values outside support are ignored. smoothed to ensure at most proportional to the target probability warning: should come after ++ to ensure implementation choice.
- baseweights
base weights
- def sort: FiniteDistribution[T]
- def split(groups: Int): Map[Int, FiniteDistribution[T]]
- def supp: Vector[T]
- def support: Set[T]
- def toMap: Map[T, Double]
- def toString(): String
- Definition Classes
- FiniteDistribution → Any
- def total: Double
- def zip[S](that: FiniteDistribution[S]): FiniteDistribution[(T, S)]
Shadowed Implicit Value Members
- def +(other: String): String
- Implicit
- This member is added by an implicit conversion from FiniteDistribution[T] toany2stringadd[FiniteDistribution[T]] performed by method any2stringadd in scala.Predef.
- Shadowing
- This implicitly inherited member is shadowed by one or more members in this class.
To access this member you can use a type ascription:(finiteDistribution: any2stringadd[FiniteDistribution[T]]).+(other)
- Definition Classes
- any2stringadd
Deprecated Value Members
- def →[B](y: B): (FiniteDistribution[T], B)
- Implicit
- This member is added by an implicit conversion from FiniteDistribution[T] toArrowAssoc[FiniteDistribution[T]] performed by method ArrowAssoc in scala.Predef.
- Definition Classes
- ArrowAssoc
- Annotations
- @deprecated
- Deprecated
(Since version 2.13.0) Use
->
instead. If you still wish to display it as one character, consider using a font with programming ligatures such as Fira Code.