trait ProbabilityDistribution[A] extends Any
A probability distribution, from which we can pick values at random (the only abstract method). We can obtain a random variable from this, which is an iterator.
- Self Type
- ProbabilityDistribution[A]
- Alphabetic
- By Inheritance
- ProbabilityDistribution
- Any
- by any2stringadd
- by StringFormat
- by Ensuring
- by ArrowAssoc
- Hide All
- Show All
- Public
- Protected
Abstract Value Members
- abstract def next: A
the next random value
Concrete Value Members
- def <++>(components: => Vector[Weighted[ProbabilityDistribution[A]]]): Mixture[A]
mix in weighted distributions; the mixed in distributions are called by name, so can depend on this distribution.
- def <+>(mixin: => ProbabilityDistribution[A], weight: Double): Mixin[A]
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.
- def <+?>(mixin: => ProbabilityDistribution[Option[A]], weight: Double): MixinOpt[A]
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. - def condMap[B](f: (A) => Option[B]): ProbabilityDistribution[B]
- def conditioned(p: (A) => Boolean): ProbabilityDistribution[A]
- def fibProduct[Q, B](quot: (A) => Q, fibers: (Q) => ProbabilityDistribution[B]): FiberProduct[A, Q, B]
- def findFut(p: (A) => Boolean, maxloops: Long): Future[Option[A]]
Find element satisfying predicate, runs concurrently, returning future
- def flatMap[B](f: (A) => ProbabilityDistribution[B]): ProbabilityDistribution[B]
- def map[B](f: (A) => B): ProbabilityDistribution[B]
- def product[B](that: ProbabilityDistribution[B]): Product[A, B]
- def randomVariable: Iterator[A]