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
- 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 <++>(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
- 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.
- 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 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 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]
- 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)]