DiscreteDistr

vecxt_re.DiscreteDistr
trait DiscreteDistr[T] extends Density[T], Rand[T]

Represents a discrete Distribution

Attributes

Graph
Supertypes
trait Rand[T]
trait Density[T]
class Object
trait Matchable
class Any
Known subtypes
class Empirical
class Poisson

Members list

Value members

Abstract methods

def probabilityOf(x: T): Double

Returns the probability of that draw.

Returns the probability of that draw.

Attributes

Concrete methods

def apply(x: T): Double

Returns the unnormalized value of the measure

Returns the unnormalized value of the measure

Attributes

override def logApply(x: T): Double

Returns the log unnormalized value of the measure

Returns the log unnormalized value of the measure

Attributes

Definition Classes
def logProbabilityOf(x: T): Double
def unnormalizedLogProbabilityOf(x: T): Double
def unnormalizedProbabilityOf(x: T): Double

Returns the probability of that draw up to a constant

Returns the probability of that draw up to a constant

Attributes

Inherited methods

def drawOpt: Option[T]

Overridden by filter/map/flatmap for monadic invocations. Basically, rejection samplers will return None here

Overridden by filter/map/flatmap for monadic invocations. Basically, rejection samplers will return None here

Attributes

Inherited from:
Rand
def flatMap[E](f: T => Rand[E]): Rand[E]

Attributes

Inherited from:
Rand
inline def get: T

Attributes

Inherited from:
Rand
def map[E](f: T => E): Rand[E]

Converts a random sampler of one type to a random sampler of another type. Examples: uniform.map(_2) gives a Rand[Double] in the range [0,2] Equivalently, for(x <- uniform) yield 2x

Converts a random sampler of one type to a random sampler of another type. Examples: uniform.map(_2) gives a Rand[Double] in the range [0,2] Equivalently, for(x <- uniform) yield 2x

Value parameters

f

the transform to apply to the sampled value.

Attributes

Inherited from:
Rand
inline def sample(n: Int): IndexedSeq[T]

Gets n samples from the distribution.

Gets n samples from the distribution.

Attributes

Inherited from:
Rand
inline def sample: T

Gets one sample from the distribution. Equivalent to get

Gets one sample from the distribution. Equivalent to get

Attributes

Inherited from:
Rand
def sampleTo[C](n: Int)(using factory: Factory[T, C]): C

Gets n samples from the distribution into a specified collection type.

Gets n samples from the distribution into a specified collection type.

Attributes

Inherited from:
Rand
inline def samples: Iterator[T]

An infinitely long iterator that samples repeatedly from the Rand

An infinitely long iterator that samples repeatedly from the Rand

Attributes

Returns

an iterator that repeatedly samples

Inherited from:
Rand
def withFilter(p: T => Boolean): Rand[T]

Attributes

Inherited from:
Rand

Inherited and Abstract methods

def draw: T

Gets one sample from the distribution. Equivalent to sample

Gets one sample from the distribution. Equivalent to sample

Attributes

Inherited from:
Rand