Poisson

vecxt_re.Poisson
See thePoisson companion object
case class Poisson(lambda: Double) extends DiscreteDistr[Int], HasMean[Double], HasCdf[Int], HasVariance[Double]

Poisson Distribution.

The Poisson distribution models the number of events occurring in a fixed interval of time or space, given that these events occur with a known constant mean rate and independently of the time since the last event.

Parameterization:

  • λ (lambda) = mean = variance

PMF: P(X = k) = λ^k * e^(-λ) / k!

The Poisson distribution is a limiting case of the Negative Binomial distribution as the dispersion parameter b → 0.

Value parameters

lambda

the rate parameter (must be positive)

Attributes

Companion
object
Graph
Supertypes
trait Serializable
trait Product
trait Equals
trait HasVariance[Double]
trait HasCdf[Int]
trait HasMean[Double]
trait DiscreteDistr[Int]
trait Rand[Int]
trait Density[Int]
class Object
trait Matchable
class Any
Show all

Members list

Value members

Concrete methods

override def cdf(x: Int): Double

Attributes

Definition Classes
inline def draw: Int

Draw a sample from the Poisson distribution

Draw a sample from the Poisson distribution

Attributes

override def logProbabilityOf(x: Int): Double

Log PMF: log P(X = k) = k*log(λ) - λ - log(k!)

Log PMF: log P(X = k) = k*log(λ) - λ - log(k!)

Attributes

Definition Classes
inline def mean: Double
def plot(using LowPriorityPlotTarget): VizReturn
def plot(mods: Seq[SpecMod])(using LowPriorityPlotTarget): VizReturn

As plot, applying mods (e.g. Plots.fixedSize) to the spec after the built-in modifications.

As plot, applying mods (e.g. Plots.fixedSize) to the spec after the built-in modifications.

Attributes

def plotCdf(using LowPriorityPlotTarget): VizReturn
def plotCdf(mods: Seq[SpecMod])(using LowPriorityPlotTarget): VizReturn

As plotCdf, applying mods (e.g. Plots.fixedSize) to the spec after the built-in modifications.

As plotCdf, applying mods (e.g. Plots.fixedSize) to the spec after the built-in modifications.

Attributes

override def probability(x: Int, y: Int): Double

Attributes

Definition Classes
def probabilityOf(x: Int): Double

PMF: P(X = k) = λ^k * e^(-λ) / k!

PMF: P(X = k) = λ^k * e^(-λ) / k!

Attributes

inline def variance: Double

Inherited methods

def apply(x: Int): Double

Returns the unnormalized value of the measure

Returns the unnormalized value of the measure

Attributes

Inherited from:
DiscreteDistr
def drawOpt: Option[Int]

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: Int => Rand[E]): Rand[E]

Attributes

Inherited from:
Rand
inline def get: Int

Attributes

Inherited from:
Rand
override def logApply(x: Int): Double

Returns the log unnormalized value of the measure

Returns the log unnormalized value of the measure

Attributes

Definition Classes
Inherited from:
DiscreteDistr
def map[E](f: Int => 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
def productElementNames: Iterator[String]

An iterator over the names of all the elements of this product.

An iterator over the names of all the elements of this product.

Attributes

Inherited from:
Product
def productIterator: Iterator[Any]

An iterator over all the elements of this product.

An iterator over all the elements of this product.

Attributes

Returns

in the default implementation, an Iterator[Any]

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

Gets n samples from the distribution.

Gets n samples from the distribution.

Attributes

Inherited from:
Rand
inline def sample: Int

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[Int, 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[Int]

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 unnormalizedLogProbabilityOf(x: Int): Double

Attributes

Inherited from:
DiscreteDistr
def unnormalizedProbabilityOf(x: Int): Double

Returns the probability of that draw up to a constant

Returns the probability of that draw up to a constant

Attributes

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

Attributes

Inherited from:
Rand